From 0e693565fd1b4b42b3121672a9a49d63fca8362a Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 25 Sep 2024 14:12:04 +0000 Subject: [PATCH 1/5] Update Generator Version 3.0.0-beta.20240925.3 --- eng/Packages.Data.props | 2 +- eng/emitter-package-lock.json | 40 +++++++++++++++++------------------ eng/emitter-package.json | 6 +++--- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 8694a0d6f2e2b..5195df78c7cbf 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -227,7 +227,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index e4a0cbfefa0c0..4dc3fad1e4d69 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,14 +5,14 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240924.3" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240925.3" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.46.0", "@azure-tools/typespec-azure-core": "0.46.0", - "@azure-tools/typespec-azure-resource-manager": "0.46.0", + "@azure-tools/typespec-azure-resource-manager": "0.46.1", "@azure-tools/typespec-azure-rulesets": "0.46.0", - "@azure-tools/typespec-client-generator-core": "0.46.1", + "@azure-tools/typespec-client-generator-core": "0.46.2", "@typespec/compiler": "0.60.0", "@typespec/http": "0.60.0", "@typespec/openapi": "0.60.0", @@ -22,9 +22,9 @@ } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20240924.3", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240924.3.tgz", - "integrity": "sha512-cmtAQzHtNZ27ZLqTj8ctl0vve267aItkEOOvg7DGksILK92APmJZCO0gsw605RVUyBZcfFMScIyBZ/Z4nAVvQg==" + "version": "3.0.0-beta.20240925.3", + "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240925.3.tgz", + "integrity": "sha512-FvQHS4qUWfcOFd3Xh9Z+g12ijTcj2T/efk0trG19BtAyONkQz8NJTBtu1TGFmM8JrPnJl4t58leaKvhUoFE1GQ==" }, "node_modules/@azure-tools/typespec-autorest": { "version": "0.46.0", @@ -60,9 +60,9 @@ } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.46.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.46.0.tgz", - "integrity": "sha512-ileS/0OMp0pmtWU3k0g2ZGfA957nOiEHtFJzAILsYYBFeBWgWuEuCPcKaGYScvlYTTK4Pyplpb7u00RBZBBObQ==", + "version": "0.46.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.46.1.tgz", + "integrity": "sha512-8md8AwnxoYVkDBavQL5dbToUTS10PTSkcF+emd9BKEdnF9MKuA542vZudzaQOz2BzFbArMVUE/PLm2mhuwRkLw==", "dev": true, "dependencies": { "change-case": "~5.4.4", @@ -96,9 +96,9 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.46.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.46.1.tgz", - "integrity": "sha512-mXA+ia5vS0yxPnxRW/vjKBJP5U4e4T5Gcr+GRjuS4+1gGolmklV2prJsXdR4iFLSVFfcH1zBFXQ2OPqsI5GMJw==", + "version": "0.46.2", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.46.2.tgz", + "integrity": "sha512-/HKeehCNDeylouOHMe7IwpcDcGJHRAuEy3a5FBnSY51m4EpMq4VMQzW9tka/8brFO2m5LLj7tyhOL/xnzi2fLg==", "dev": true, "dependencies": { "change-case": "~5.4.4", @@ -117,12 +117,12 @@ } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20240924.3", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240924.3.tgz", - "integrity": "sha512-y9Dp2MeBLXzDikgNJSYczwa5igguCctqpkIOGTAA784Ld5Hb68XUsqVcFxlE3sYzrsZoc8VwqxRhDRtmJyiT+w==", + "version": "0.2.0-beta.20240925.3", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240925.3.tgz", + "integrity": "sha512-P/t8AJFz2YadM7PsJYz9ruxAPGJUChRWPL7XUzQrPfFe7twjDjBtn78s/MqiR7+jI8435Os7Jc59j8ivY7/RUQ==", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20240924.3", - "@typespec/http-client-csharp": "0.1.9-alpha.20240924.2", + "@autorest/csharp": "3.0.0-beta.20240925.3", + "@typespec/http-client-csharp": "0.1.9-alpha.20240925.1", "json-serialize-refs": "0.1.0-0" }, "peerDependencies": { @@ -265,9 +265,9 @@ } }, "node_modules/@typespec/http-client-csharp": { - "version": "0.1.9-alpha.20240924.2", - "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-0.1.9-alpha.20240924.2.tgz", - "integrity": "sha512-byWativYJbeTq2GNRlwWV7zJhJxbAFFthYkNpmyJyLBW/POe64iHlcHVe3aR4qPjAbmoK1OKe+QT+a9mB1GONg==", + "version": "0.1.9-alpha.20240925.1", + "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-0.1.9-alpha.20240925.1.tgz", + "integrity": "sha512-lQaWMaTSTxIxWLO9q6Z11YqyT+E1Ij5jiwnqNyycfLMDcfQj4hN/K4jCrS9SBI2Sr43H02mReqRJXAxp4fz7vQ==", "dependencies": { "json-serialize-refs": "0.1.0-0" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 98e000f39f5ed..9cc07ae915bcc 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,14 +1,14 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240924.3" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240925.3" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.46.0", "@azure-tools/typespec-azure-core": "0.46.0", - "@azure-tools/typespec-azure-resource-manager": "0.46.0", + "@azure-tools/typespec-azure-resource-manager": "0.46.1", "@azure-tools/typespec-azure-rulesets": "0.46.0", - "@azure-tools/typespec-client-generator-core": "0.46.1", + "@azure-tools/typespec-client-generator-core": "0.46.2", "@typespec/compiler": "0.60.0", "@typespec/http": "0.60.0", "@typespec/openapi": "0.60.0", From b9821545ebf4b02071742963987106c908cc7caa Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 25 Sep 2024 14:43:38 +0000 Subject: [PATCH 2/5] Update SDK codes he_ma_3 --- ...le_InformaticaServerlessRuntimeResource.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/samples/Generated/Samples/Sample_InformaticaServerlessRuntimeResource.cs b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/samples/Generated/Samples/Sample_InformaticaServerlessRuntimeResource.cs index 157227c28a3c8..0d8fa39ae8110 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/samples/Generated/Samples/Sample_InformaticaServerlessRuntimeResource.cs +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/samples/Generated/Samples/Sample_InformaticaServerlessRuntimeResource.cs @@ -308,5 +308,37 @@ public async Task StartFailedServerlessRuntime_ServerlessRuntimesStartFailedServ Console.WriteLine($"Succeeded"); } + + // ServerlessRuntimes_ServerlessResourceById + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetServerlessResourceById_ServerlessRuntimesServerlessResourceById() + { + // Generated from example definition: 2024-05-08/ServerlessRuntimes_ServerlessResourceById_MaximumSet_Gen.json + // this example is just showing the usage of "ServerlessRuntimes_GetServerlessResourceById" 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 InformaticaServerlessRuntimeResource created on azure + // for more information of creating InformaticaServerlessRuntimeResource, please refer to the document of InformaticaServerlessRuntimeResource + string subscriptionId = "3599DA28-E346-4D9F-811E-189C0445F0FE"; + string resourceGroupName = "rgopenapi"; + string organizationName = "_RD_R"; + string serverlessRuntimeName = "serverlessRuntimeName159"; + ResourceIdentifier informaticaServerlessRuntimeResourceId = InformaticaServerlessRuntimeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, organizationName, serverlessRuntimeName); + InformaticaServerlessRuntimeResource informaticaServerlessRuntime = client.GetInformaticaServerlessRuntimeResource(informaticaServerlessRuntimeResourceId); + + // invoke the operation + InformaticaServerlessRuntimeResource result = await informaticaServerlessRuntime.GetServerlessResourceByIdAsync(); + + // 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 + InformaticaServerlessRuntimeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } From ac9a8289dd1ce75063de0b7db28ac19c2bb003ac Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 25 Sep 2024 14:44:07 +0000 Subject: [PATCH 3/5] Update SDK codes de_he_2 --- .../Sample_SubscriptionResourceExtensions.cs | 29 + .../src/Generated/Docs/EasmClient.xml | 754 ++------------- .../Generated/Samples/Samples_EasmClient.cs | 904 +++--------------- .../Samples/Sample_FabricCapacityResource.cs | 31 + 4 files changed, 270 insertions(+), 1448 deletions(-) diff --git a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 5955df25941cc..19b6955303f48 100644 --- a/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -44,5 +44,34 @@ public async Task GetSkusByLocation_SkuListByLocation() Console.WriteLine($"Succeeded"); } + + // SubscriptionUsages_Usages + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetUsages_SubscriptionUsagesUsages() + { + // Generated from example definition: 2024-04-04-preview/SubscriptionUsages_Usages.json + // this example is just showing the usage of "SubscriptionUsages_GetUsages" 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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "a2e95d27-c161-4b61-bda4-11512c14c2c2"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + AzureLocation location = new AzureLocation("eastus"); + await foreach (DevOpsResourceQuota item in subscriptionResource.GetUsagesAsync(location)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml index 61714420b8a4c..315aea4ad7e4b 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml +++ b/sdk/easm/Azure.Analytics.Defender.Easm/src/Generated/Docs/EasmClient.xml @@ -407,33 +407,20 @@ Console.WriteLine(response.Status); This sample shows how to call ValidateDiscoveryGroupAsync. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -DiscoveryGroupPayload body = new DiscoveryGroupPayload(); -Response response = await client.ValidateDiscoveryGroupAsync(body); -]]> -This sample shows how to call ValidateDiscoveryGroupAsync with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { - Name = "", - Description = "", - Tier = "", - FrequencyMilliseconds = 1234L, + Description = "This is a disco group", + Tier = "advanced", + FrequencyMilliseconds = 604800000, Seeds = {new DiscoverySource { - Kind = DiscoverySourceKind.As, - Name = "", + Kind = DiscoverySourceKind.Host, + Name = "thisisatest.microsoft.com", }}, - Names = { "" }, - Excludes = { default }, - TemplateId = "", }; Response response = await client.ValidateDiscoveryGroupAsync(body); ]]> @@ -442,33 +429,20 @@ Response response = await client.ValidateDiscoveryGroupAsync(bod This sample shows how to call ValidateDiscoveryGroup. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -DiscoveryGroupPayload body = new DiscoveryGroupPayload(); -Response response = client.ValidateDiscoveryGroup(body); -]]> -This sample shows how to call ValidateDiscoveryGroup with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { - Name = "", - Description = "", - Tier = "", - FrequencyMilliseconds = 1234L, + Description = "This is a disco group", + Tier = "advanced", + FrequencyMilliseconds = 604800000, Seeds = {new DiscoverySource { - Kind = DiscoverySourceKind.As, - Name = "", + Kind = DiscoverySourceKind.Host, + Name = "thisisatest.microsoft.com", }}, - Names = { "" }, - Excludes = { default }, - TemplateId = "", }; Response response = client.ValidateDiscoveryGroup(body); ]]> @@ -477,479 +451,217 @@ Response response = client.ValidateDiscoveryGroup(body); This sample shows how to call ValidateDiscoveryGroupAsync and parse the result. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = await client.ValidateDiscoveryGroupAsync(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); -]]> -This sample shows how to call ValidateDiscoveryGroupAsync with all request content and parse the result. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - name = "", - description = "", - tier = "", - frequencyMilliseconds = 1234L, + description = "This is a disco group", + frequencyMilliseconds = 604800000, + tier = "advanced", seeds = new object[] { new { - kind = "as", - name = "", + name = "thisisatest.microsoft.com", + kind = "host", } }, - names = new object[] - { - "" - }, - excludes = new object[] - { - null - }, - templateId = "", }); Response response = await client.ValidateDiscoveryGroupAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); +Console.WriteLine(result.ToString()); ]]> This sample shows how to call ValidateDiscoveryGroup and parse the result. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = client.ValidateDiscoveryGroup(content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.ToString()); -]]> -This sample shows how to call ValidateDiscoveryGroup with all request content and parse the result. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - name = "", - description = "", - tier = "", - frequencyMilliseconds = 1234L, + description = "This is a disco group", + frequencyMilliseconds = 604800000, + tier = "advanced", seeds = new object[] { new { - kind = "as", - name = "", + name = "thisisatest.microsoft.com", + kind = "host", } }, - names = new object[] - { - "" - }, - excludes = new object[] - { - null - }, - templateId = "", }); Response response = client.ValidateDiscoveryGroup(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); -Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); +Console.WriteLine(result.ToString()); ]]> This sample shows how to call GetDiscoveryGroupAsync. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = await client.GetDiscoveryGroupAsync(""); -]]> -This sample shows how to call GetDiscoveryGroupAsync with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetDiscoveryGroupAsync(""); +Response response = await client.GetDiscoveryGroupAsync("ThisisaDiscoGroup"); ]]> This sample shows how to call GetDiscoveryGroup. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = client.GetDiscoveryGroup(""); -]]> -This sample shows how to call GetDiscoveryGroup with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetDiscoveryGroup(""); +Response response = client.GetDiscoveryGroup("ThisisaDiscoGroup"); ]]> This sample shows how to call GetDiscoveryGroupAsync and parse the result. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = await client.GetDiscoveryGroupAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -]]> -This sample shows how to call GetDiscoveryGroupAsync with all parameters and parse the result. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetDiscoveryGroupAsync("", null); +Response response = await client.GetDiscoveryGroupAsync("ThisisaDiscoGroup", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("displayName").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("tier").ToString()); -Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("names")[0].ToString()); -Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); -Console.WriteLine(result.GetProperty("createdDate").ToString()); -Console.WriteLine(result.GetProperty("templateId").ToString()); ]]> This sample shows how to call GetDiscoveryGroup and parse the result. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = client.GetDiscoveryGroup("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -]]> -This sample shows how to call GetDiscoveryGroup with all parameters and parse the result. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetDiscoveryGroup("", null); +Response response = client.GetDiscoveryGroup("ThisisaDiscoGroup", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("displayName").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("tier").ToString()); -Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("names")[0].ToString()); -Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); -Console.WriteLine(result.GetProperty("createdDate").ToString()); -Console.WriteLine(result.GetProperty("templateId").ToString()); ]]> This sample shows how to call CreateOrReplaceDiscoveryGroupAsync. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -DiscoveryGroupPayload body = new DiscoveryGroupPayload(); -Response response = await client.CreateOrReplaceDiscoveryGroupAsync("", body); -]]> -This sample shows how to call CreateOrReplaceDiscoveryGroupAsync with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { - Name = "", - Description = "", - Tier = "", - FrequencyMilliseconds = 1234L, + Description = "This is a disco group", + Tier = "advanced", + FrequencyMilliseconds = 604800000, Seeds = {new DiscoverySource { - Kind = DiscoverySourceKind.As, - Name = "", + Kind = DiscoverySourceKind.Host, + Name = "thisisatest.microsoft.com", }}, - Names = { "" }, - Excludes = { default }, - TemplateId = "", }; -Response response = await client.CreateOrReplaceDiscoveryGroupAsync("", body); +Response response = await client.CreateOrReplaceDiscoveryGroupAsync("ThisisaDiscoGroup", body); ]]> This sample shows how to call CreateOrReplaceDiscoveryGroup. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -DiscoveryGroupPayload body = new DiscoveryGroupPayload(); -Response response = client.CreateOrReplaceDiscoveryGroup("", body); -]]> -This sample shows how to call CreateOrReplaceDiscoveryGroup with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { - Name = "", - Description = "", - Tier = "", - FrequencyMilliseconds = 1234L, + Description = "This is a disco group", + Tier = "advanced", + FrequencyMilliseconds = 604800000, Seeds = {new DiscoverySource { - Kind = DiscoverySourceKind.As, - Name = "", + Kind = DiscoverySourceKind.Host, + Name = "thisisatest.microsoft.com", }}, - Names = { "" }, - Excludes = { default }, - TemplateId = "", }; -Response response = client.CreateOrReplaceDiscoveryGroup("", body); +Response response = client.CreateOrReplaceDiscoveryGroup("ThisisaDiscoGroup", body); ]]> This sample shows how to call CreateOrReplaceDiscoveryGroupAsync and parse the result. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = await client.CreateOrReplaceDiscoveryGroupAsync("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -]]> -This sample shows how to call CreateOrReplaceDiscoveryGroupAsync with all parameters and request content and parse the result. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - name = "", - description = "", - tier = "", - frequencyMilliseconds = 1234L, + description = "This is a disco group", + frequencyMilliseconds = 604800000, + tier = "advanced", seeds = new object[] { new { - kind = "as", - name = "", + name = "thisisatest.microsoft.com", + kind = "host", } }, - names = new object[] - { - "" - }, - excludes = new object[] - { - null - }, - templateId = "", }); -Response response = await client.CreateOrReplaceDiscoveryGroupAsync("", content); +Response response = await client.CreateOrReplaceDiscoveryGroupAsync("ThisisaDiscoGroup", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("displayName").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("tier").ToString()); -Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("names")[0].ToString()); -Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); -Console.WriteLine(result.GetProperty("createdDate").ToString()); -Console.WriteLine(result.GetProperty("templateId").ToString()); ]]> This sample shows how to call CreateOrReplaceDiscoveryGroup and parse the result. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -using RequestContent content = RequestContent.Create(new object()); -Response response = client.CreateOrReplaceDiscoveryGroup("", content); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("name").ToString()); -]]> -This sample shows how to call CreateOrReplaceDiscoveryGroup with all parameters and request content and parse the result. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - name = "", - description = "", - tier = "", - frequencyMilliseconds = 1234L, + description = "This is a disco group", + frequencyMilliseconds = 604800000, + tier = "advanced", seeds = new object[] { new { - kind = "as", - name = "", + name = "thisisatest.microsoft.com", + kind = "host", } }, - names = new object[] - { - "" - }, - excludes = new object[] - { - null - }, - templateId = "", }); -Response response = client.CreateOrReplaceDiscoveryGroup("", content); +Response response = client.CreateOrReplaceDiscoveryGroup("ThisisaDiscoGroup", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("displayName").ToString()); -Console.WriteLine(result.GetProperty("description").ToString()); -Console.WriteLine(result.GetProperty("tier").ToString()); -Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("names")[0].ToString()); -Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); -Console.WriteLine(result.GetProperty("createdDate").ToString()); -Console.WriteLine(result.GetProperty("templateId").ToString()); ]]> This sample shows how to call RunDiscoveryGroupAsync. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = await client.RunDiscoveryGroupAsync(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call RunDiscoveryGroupAsync with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.RunDiscoveryGroupAsync(""); +Response response = await client.RunDiscoveryGroupAsync("ThisisaDiscoGroup"); Console.WriteLine(response.Status); ]]> @@ -958,21 +670,11 @@ Console.WriteLine(response.Status); This sample shows how to call RunDiscoveryGroup. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = client.RunDiscoveryGroup(""); - -Console.WriteLine(response.Status); -]]> -This sample shows how to call RunDiscoveryGroup with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.RunDiscoveryGroup(""); +Response response = client.RunDiscoveryGroup("ThisisaDiscoGroup"); Console.WriteLine(response.Status); ]]> @@ -981,108 +683,50 @@ Console.WriteLine(response.Status); This sample shows how to call GetDiscoveryTemplateAsync. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = await client.GetDiscoveryTemplateAsync(""); -]]> -This sample shows how to call GetDiscoveryTemplateAsync with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetDiscoveryTemplateAsync(""); +Response response = await client.GetDiscoveryTemplateAsync("12345"); ]]> This sample shows how to call GetDiscoveryTemplate. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = client.GetDiscoveryTemplate(""); -]]> -This sample shows how to call GetDiscoveryTemplate with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetDiscoveryTemplate(""); +Response response = client.GetDiscoveryTemplate("12345"); ]]> This sample shows how to call GetDiscoveryTemplateAsync and parse the result. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = await client.GetDiscoveryTemplateAsync("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); -]]> -This sample shows how to call GetDiscoveryTemplateAsync with all parameters and parse the result. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = await client.GetDiscoveryTemplateAsync("", null); +Response response = await client.GetDiscoveryTemplateAsync("12345", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("displayName").ToString()); -Console.WriteLine(result.GetProperty("industry").ToString()); -Console.WriteLine(result.GetProperty("region").ToString()); -Console.WriteLine(result.GetProperty("countryCode").ToString()); -Console.WriteLine(result.GetProperty("stateCode").ToString()); -Console.WriteLine(result.GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("names")[0].ToString()); ]]> This sample shows how to call GetDiscoveryTemplate and parse the result. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -Response response = client.GetDiscoveryTemplate("", null); - -JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("id").ToString()); -]]> -This sample shows how to call GetDiscoveryTemplate with all parameters and parse the result. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -Response response = client.GetDiscoveryTemplate("", null); +Response response = client.GetDiscoveryTemplate("12345", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); -Console.WriteLine(result.GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("displayName").ToString()); -Console.WriteLine(result.GetProperty("industry").ToString()); -Console.WriteLine(result.GetProperty("region").ToString()); -Console.WriteLine(result.GetProperty("countryCode").ToString()); -Console.WriteLine(result.GetProperty("stateCode").ToString()); -Console.WriteLine(result.GetProperty("city").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); -Console.WriteLine(result.GetProperty("names")[0].ToString()); ]]> @@ -1643,53 +1287,33 @@ foreach (BinaryData item in client.GetDataConnections(null, null, null)) This sample shows how to call GetDiscoveryGroupsAsync. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); await foreach (DiscoveryGroup item in client.GetDiscoveryGroupsAsync()) { } -]]> -This sample shows how to call GetDiscoveryGroupsAsync with all parameters. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -await foreach (DiscoveryGroup item in client.GetDiscoveryGroupsAsync(filter: "", skip: 1234, maxpagesize: 1234)) -{ -} ]]> This sample shows how to call GetDiscoveryGroups. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); foreach (DiscoveryGroup item in client.GetDiscoveryGroups()) { } -]]> -This sample shows how to call GetDiscoveryGroups with all parameters. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -foreach (DiscoveryGroup item in client.GetDiscoveryGroups(filter: "", skip: 1234, maxpagesize: 1234)) -{ -} ]]> This sample shows how to call GetDiscoveryGroupsAsync and parse the result. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -1698,48 +1322,13 @@ await foreach (BinaryData item in client.GetDiscoveryGroupsAsync(null, null, nul JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); } -]]> -This sample shows how to call GetDiscoveryGroupsAsync with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -await foreach (BinaryData item in client.GetDiscoveryGroupsAsync("", 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("createdDate").ToString()); - Console.WriteLine(result.GetProperty("templateId").ToString()); -} ]]> This sample shows how to call GetDiscoveryGroups and parse the result. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -1748,62 +1337,17 @@ foreach (BinaryData item in client.GetDiscoveryGroups(null, null, null, null)) JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); } -]]> -This sample shows how to call GetDiscoveryGroups with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -foreach (BinaryData item in client.GetDiscoveryGroups("", 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("createdDate").ToString()); - Console.WriteLine(result.GetProperty("templateId").ToString()); -} ]]> This sample shows how to call GetDiscoveryGroupRunsAsync. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync("")) -{ -} -]]> -This sample shows how to call GetDiscoveryGroupRunsAsync with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync("", filter: "", skip: 1234, maxpagesize: 1234)) +await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync("ThisisaDiscoGroup")) { } ]]> @@ -1812,21 +1356,11 @@ await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync(" This sample shows how to call GetDiscoveryGroupRuns. "); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("")) -{ -} -]]> -This sample shows how to call GetDiscoveryGroupRuns with all parameters. -"); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("", filter: "", skip: 1234, maxpagesize: 1234)) +foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("ThisisaDiscoGroup")) { } ]]> @@ -1835,127 +1369,63 @@ foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("", This sample shows how to call GetDiscoveryGroupRunsAsync and parse the result. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -await foreach (BinaryData item in client.GetDiscoveryGroupRunsAsync("", null, null, null, null)) +await foreach (BinaryData item in client.GetDiscoveryGroupRunsAsync("ThisisaDiscoGroup", null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.ToString()); } -]]> -This sample shows how to call GetDiscoveryGroupRunsAsync with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -await foreach (BinaryData item in client.GetDiscoveryGroupRunsAsync("", "", 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); -} ]]> This sample shows how to call GetDiscoveryGroupRuns and parse the result. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); -foreach (BinaryData item in client.GetDiscoveryGroupRuns("", null, null, null, null)) +foreach (BinaryData item in client.GetDiscoveryGroupRuns("ThisisaDiscoGroup", null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.ToString()); } -]]> -This sample shows how to call GetDiscoveryGroupRuns with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -foreach (BinaryData item in client.GetDiscoveryGroupRuns("", "", 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); -} ]]> This sample shows how to call GetDiscoveryTemplatesAsync. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); await foreach (DiscoveryTemplate item in client.GetDiscoveryTemplatesAsync()) { } -]]> -This sample shows how to call GetDiscoveryTemplatesAsync with all parameters. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -await foreach (DiscoveryTemplate item in client.GetDiscoveryTemplatesAsync(filter: "", skip: 1234, maxpagesize: 1234)) -{ -} ]]> This sample shows how to call GetDiscoveryTemplates. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); foreach (DiscoveryTemplate item in client.GetDiscoveryTemplates()) { } -]]> -This sample shows how to call GetDiscoveryTemplates with all parameters. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -foreach (DiscoveryTemplate item in client.GetDiscoveryTemplates(filter: "", skip: 1234, maxpagesize: 1234)) -{ -} ]]> This sample shows how to call GetDiscoveryTemplatesAsync and parse the result. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -1964,35 +1434,13 @@ await foreach (BinaryData item in client.GetDiscoveryTemplatesAsync(null, null, JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); } -]]> -This sample shows how to call GetDiscoveryTemplatesAsync with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -await foreach (BinaryData item in client.GetDiscoveryTemplatesAsync("", 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("industry").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - Console.WriteLine(result.GetProperty("countryCode").ToString()); - Console.WriteLine(result.GetProperty("stateCode").ToString()); - Console.WriteLine(result.GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); -} ]]> This sample shows how to call GetDiscoveryTemplates and parse the result. "); +Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -2001,28 +1449,6 @@ foreach (BinaryData item in client.GetDiscoveryTemplates(null, null, null, null) JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); } -]]> -This sample shows how to call GetDiscoveryTemplates with all parameters and parse the result. -"); -TokenCredential credential = new DefaultAzureCredential(); -EasmClient client = new EasmClient(endpoint, credential); - -foreach (BinaryData item in client.GetDiscoveryTemplates("", 1234, 1234, null)) -{ - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("industry").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - Console.WriteLine(result.GetProperty("countryCode").ToString()); - Console.WriteLine(result.GetProperty("stateCode").ToString()); - Console.WriteLine(result.GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); -} ]]> diff --git a/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs b/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs index 68a001e1a1098..dadfc56f31149 100644 --- a/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs +++ b/sdk/easm/Azure.Analytics.Defender.Easm/tests/Generated/Samples/Samples_EasmClient.cs @@ -420,350 +420,113 @@ public async Task Example_DataConnection_DeleteDataConnection_DataConnectionsDel [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_ValidateDiscoveryGroup_ShortVersion() + public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDiscoGroup() { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Response response = client.ValidateDiscoveryGroup(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_ValidateDiscoveryGroup_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - using RequestContent content = RequestContent.Create(new object()); - Response response = await client.ValidateDiscoveryGroupAsync(content); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_ValidateDiscoveryGroup_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - DiscoveryGroupPayload body = new DiscoveryGroupPayload(); - Response response = client.ValidateDiscoveryGroup(body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_ValidateDiscoveryGroup_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - DiscoveryGroupPayload body = new DiscoveryGroupPayload(); - Response response = await client.ValidateDiscoveryGroupAsync(body); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_ValidateDiscoveryGroup_AllParameters() - { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - name = "", - description = "", - tier = "", - frequencyMilliseconds = 1234L, + description = "This is a disco group", + frequencyMilliseconds = 604800000, + tier = "advanced", seeds = new object[] { new { -kind = "as", -name = "", +name = "thisisatest.microsoft.com", +kind = "host", } }, - names = new object[] - { -"" - }, - excludes = new object[] - { -null - }, - templateId = "", }); Response response = client.ValidateDiscoveryGroup(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); + Console.WriteLine(result.ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_ValidateDiscoveryGroup_AllParameters_Async() + public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDiscoGroup_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - name = "", - description = "", - tier = "", - frequencyMilliseconds = 1234L, + description = "This is a disco group", + frequencyMilliseconds = 604800000, + tier = "advanced", seeds = new object[] { new { -kind = "as", -name = "", +name = "thisisatest.microsoft.com", +kind = "host", } }, - names = new object[] - { -"" - }, - excludes = new object[] - { -null - }, - templateId = "", }); Response response = await client.ValidateDiscoveryGroupAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString()); - Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("value").ToString()); + Console.WriteLine(result.ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_ValidateDiscoveryGroup_AllParameters_Convenience() + public void Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDiscoGroup_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { - Name = "", - Description = "", - Tier = "", - FrequencyMilliseconds = 1234L, + Description = "This is a disco group", + Tier = "advanced", + FrequencyMilliseconds = 604800000, Seeds = {new DiscoverySource { -Kind = DiscoverySourceKind.As, -Name = "", +Kind = DiscoverySourceKind.Host, +Name = "thisisatest.microsoft.com", }}, - Names = { "" }, - Excludes = { default }, - TemplateId = "", }; Response response = client.ValidateDiscoveryGroup(body); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_ValidateDiscoveryGroup_AllParameters_Convenience_Async() + public async Task Example_EasmClient_ValidateDiscoveryGroup_DiscoveryGroupsValidateDiscoGroup_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { - Name = "", - Description = "", - Tier = "", - FrequencyMilliseconds = 1234L, + Description = "This is a disco group", + Tier = "advanced", + FrequencyMilliseconds = 604800000, Seeds = {new DiscoverySource { -Kind = DiscoverySourceKind.As, -Name = "", +Kind = DiscoverySourceKind.Host, +Name = "thisisatest.microsoft.com", }}, - Names = { "" }, - Excludes = { default }, - TemplateId = "", }; Response response = await client.ValidateDiscoveryGroupAsync(body); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroup_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = client.GetDiscoveryGroup("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroup_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = await client.GetDiscoveryGroupAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("name").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroup_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = client.GetDiscoveryGroup(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroup_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = await client.GetDiscoveryGroupAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroup_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = client.GetDiscoveryGroup("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("createdDate").ToString()); - Console.WriteLine(result.GetProperty("templateId").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroup_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = await client.GetDiscoveryGroupAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("createdDate").ToString()); - Console.WriteLine(result.GetProperty("templateId").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroup_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = client.GetDiscoveryGroup(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroup_AllParameters_Convenience_Async() + public void Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup() { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = await client.GetDiscoveryGroupAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_ShortVersion() - { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); - Response response = client.CreateOrReplaceDiscoveryGroup("", content); + Response response = client.GetDiscoveryGroup("ThisisaDiscoGroup", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -771,14 +534,13 @@ public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_ShortVersion() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_ShortVersion_Async() + public async Task Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); - Response response = await client.CreateOrReplaceDiscoveryGroupAsync("", content); + Response response = await client.GetDiscoveryGroupAsync("ThisisaDiscoGroup", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("name").ToString()); @@ -786,372 +548,200 @@ public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_ShortVersion_ [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_ShortVersion_Convenience() + public void Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - DiscoveryGroupPayload body = new DiscoveryGroupPayload(); - Response response = client.CreateOrReplaceDiscoveryGroup("", body); + Response response = client.GetDiscoveryGroup("ThisisaDiscoGroup"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_ShortVersion_Convenience_Async() + public async Task Example_DiscoGroup_GetDiscoveryGroup_DiscoveryGroupsGetDiscoGroup_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - DiscoveryGroupPayload body = new DiscoveryGroupPayload(); - Response response = await client.CreateOrReplaceDiscoveryGroupAsync("", body); + Response response = await client.GetDiscoveryGroupAsync("ThisisaDiscoGroup"); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_AllParameters() + public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - name = "", - description = "", - tier = "", - frequencyMilliseconds = 1234L, + description = "This is a disco group", + frequencyMilliseconds = 604800000, + tier = "advanced", seeds = new object[] { new { -kind = "as", -name = "", +name = "thisisatest.microsoft.com", +kind = "host", } }, - names = new object[] - { -"" - }, - excludes = new object[] - { -null - }, - templateId = "", }); - Response response = client.CreateOrReplaceDiscoveryGroup("", content); + Response response = client.CreateOrReplaceDiscoveryGroup("ThisisaDiscoGroup", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("createdDate").ToString()); - Console.WriteLine(result.GetProperty("templateId").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_AllParameters_Async() + public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - name = "", - description = "", - tier = "", - frequencyMilliseconds = 1234L, + description = "This is a disco group", + frequencyMilliseconds = 604800000, + tier = "advanced", seeds = new object[] { new { -kind = "as", -name = "", +name = "thisisatest.microsoft.com", +kind = "host", } }, - names = new object[] - { -"" - }, - excludes = new object[] - { -null - }, - templateId = "", }); - Response response = await client.CreateOrReplaceDiscoveryGroupAsync("", content); + Response response = await client.CreateOrReplaceDiscoveryGroupAsync("ThisisaDiscoGroup", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("createdDate").ToString()); - Console.WriteLine(result.GetProperty("templateId").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_AllParameters_Convenience() + public void Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { - Name = "", - Description = "", - Tier = "", - FrequencyMilliseconds = 1234L, + Description = "This is a disco group", + Tier = "advanced", + FrequencyMilliseconds = 604800000, Seeds = {new DiscoverySource { -Kind = DiscoverySourceKind.As, -Name = "", +Kind = DiscoverySourceKind.Host, +Name = "thisisatest.microsoft.com", }}, - Names = { "" }, - Excludes = { default }, - TemplateId = "", }; - Response response = client.CreateOrReplaceDiscoveryGroup("", body); + Response response = client.CreateOrReplaceDiscoveryGroup("ThisisaDiscoGroup", body); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_AllParameters_Convenience_Async() + public async Task Example_DiscoGroup_CreateOrReplaceDiscoveryGroup_DiscoveryGroupsCreateOrReplaceDiscoGroup_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); DiscoveryGroupPayload body = new DiscoveryGroupPayload { - Name = "", - Description = "", - Tier = "", - FrequencyMilliseconds = 1234L, + Description = "This is a disco group", + Tier = "advanced", + FrequencyMilliseconds = 604800000, Seeds = {new DiscoverySource { -Kind = DiscoverySourceKind.As, -Name = "", +Kind = DiscoverySourceKind.Host, +Name = "thisisatest.microsoft.com", }}, - Names = { "" }, - Excludes = { default }, - TemplateId = "", }; - Response response = await client.CreateOrReplaceDiscoveryGroupAsync("", body); + Response response = await client.CreateOrReplaceDiscoveryGroupAsync("ThisisaDiscoGroup", body); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_RunDiscoveryGroup_ShortVersion() + public void Example_EasmClient_RunDiscoveryGroup_DiscoveryGroupsRunDiscoGroup() { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = client.RunDiscoveryGroup(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_RunDiscoveryGroup_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = await client.RunDiscoveryGroupAsync(""); - - Console.WriteLine(response.Status); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_RunDiscoveryGroup_AllParameters() - { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.RunDiscoveryGroup(""); + Response response = client.RunDiscoveryGroup("ThisisaDiscoGroup"); Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_RunDiscoveryGroup_AllParameters_Async() + public async Task Example_EasmClient_RunDiscoveryGroup_DiscoveryGroupsRunDiscoGroup_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.RunDiscoveryGroupAsync(""); + Response response = await client.RunDiscoveryGroupAsync("ThisisaDiscoGroup"); Console.WriteLine(response.Status); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplate_ShortVersion() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = client.GetDiscoveryTemplate("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplate_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = await client.GetDiscoveryTemplateAsync("", null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplate_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = client.GetDiscoveryTemplate(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplate_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - Response response = await client.GetDiscoveryTemplateAsync(""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplate_AllParameters() + public void Example_DiscoTemplate_GetDiscoveryTemplate_DiscoveryTemplatesGetDiscoTemplate() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetDiscoveryTemplate("", null); + Response response = client.GetDiscoveryTemplate("12345", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("industry").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - Console.WriteLine(result.GetProperty("countryCode").ToString()); - Console.WriteLine(result.GetProperty("stateCode").ToString()); - Console.WriteLine(result.GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplate_AllParameters_Async() + public async Task Example_DiscoTemplate_GetDiscoveryTemplate_DiscoveryTemplatesGetDiscoTemplate_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetDiscoveryTemplateAsync("", null); + Response response = await client.GetDiscoveryTemplateAsync("12345", null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("industry").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - Console.WriteLine(result.GetProperty("countryCode").ToString()); - Console.WriteLine(result.GetProperty("stateCode").ToString()); - Console.WriteLine(result.GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplate_AllParameters_Convenience() + public void Example_DiscoTemplate_GetDiscoveryTemplate_DiscoveryTemplatesGetDiscoTemplate_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = client.GetDiscoveryTemplate(""); + Response response = client.GetDiscoveryTemplate("12345"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplate_AllParameters_Convenience_Async() + public async Task Example_DiscoTemplate_GetDiscoveryTemplate_DiscoveryTemplatesGetDiscoTemplate_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - Response response = await client.GetDiscoveryTemplateAsync(""); + Response response = await client.GetDiscoveryTemplateAsync("12345"); } [Test] @@ -1710,9 +1300,9 @@ public async Task Example_DataConnection_GetDataConnections_DataConnectionsListD [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroups_ShortVersion() + public void Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -1725,9 +1315,9 @@ public void Example_DiscoGroup_GetDiscoveryGroups_ShortVersion() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroups_ShortVersion_Async() + public async Task Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -1740,9 +1330,9 @@ public async Task Example_DiscoGroup_GetDiscoveryGroups_ShortVersion_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroups_ShortVersion_Convenience() + public void Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -1753,9 +1343,9 @@ public void Example_DiscoGroup_GetDiscoveryGroups_ShortVersion_Convenience() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroups_ShortVersion_Convenience_Async() + public async Task Example_DiscoGroup_GetDiscoveryGroups_DiscoveryGroupsListDiscoGroup_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -1766,115 +1356,13 @@ public async Task Example_DiscoGroup_GetDiscoveryGroups_ShortVersion_Convenience [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroups_AllParameters() + public void Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns() { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - foreach (BinaryData item in client.GetDiscoveryGroups("", 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("createdDate").ToString()); - Console.WriteLine(result.GetProperty("templateId").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroups_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - await foreach (BinaryData item in client.GetDiscoveryGroupsAsync("", 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("description").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("frequencyMilliseconds").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("latestRun").GetProperty("names")[0].ToString()); - Console.WriteLine(result.GetProperty("createdDate").ToString()); - Console.WriteLine(result.GetProperty("templateId").ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoGroup_GetDiscoveryGroups_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - foreach (DiscoveryGroup item in client.GetDiscoveryGroups(filter: "", skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoGroup_GetDiscoveryGroups_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - await foreach (DiscoveryGroup item in client.GetDiscoveryGroupsAsync(filter: "", skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetDiscoveryGroupRuns_ShortVersion() - { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (BinaryData item in client.GetDiscoveryGroupRuns("", null, null, null, null)) + foreach (BinaryData item in client.GetDiscoveryGroupRuns("ThisisaDiscoGroup", null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.ToString()); @@ -1883,13 +1371,13 @@ public void Example_EasmClient_GetDiscoveryGroupRuns_ShortVersion() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetDiscoveryGroupRuns_ShortVersion_Async() + public async Task Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (BinaryData item in client.GetDiscoveryGroupRunsAsync("", null, null, null, null)) + await foreach (BinaryData item in client.GetDiscoveryGroupRunsAsync("ThisisaDiscoGroup", null, null, null, null)) { JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; Console.WriteLine(result.ToString()); @@ -1898,111 +1386,35 @@ public async Task Example_EasmClient_GetDiscoveryGroupRuns_ShortVersion_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetDiscoveryGroupRuns_ShortVersion_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetDiscoveryGroupRuns_ShortVersion_Convenience_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync("")) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetDiscoveryGroupRuns_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - foreach (BinaryData item in client.GetDiscoveryGroupRuns("", "", 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetDiscoveryGroupRuns_AllParameters_Async() + public void Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns_Convenience() { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - await foreach (BinaryData item in client.GetDiscoveryGroupRunsAsync("", "", 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("submittedDate").ToString()); - Console.WriteLine(result.GetProperty("startedDate").ToString()); - Console.WriteLine(result.GetProperty("completedDate").ToString()); - Console.WriteLine(result.GetProperty("tier").ToString()); - Console.WriteLine(result.GetProperty("state").ToString()); - Console.WriteLine(result.GetProperty("totalAssetsFoundCount").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("excludes")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_EasmClient_GetDiscoveryGroupRuns_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("", filter: "", skip: 1234, maxpagesize: 1234)) + foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRuns("ThisisaDiscoGroup")) { } } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_EasmClient_GetDiscoveryGroupRuns_AllParameters_Convenience_Async() + public async Task Example_EasmClient_GetDiscoveryGroupRuns_DiscoveryGroupsListRuns_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); - await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync("", filter: "", skip: 1234, maxpagesize: 1234)) + await foreach (DiscoveryRunResult item in client.GetDiscoveryGroupRunsAsync("ThisisaDiscoGroup")) { } } [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplates_ShortVersion() + public void Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDiscoTemplate() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -2015,9 +1427,9 @@ public void Example_DiscoTemplate_GetDiscoveryTemplates_ShortVersion() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplates_ShortVersion_Async() + public async Task Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDiscoTemplate_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -2030,9 +1442,9 @@ public async Task Example_DiscoTemplate_GetDiscoveryTemplates_ShortVersion_Async [Test] [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplates_ShortVersion_Convenience() + public void Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDiscoTemplate_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -2043,9 +1455,9 @@ public void Example_DiscoTemplate_GetDiscoveryTemplates_ShortVersion_Convenience [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplates_ShortVersion_Convenience_Async() + public async Task Example_DiscoTemplate_GetDiscoveryTemplates_DiscoveryTemplatesListDiscoTemplate_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); EasmClient client = new EasmClient(endpoint, credential); @@ -2054,82 +1466,6 @@ public async Task Example_DiscoTemplate_GetDiscoveryTemplates_ShortVersion_Conve } } - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplates_AllParameters() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - foreach (BinaryData item in client.GetDiscoveryTemplates("", 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("industry").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - Console.WriteLine(result.GetProperty("countryCode").ToString()); - Console.WriteLine(result.GetProperty("stateCode").ToString()); - Console.WriteLine(result.GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplates_AllParameters_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - await foreach (BinaryData item in client.GetDiscoveryTemplatesAsync("", 1234, 1234, null)) - { - JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; - Console.WriteLine(result.GetProperty("id").ToString()); - Console.WriteLine(result.GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("industry").ToString()); - Console.WriteLine(result.GetProperty("region").ToString()); - Console.WriteLine(result.GetProperty("countryCode").ToString()); - Console.WriteLine(result.GetProperty("stateCode").ToString()); - Console.WriteLine(result.GetProperty("city").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("seeds")[0].GetProperty("name").ToString()); - Console.WriteLine(result.GetProperty("names")[0].ToString()); - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_DiscoTemplate_GetDiscoveryTemplates_AllParameters_Convenience() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - foreach (DiscoveryTemplate item in client.GetDiscoveryTemplates(filter: "", skip: 1234, maxpagesize: 1234)) - { - } - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_DiscoTemplate_GetDiscoveryTemplates_AllParameters_Convenience_Async() - { - Uri endpoint = new Uri(""); - TokenCredential credential = new DefaultAzureCredential(); - EasmClient client = new EasmClient(endpoint, credential); - - await foreach (DiscoveryTemplate item in client.GetDiscoveryTemplatesAsync(filter: "", skip: 1234, maxpagesize: 1234)) - { - } - } - [Test] [Ignore("Only validating compilation of examples")] public void Example_SavedFilter_GetSavedFilters_SavedFiltersListSavedFilter() diff --git a/sdk/fabric/Azure.ResourceManager.Fabric/samples/Generated/Samples/Sample_FabricCapacityResource.cs b/sdk/fabric/Azure.ResourceManager.Fabric/samples/Generated/Samples/Sample_FabricCapacityResource.cs index 93c91ce39a993..190e042f948f8 100644 --- a/sdk/fabric/Azure.ResourceManager.Fabric/samples/Generated/Samples/Sample_FabricCapacityResource.cs +++ b/sdk/fabric/Azure.ResourceManager.Fabric/samples/Generated/Samples/Sample_FabricCapacityResource.cs @@ -204,6 +204,37 @@ public async Task Suspend_SuspendCapacity() Console.WriteLine($"Succeeded"); } + // Check name availability of a capacity + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CheckFabricCapacityNameAvailability_CheckNameAvailabilityOfACapacity() + { + // Generated from example definition: 2023-11-01/FabricCapacities_CheckNameAvailability.json + // this example is just showing the usage of "FabricCapacities_CheckFabricCapacityNameAvailability" 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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "548B7FB7-3B2A-4F46-BB02-66473F1FC22C"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("westcentralus"); + FabricNameAvailabilityContent content = new FabricNameAvailabilityContent() + { + Name = "azsdktest", + ResourceType = "Microsoft.Fabric/capacities", + }; + FabricNameAvailabilityResult result = await subscriptionResource.CheckFabricCapacityNameAvailabilityAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + // List eligible SKUs for an existing capacity [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] From eb79f1da01e32b70b1340d977169f9338faaaca2 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 25 Sep 2024 14:49:13 +0000 Subject: [PATCH 4/5] Update SDK codes ad_co_0 --- .../Docs/ConversationAnalysisClient.xml | 2320 +++++++++++++--- .../Samples_ConversationAnalysisClient.cs | 2375 ++++++++++++++--- .../src/Generated/Docs/TextAnalysisClient.xml | 1216 +++++++-- .../Samples/Samples_TextAnalysisClient.cs | 1374 ++++++++-- 4 files changed, 6200 insertions(+), 1085 deletions(-) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml index 6ae22c7394906..7a682b09567a0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/Docs/ConversationAnalysisClient.xml @@ -5,45 +5,52 @@ This sample shows how to call AnalyzeConversationAsync. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("", "", "")), new ConversationLanguageUnderstandingActionContent("", "")); +AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")); Response response = await client.AnalyzeConversationAsync(analyzeConversationInput); ]]> -This sample shows how to call AnalyzeConversationAsync with all parameters. +This sample shows how to call AnalyzeConversationAsync. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("", "", "") +AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "How do I integrate QnA Maker and LUIS?") { - Language = "", - Modality = InputModality.Transcript, - Role = ParticipantRole.Customer, -}), new ConversationLanguageUnderstandingActionContent("", "") + Language = "en-GB", + Modality = InputModality.Text, +}), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}") { Verbose = true, - IsLoggingEnabled = true, - StringIndexType = StringIndexType.TextElementsV8, - DirectTarget = "", + IsLoggingEnabled = false, +}); +Response response = await client.AnalyzeConversationAsync(analyzeConversationInput); +]]> +This sample shows how to call AnalyzeConversationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Ports and connectors")), new ConversationLanguageUnderstandingActionContent("prj1", "dep1") +{ + DirectTarget = "qnaProject", TargetProjectParameters = { - ["key"] = new LuisConfig + ["qnaProject"] = new QuestionAnsweringConfig { - Query = "", - CallingOptions = new LuisCallingConfig + CallingOptions = new QuestionAnswersConfig { - Verbose = true, - Log = true, - ShowAllIntents = true, - TimezoneOffset = 1234, - SpellCheck = true, - BingSpellCheckSubscriptionKey = "", + Question = "App Service overview", + Top = 1, + AnswerContext = new KnowledgeBaseAnswerContext(4) + { + PreviousQuestion = "Meet Surface Pro 4", + }, }, - ApiVersion = "", } }, }); @@ -54,45 +61,52 @@ Response response = await client.AnalyzeConvers This sample shows how to call AnalyzeConversation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("", "", "")), new ConversationLanguageUnderstandingActionContent("", "")); +AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")); Response response = client.AnalyzeConversation(analyzeConversationInput); ]]> -This sample shows how to call AnalyzeConversation with all parameters. +This sample shows how to call AnalyzeConversation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("", "", "") +AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "How do I integrate QnA Maker and LUIS?") { - Language = "", - Modality = InputModality.Transcript, - Role = ParticipantRole.Customer, -}), new ConversationLanguageUnderstandingActionContent("", "") + Language = "en-GB", + Modality = InputModality.Text, +}), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}") { Verbose = true, - IsLoggingEnabled = true, - StringIndexType = StringIndexType.TextElementsV8, - DirectTarget = "", + IsLoggingEnabled = false, +}); +Response response = client.AnalyzeConversation(analyzeConversationInput); +]]> +This sample shows how to call AnalyzeConversation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Ports and connectors")), new ConversationLanguageUnderstandingActionContent("prj1", "dep1") +{ + DirectTarget = "qnaProject", TargetProjectParameters = { - ["key"] = new LuisConfig + ["qnaProject"] = new QuestionAnsweringConfig { - Query = "", - CallingOptions = new LuisCallingConfig + CallingOptions = new QuestionAnswersConfig { - Verbose = true, - Log = true, - ShowAllIntents = true, - TimezoneOffset = 1234, - SpellCheck = true, - BingSpellCheckSubscriptionKey = "", + Question = "App Service overview", + Top = 1, + AnswerContext = new KnowledgeBaseAnswerContext(4) + { + PreviousQuestion = "Meet Surface Pro 4", + }, }, - ApiVersion = "", } }, }); @@ -103,7 +117,7 @@ Response response = client.AnalyzeConversation( This sample shows how to call AnalyzeConversationAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); @@ -114,15 +128,15 @@ using RequestContent content = RequestContent.Create(new { conversationItem = new { - id = "", - participantId = "", - text = "", + id = "1", + participantId = "1", + text = "Book a flight to Seattle on Oct 10th", }, }, parameters = new { - projectName = "", - deploymentName = "", + projectName = "{project-name}", + deploymentName = "{deployment-name}", }, }); Response response = await client.AnalyzeConversationAsync(content); @@ -130,9 +144,9 @@ Response response = await client.AnalyzeConversationAsync(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("kind").ToString()); ]]> -This sample shows how to call AnalyzeConversationAsync with all request content and parse the result. +This sample shows how to call AnalyzeConversationAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); @@ -143,38 +157,64 @@ using RequestContent content = RequestContent.Create(new { conversationItem = new { - id = "", - participantId = "", - language = "", - modality = "transcript", - role = "customer", - text = "", + participantId = "1", + id = "1", + modality = "text", + language = "en-GB", + text = "How do I integrate QnA Maker and LUIS?", }, }, parameters = new { - projectName = "", - deploymentName = "", + projectName = "{project-name}", + deploymentName = "{deployment-name}", verbose = true, - isLoggingEnabled = true, - stringIndexType = "TextElements_v8", - directTarget = "", + isLoggingEnabled = false, + }, +}); +Response response = await client.AnalyzeConversationAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +]]> +This sample shows how to call AnalyzeConversationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + kind = "Conversation", + analysisInput = new + { + conversationItem = new + { + text = "Ports and connectors", + participantId = "1", + id = "1", + }, + }, + parameters = new + { + projectName = "prj1", + deploymentName = "dep1", + directTarget = "qnaProject", targetProjectParameters = new { - key = new + qnaProject = new { - targetProjectKind = "Luis", - query = "", - callingOptions = new Dictionary + targetProjectKind = "QuestionAnswering", + callingOptions = new { - ["verbose"] = true, - ["log"] = true, - ["show-all-intents"] = true, - ["timezoneOffset"] = 1234, - ["spellCheck"] = true, - ["bing-spell-check-subscription-key"] = "" + context = new + { + previousUserQuery = "Meet Surface Pro 4", + previousQnaId = 4, + }, + top = 1, + question = "App Service overview", }, - apiVersion = "", }, }, }, @@ -189,7 +229,7 @@ Console.WriteLine(result.GetProperty("kind").ToString()); This sample shows how to call AnalyzeConversation and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); @@ -200,15 +240,15 @@ using RequestContent content = RequestContent.Create(new { conversationItem = new { - id = "", - participantId = "", - text = "", + id = "1", + participantId = "1", + text = "Book a flight to Seattle on Oct 10th", }, }, parameters = new { - projectName = "", - deploymentName = "", + projectName = "{project-name}", + deploymentName = "{deployment-name}", }, }); Response response = client.AnalyzeConversation(content); @@ -216,9 +256,9 @@ Response response = client.AnalyzeConversation(content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("kind").ToString()); ]]> -This sample shows how to call AnalyzeConversation with all request content and parse the result. +This sample shows how to call AnalyzeConversation and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); @@ -229,38 +269,64 @@ using RequestContent content = RequestContent.Create(new { conversationItem = new { - id = "", - participantId = "", - language = "", - modality = "transcript", - role = "customer", - text = "", + participantId = "1", + id = "1", + modality = "text", + language = "en-GB", + text = "How do I integrate QnA Maker and LUIS?", }, }, parameters = new { - projectName = "", - deploymentName = "", + projectName = "{project-name}", + deploymentName = "{deployment-name}", verbose = true, - isLoggingEnabled = true, - stringIndexType = "TextElements_v8", - directTarget = "", + isLoggingEnabled = false, + }, +}); +Response response = client.AnalyzeConversation(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("kind").ToString()); +]]> +This sample shows how to call AnalyzeConversation and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + kind = "Conversation", + analysisInput = new + { + conversationItem = new + { + text = "Ports and connectors", + participantId = "1", + id = "1", + }, + }, + parameters = new + { + projectName = "prj1", + deploymentName = "dep1", + directTarget = "qnaProject", targetProjectParameters = new { - key = new + qnaProject = new { - targetProjectKind = "Luis", - query = "", - callingOptions = new Dictionary + targetProjectKind = "QuestionAnswering", + callingOptions = new { - ["verbose"] = true, - ["log"] = true, - ["show-all-intents"] = true, - ["timezoneOffset"] = 1234, - ["spellCheck"] = true, - ["bing-spell-check-subscription-key"] = "" + context = new + { + previousUserQuery = "Meet Surface Pro 4", + previousQnaId = 4, + }, + top = 1, + question = "App Service overview", }, - apiVersion = "", }, }, }, @@ -275,49 +341,113 @@ Console.WriteLine(result.GetProperty("kind").ToString()); This sample shows how to call GetAnalyzeConversationJobStatusAsync. "); +Uri endpoint = new Uri(""); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync. +"); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); ]]> -This sample shows how to call GetAnalyzeConversationJobStatusAsync with all parameters. +This sample shows how to call GetAnalyzeConversationJobStatusAsync. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStatistics: true); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); ]]> This sample shows how to call GetAnalyzeConversationJobStatus. "); +Uri endpoint = new Uri(""); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus. +"); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); ]]> -This sample shows how to call GetAnalyzeConversationJobStatus with all parameters. +This sample shows how to call GetAnalyzeConversationJobStatus. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStatistics: true); +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); ]]> This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("createdDateTime").ToString()); @@ -329,62 +459,31 @@ Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); ]]> -This sample shows how to call GetAnalyzeConversationJobStatusAsync with all parameters and parse the result. +This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, null); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("displayName").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("jobId").ToString()); Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); Console.WriteLine(result.GetProperty("status").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("nextLink").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("conversationsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("validConversationsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousConversationsCount").ToString()); -]]> - - - -This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("createdDateTime").ToString()); @@ -396,207 +495,1218 @@ Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); ]]> -This sample shows how to call GetAnalyzeConversationJobStatus with all parameters and parse the result. +This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, null); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("displayName").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("jobId").ToString()); Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); Console.WriteLine(result.GetProperty("status").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("nextLink").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("conversationsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("validConversationsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousConversationsCount").ToString()); -]]> - - - -This sample shows how to call AnalyzeConversationSubmitOperationAsync. +]]> +This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] -{ - new TextConversation("", "", new TextConversationItem[] - { - new TextConversationItem("", "", "") - }) -}), new AnalyzeConversationOperationAction[] -{ - new PiiOperationAction() -}); -Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); ]]> -This sample shows how to call AnalyzeConversationSubmitOperationAsync with all parameters. +This sample shows how to call GetAnalyzeConversationJobStatusAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] -{ - new TextConversation("", "", new TextConversationItem[] - { - new TextConversationItem("", "", "") - { - Language = "", - Modality = InputModality.Transcript, - Role = ParticipantRole.Customer, - } - }) - { - Domain = ConversationDomain.Finance, - } -}), new AnalyzeConversationOperationAction[] -{ - new PiiOperationAction - { - ActionContent = new ConversationPiiActionContent - { - LoggingOptOut = true, - ModelVersion = "", - PiiCategories = {ConversationPiiCategories.Address}, - RedactAudioTiming = true, - RedactionSource = TranscriptContentType.Lexical, - RedactionCharacter = RedactionCharacter.ExclamationPoint, - ExcludePiiCategories = {ConversationPiiCategoryExclusions.Address}, - }, - Name = "", - } -}) -{ - DisplayName = "", -}; -Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); ]]> - + -This sample shows how to call AnalyzeConversationSubmitOperation. +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] -{ - new TextConversation("", "", new TextConversationItem[] - { - new TextConversationItem("", "", "") - }) -}), new AnalyzeConversationOperationAction[] -{ - new PiiOperationAction() -}); -Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); ]]> -This sample shows how to call AnalyzeConversationSubmitOperation with all parameters. +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] -{ - new TextConversation("", "", new TextConversationItem[] - { - new TextConversationItem("", "", "") - { - Language = "", - Modality = InputModality.Transcript, - Role = ParticipantRole.Customer, - } - }) - { - Domain = ConversationDomain.Finance, - } -}), new AnalyzeConversationOperationAction[] -{ - new PiiOperationAction - { - ActionContent = new ConversationPiiActionContent - { - LoggingOptOut = true, - ModelVersion = "", - PiiCategories = {ConversationPiiCategories.Address}, - RedactAudioTiming = true, - RedactionSource = TranscriptContentType.Lexical, - RedactionCharacter = RedactionCharacter.ExclamationPoint, - ExcludePiiCategories = {ConversationPiiCategoryExclusions.Address}, - }, - Name = "", - } -}) -{ - DisplayName = "", -}; -Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); -]]> - - - -This sample shows how to call AnalyzeConversationSubmitOperationAsync. +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call GetAnalyzeConversationJobStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> + + + +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000, + Duration = 2700000, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000, + Duration = 920000, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000, + Duration = 2700000, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000, + Duration = 920000, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000, + Duration = 2700000, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000, + Duration = 920000, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000, + Duration = 2700000, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000, + Duration = 920000, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + RedactionCharacter = RedactionCharacter.Minus, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000, + Duration = 2700000, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000, + Duration = 920000, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000, + Duration = 2700000, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000, + Duration = 920000, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 0, + Duration = 20000000, + }, + }, + new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 20000000, + Duration = 50000000, + }, + }, + new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 50000000, + Duration = 60000000, + }, + } + }) +}), new AnalyzeConversationOperationAction[] +{ + new SummarizationOperationAction + { + ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.ChapterTitle, SummaryAspect.Narrative}), + Name = "Conversation Summarization Task 1", + } +}) +{ + DisplayName = "Conversation Summarization Example", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TextConversation("20220101meeting", "en", new TextConversationItem[] + { + new TextConversationItem("1", "user", "Hi!") + { + Role = ParticipantRole.Customer, + }, + new TextConversationItem("2", "agent", "Hello, how can I help you?") + { + Role = ParticipantRole.Agent, + }, + new TextConversationItem("3", "user", "I am having trouble issuing a return of a game on my xbox: call of duty") + { + Role = ParticipantRole.Customer, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new SummarizationOperationAction + { + ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.Issue, SummaryAspect.Resolution}) + { + ModelVersion = "latest", + }, + Name = "analyze 1", + } +}) +{ + DisplayName = "Analyze conversations from Contoso meeting", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 0, + Duration = 20000000, + }, + }, + new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 20000000, + Duration = 50000000, + }, + }, + new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 50000000, + Duration = 60000000, + }, + } + }) +}), new AnalyzeConversationOperationAction[] +{ + new CustomSummarizationOperationAction + { + ActionContent = new CustomConversationSummarizationActionContent("my_project", "my_deployment", new SummaryAspect[]{SummaryAspect.Narrative}), + Name = "Custom Conversation Summarization Task 1", + } +}) +{ + DisplayName = "Custom Conversation Summarization Example", +}; +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); +]]> + + + +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000, + Duration = 2700000, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000, + Duration = 920000, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000, + Duration = 2700000, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000, + Duration = 920000, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000, + Duration = 2700000, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000, + Duration = 920000, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000, + Duration = 2700000, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000, + Duration = 920000, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + RedactionCharacter = RedactionCharacter.Minus, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") + { + WordLevelTimings = {new WordLevelTiming + { + Offset = 390000, + Duration = 2700000, + Word = "good", + }, new WordLevelTiming + { + Offset = 4500000, + Duration = 920000, + Word = "morning", + }, new WordLevelTiming + { + Offset = 590000, + Duration = 2700000, + Word = "john", + }, new WordLevelTiming + { + Offset = 6300000, + Duration = 920000, + Word = "doe", + }}, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new PiiOperationAction + { + ActionContent = new ConversationPiiActionContent + { + ModelVersion = "latest", + PiiCategories = {ConversationPiiCategories.All}, + RedactAudioTiming = true, + RedactionSource = TranscriptContentType.Lexical, + }, + Name = "Conversation PII", + } +}) +{ + DisplayName = "Redacting PII data from transcribed audio", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 0, + Duration = 20000000, + }, + }, + new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 20000000, + Duration = 50000000, + }, + }, + new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 50000000, + Duration = 60000000, + }, + } + }) +}), new AnalyzeConversationOperationAction[] +{ + new SummarizationOperationAction + { + ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.ChapterTitle, SummaryAspect.Narrative}), + Name = "Conversation Summarization Task 1", + } +}) +{ + DisplayName = "Conversation Summarization Example", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TextConversation("20220101meeting", "en", new TextConversationItem[] + { + new TextConversationItem("1", "user", "Hi!") + { + Role = ParticipantRole.Customer, + }, + new TextConversationItem("2", "agent", "Hello, how can I help you?") + { + Role = ParticipantRole.Agent, + }, + new TextConversationItem("3", "user", "I am having trouble issuing a return of a game on my xbox: call of duty") + { + Role = ParticipantRole.Customer, + } + }) + { + Domain = ConversationDomain.Generic, + } +}), new AnalyzeConversationOperationAction[] +{ + new SummarizationOperationAction + { + ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.Issue, SummaryAspect.Resolution}) + { + ModelVersion = "latest", + }, + Name = "analyze 1", + } +}) +{ + DisplayName = "Analyze conversations from Contoso meeting", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] +{ + new TranscriptConversation("1", "en", new TranscriptConversationItem[] + { + new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 0, + Duration = 20000000, + }, + }, + new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 20000000, + Duration = 50000000, + }, + }, + new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") + { + ConversationItemLevelTiming = new ConversationItemLevelTiming + { + Offset = 50000000, + Duration = 60000000, + }, + } + }) +}), new AnalyzeConversationOperationAction[] +{ + new CustomSummarizationOperationAction + { + ActionContent = new CustomConversationSummarizationActionContent("my_project", "my_deployment", new SummaryAspect[]{SummaryAspect.Narrative}), + Name = "Custom Conversation Summarization Task 1", + } +}) +{ + DisplayName = "Custom Conversation Summarization Example", +}; +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); +]]> + + + +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000, + duration = 2700000, + }, + new + { + word = "morning", + offset = 4500000, + duration = 920000, + }, + new + { + word = "john", + offset = 590000, + duration = 2700000, + }, + new + { + word = "doe", + offset = 6300000, + duration = 920000, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + excludePiiCategories = new object[] + { + "Person" + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000, + duration = 2700000, + }, + new + { + word = "morning", + offset = 4500000, + duration = 920000, + }, + new + { + word = "john", + offset = 590000, + duration = 2700000, + }, + new + { + word = "doe", + offset = 6300000, + duration = 920000, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, + redactionCharacter = "-", + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000, + duration = 2700000, + }, + new + { + word = "morning", + offset = 4500000, + duration = 920000, + }, + new + { + word = "john", + offset = 590000, + duration = 2700000, + }, + new + { + word = "doe", + offset = 6300000, + duration = 920000, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new { + displayName = "Conversation Summarization Example", analysisInput = new { conversations = new object[] { new { - modality = "text", + id = "1", + language = "en", + modality = "transcript", conversationItems = new object[] { new { - id = "", - participantId = "", - text = "", + participantId = "speaker 1", + id = "1", + text = "Let's get started.", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 0, + duration = 20000000, + }, + }, + new + { + participantId = "speaker 2", + id = "2", + text = "OK. How many remaining bugs do we have now?", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 20000000, + duration = 50000000, + }, + }, + new + { + participantId = "speaker 3", + id = "3", + text = "Only 3.", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 50000000, + duration = 60000000, + }, } }, - id = "", - language = "", } }, }, @@ -604,43 +1714,64 @@ using RequestContent content = RequestContent.Create(new { new { - kind = "ConversationalPIITask", + taskName = "Conversation Summarization Task 1", + kind = "ConversationalSummarizationTask", + parameters = new + { + summaryAspects = new object[] + { + "chapterTitle", + "narrative" + }, + }, } }, }); Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); ]]> -This sample shows how to call AnalyzeConversationSubmitOperationAsync with all parameters and request content. +This sample shows how to call AnalyzeConversationSubmitOperationAsync. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - displayName = "", + displayName = "Analyze conversations from Contoso meeting", analysisInput = new { conversations = new object[] { new { + id = "20220101meeting", + language = "en", modality = "text", + domain = "generic", conversationItems = new object[] { new { - id = "", - participantId = "", - language = "", - modality = "transcript", + participantId = "user", + role = "customer", + id = "1", + text = "Hi!", + }, + new + { + participantId = "agent", + role = "agent", + id = "2", + text = "Hello, how can I help you?", + }, + new + { + participantId = "user", role = "customer", - text = "", + id = "3", + text = "I am having trouble issuing a return of a game on my xbox: call of duty", } }, - id = "", - language = "", - domain = "finance", } }, }, @@ -648,24 +1779,103 @@ using RequestContent content = RequestContent.Create(new { new { - kind = "ConversationalPIITask", + taskName = "analyze 1", + kind = "ConversationalSummarizationTask", parameters = new { - loggingOptOut = true, - modelVersion = "", - piiCategories = new object[] + modelVersion = "latest", + summaryAspects = new object[] { - "Address" + "issue", + "resolution" }, - redactAudioTiming = true, - redactionSource = "lexical", - redactionCharacter = "!", - excludePiiCategories = new object[] + }, + } + }, +}); +Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Custom Conversation Summarization Example", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + conversationItems = new object[] + { + new + { + participantId = "speaker 1", + id = "1", + text = "Let's get started.", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 0, + duration = 20000000, + }, + }, + new + { + participantId = "speaker 2", + id = "2", + text = "OK. How many remaining bugs do we have now?", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 20000000, + duration = 50000000, + }, + }, + new + { + participantId = "speaker 3", + id = "3", + text = "Only 3.", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 50000000, + duration = 60000000, + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Custom Conversation Summarization Task 1", + kind = "CustomConversationalSummarizationTask", + parameters = new + { + summaryAspects = new object[] { - "Address" + "narrative" }, + projectName = "my_project", + deploymentName = "my_deployment", }, - taskName = "", } }, }); @@ -676,30 +1886,62 @@ Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitU This sample shows how to call AnalyzeConversationSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { + displayName = "Redacting PII data from transcribed audio", analysisInput = new { conversations = new object[] { new { - modality = "text", + id = "1", + language = "en", + modality = "transcript", + domain = "generic", conversationItems = new object[] { new { - id = "", - participantId = "", - text = "", + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000, + duration = 2700000, + }, + new + { + word = "morning", + offset = 4500000, + duration = 920000, + }, + new + { + word = "john", + offset = 590000, + duration = 2700000, + }, + new + { + word = "doe", + offset = 6300000, + duration = 920000, + } + }, } }, - id = "", - language = "", } }, }, @@ -707,43 +1949,81 @@ using RequestContent content = RequestContent.Create(new { new { + taskName = "Conversation PII", kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + excludePiiCategories = new object[] + { + "Person" + }, + redactionSource = "lexical", + redactAudioTiming = true, + }, } }, }); Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); ]]> -This sample shows how to call AnalyzeConversationSubmitOperation with all parameters and request content. +This sample shows how to call AnalyzeConversationSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - displayName = "", + displayName = "Redacting PII data from transcribed audio", analysisInput = new { conversations = new object[] { new { - modality = "text", + id = "1", + language = "en", + modality = "transcript", + domain = "generic", conversationItems = new object[] { new { - id = "", - participantId = "", - language = "", - modality = "transcript", - role = "customer", - text = "", + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000, + duration = 2700000, + }, + new + { + word = "morning", + offset = 4500000, + duration = 920000, + }, + new + { + word = "john", + offset = 590000, + duration = 2700000, + }, + new + { + word = "doe", + offset = 6300000, + duration = 920000, + } + }, } }, - id = "", - language = "", - domain = "finance", } }, }, @@ -751,66 +2031,364 @@ using RequestContent content = RequestContent.Create(new { new { + taskName = "Conversation PII", kind = "ConversationalPIITask", parameters = new { - loggingOptOut = true, - modelVersion = "", + modelVersion = "latest", piiCategories = new object[] { - "Address" + "All" }, + redactionCharacter = "-", + redactionSource = "lexical", redactAudioTiming = true, + }, + } + }, +}); +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "1", + id = "1", + text = "Good morning John Doe.", + itn = "good morning john doe", + maskedItn = "good morning john doe", + lexical = "good morning john doe", + wordLevelTimings = new object[] + { + new + { + word = "good", + offset = 390000, + duration = 2700000, + }, + new + { + word = "morning", + offset = 4500000, + duration = 920000, + }, + new + { + word = "john", + offset = 590000, + duration = 2700000, + }, + new + { + word = "doe", + offset = 6300000, + duration = 920000, + } + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation PII", + kind = "ConversationalPIITask", + parameters = new + { + modelVersion = "latest", + piiCategories = new object[] + { + "All" + }, redactionSource = "lexical", - redactionCharacter = "!", - excludePiiCategories = new object[] + redactAudioTiming = true, + }, + } + }, +}); +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Conversation Summarization Example", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + conversationItems = new object[] + { + new + { + participantId = "speaker 1", + id = "1", + text = "Let's get started.", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 0, + duration = 20000000, + }, + }, + new + { + participantId = "speaker 2", + id = "2", + text = "OK. How many remaining bugs do we have now?", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 20000000, + duration = 50000000, + }, + }, + new + { + participantId = "speaker 3", + id = "3", + text = "Only 3.", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 50000000, + duration = 60000000, + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Conversation Summarization Task 1", + kind = "ConversationalSummarizationTask", + parameters = new + { + summaryAspects = new object[] { - "Address" + "chapterTitle", + "narrative" }, }, - taskName = "", } }, }); Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); -]]> - - - -This sample shows how to call CancelAnalyzeConversationsAsync. +]]> +This sample shows how to call AnalyzeConversationSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Operation operation = await client.CancelAnalyzeConversationsAsync(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +using RequestContent content = RequestContent.Create(new +{ + displayName = "Analyze conversations from Contoso meeting", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "20220101meeting", + language = "en", + modality = "text", + domain = "generic", + conversationItems = new object[] + { + new + { + participantId = "user", + role = "customer", + id = "1", + text = "Hi!", + }, + new + { + participantId = "agent", + role = "agent", + id = "2", + text = "Hello, how can I help you?", + }, + new + { + participantId = "user", + role = "customer", + id = "3", + text = "I am having trouble issuing a return of a game on my xbox: call of duty", + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "analyze 1", + kind = "ConversationalSummarizationTask", + parameters = new + { + modelVersion = "latest", + summaryAspects = new object[] + { + "issue", + "resolution" + }, + }, + } + }, +}); +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); ]]> -This sample shows how to call CancelAnalyzeConversationsAsync with all parameters. +This sample shows how to call AnalyzeConversationSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Operation operation = await client.CancelAnalyzeConversationsAsync(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +using RequestContent content = RequestContent.Create(new +{ + displayName = "Custom Conversation Summarization Example", + analysisInput = new + { + conversations = new object[] + { + new + { + id = "1", + language = "en", + modality = "transcript", + conversationItems = new object[] + { + new + { + participantId = "speaker 1", + id = "1", + text = "Let's get started.", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 0, + duration = 20000000, + }, + }, + new + { + participantId = "speaker 2", + id = "2", + text = "OK. How many remaining bugs do we have now?", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 20000000, + duration = 50000000, + }, + }, + new + { + participantId = "speaker 3", + id = "3", + text = "Only 3.", + lexical = "", + itn = "", + maskedItn = "", + conversationItemLevelTiming = new + { + offset = 50000000, + duration = 60000000, + }, + } + }, + } + }, + }, + tasks = new object[] + { + new + { + taskName = "Custom Conversation Summarization Task 1", + kind = "CustomConversationalSummarizationTask", + parameters = new + { + summaryAspects = new object[] + { + "narrative" + }, + projectName = "my_project", + deploymentName = "my_deployment", + }, + } + }, +}); +Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); ]]> - + -This sample shows how to call CancelAnalyzeConversations. +This sample shows how to call CancelAnalyzeConversationsAsync. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Operation operation = client.CancelAnalyzeConversations(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -]]> -This sample shows how to call CancelAnalyzeConversations with all parameters. +Operation operation = await client.CancelAnalyzeConversationsAsync(WaitUntil.Completed, Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> + + + +This sample shows how to call CancelAnalyzeConversations. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); -Operation operation = client.CancelAnalyzeConversations(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +Operation operation = client.CancelAnalyzeConversations(WaitUntil.Completed, Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); ]]> diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/Samples/Samples_ConversationAnalysisClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/Samples/Samples_ConversationAnalysisClient.cs index 64d98613fd997..430eb2ff01239 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/Samples/Samples_ConversationAnalysisClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Generated/Samples/Samples_ConversationAnalysisClient.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Collections.Generic; using System.Text.Json; using System.Threading.Tasks; using Azure.AI.Language.Conversations.Models; @@ -20,9 +19,9 @@ public partial class Samples_ConversationAnalysisClient { [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversation_ShortVersion() + public void Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversations() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); @@ -33,15 +32,15 @@ public void Example_Conversations_AnalyzeConversation_ShortVersion() { conversationItem = new { - id = "", - participantId = "", - text = "", + id = "1", + participantId = "1", + text = "Book a flight to Seattle on Oct 10th", }, }, parameters = new { - projectName = "", - deploymentName = "", + projectName = "{project-name}", + deploymentName = "{deployment-name}", }, }); Response response = client.AnalyzeConversation(content); @@ -52,9 +51,9 @@ public void Example_Conversations_AnalyzeConversation_ShortVersion() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversation_ShortVersion_Async() + public async Task Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversations_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); @@ -65,15 +64,15 @@ public async Task Example_Conversations_AnalyzeConversation_ShortVersion_Async() { conversationItem = new { - id = "", - participantId = "", - text = "", + id = "1", + participantId = "1", + text = "Book a flight to Seattle on Oct 10th", }, }, parameters = new { - projectName = "", - deploymentName = "", + projectName = "{project-name}", + deploymentName = "{deployment-name}", }, }); Response response = await client.AnalyzeConversationAsync(content); @@ -84,33 +83,33 @@ public async Task Example_Conversations_AnalyzeConversation_ShortVersion_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversation_ShortVersion_Convenience() + public void Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversations_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("", "", "")), new ConversationLanguageUnderstandingActionContent("", "")); + AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")); Response response = client.AnalyzeConversation(analyzeConversationInput); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversation_ShortVersion_Convenience_Async() + public async Task Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversations_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("", "", "")), new ConversationLanguageUnderstandingActionContent("", "")); + AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Book a flight to Seattle on Oct 10th")), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}")); Response response = await client.AnalyzeConversationAsync(analyzeConversationInput); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversation_AllParameters() + public void Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversationsArbitration() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); @@ -121,38 +120,143 @@ public void Example_Conversations_AnalyzeConversation_AllParameters() { conversationItem = new { - id = "", - participantId = "", - language = "", - modality = "transcript", - role = "customer", - text = "", + participantId = "1", + id = "1", + modality = "text", + language = "en-GB", + text = "How do I integrate QnA Maker and LUIS?", }, }, parameters = new { - projectName = "", - deploymentName = "", + projectName = "{project-name}", + deploymentName = "{deployment-name}", verbose = true, - isLoggingEnabled = true, - stringIndexType = "TextElements_v8", - directTarget = "", + isLoggingEnabled = false, + }, + }); + Response response = client.AnalyzeConversation(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversationsArbitration_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + kind = "Conversation", + analysisInput = new + { + conversationItem = new + { + participantId = "1", + id = "1", + modality = "text", + language = "en-GB", + text = "How do I integrate QnA Maker and LUIS?", + }, + }, + parameters = new + { + projectName = "{project-name}", + deploymentName = "{deployment-name}", + verbose = true, + isLoggingEnabled = false, + }, + }); + Response response = await client.AnalyzeConversationAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("kind").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversationsArbitration_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "How do I integrate QnA Maker and LUIS?") + { + Language = "en-GB", + Modality = InputModality.Text, + }), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}") + { + Verbose = true, + IsLoggingEnabled = false, + }); + Response response = client.AnalyzeConversation(analyzeConversationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversationsArbitration_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "How do I integrate QnA Maker and LUIS?") + { + Language = "en-GB", + Modality = InputModality.Text, + }), new ConversationLanguageUnderstandingActionContent("{project-name}", "{deployment-name}") + { + Verbose = true, + IsLoggingEnabled = false, + }); + Response response = await client.AnalyzeConversationAsync(analyzeConversationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversationsArbitrationDirectTarget() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + kind = "Conversation", + analysisInput = new + { + conversationItem = new + { + text = "Ports and connectors", + participantId = "1", + id = "1", + }, + }, + parameters = new + { + projectName = "prj1", + deploymentName = "dep1", + directTarget = "qnaProject", targetProjectParameters = new { - key = new + qnaProject = new { - targetProjectKind = "Luis", - query = "", - callingOptions = new Dictionary + targetProjectKind = "QuestionAnswering", + callingOptions = new { - ["verbose"] = true, - ["log"] = true, - ["show-all-intents"] = true, - ["timezoneOffset"] = 1234, - ["spellCheck"] = true, - ["bing-spell-check-subscription-key"] = "" + context = new + { + previousUserQuery = "Meet Surface Pro 4", + previousQnaId = 4, + }, + top = 1, + question = "App Service overview", }, - apiVersion = "", }, }, }, @@ -165,9 +269,9 @@ public void Example_Conversations_AnalyzeConversation_AllParameters() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversation_AllParameters_Async() + public async Task Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversationsArbitrationDirectTarget_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); @@ -178,38 +282,31 @@ public async Task Example_Conversations_AnalyzeConversation_AllParameters_Async( { conversationItem = new { - id = "", - participantId = "", - language = "", - modality = "transcript", - role = "customer", - text = "", + text = "Ports and connectors", + participantId = "1", + id = "1", }, }, parameters = new { - projectName = "", - deploymentName = "", - verbose = true, - isLoggingEnabled = true, - stringIndexType = "TextElements_v8", - directTarget = "", + projectName = "prj1", + deploymentName = "dep1", + directTarget = "qnaProject", targetProjectParameters = new { - key = new + qnaProject = new { - targetProjectKind = "Luis", - query = "", - callingOptions = new Dictionary + targetProjectKind = "QuestionAnswering", + callingOptions = new { - ["verbose"] = true, - ["log"] = true, - ["show-all-intents"] = true, - ["timezoneOffset"] = 1234, - ["spellCheck"] = true, - ["bing-spell-check-subscription-key"] = "" + context = new + { + previousUserQuery = "Meet Surface Pro 4", + previousQnaId = 4, + }, + top = 1, + question = "App Service overview", }, - apiVersion = "", }, }, }, @@ -222,38 +319,28 @@ public async Task Example_Conversations_AnalyzeConversation_AllParameters_Async( [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversation_AllParameters_Convenience() + public void Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversationsArbitrationDirectTarget_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("", "", "") + AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Ports and connectors")), new ConversationLanguageUnderstandingActionContent("prj1", "dep1") { - Language = "", - Modality = InputModality.Transcript, - Role = ParticipantRole.Customer, - }), new ConversationLanguageUnderstandingActionContent("", "") - { - Verbose = true, - IsLoggingEnabled = true, - StringIndexType = StringIndexType.TextElementsV8, - DirectTarget = "", + DirectTarget = "qnaProject", TargetProjectParameters = { -["key"] = new LuisConfig +["qnaProject"] = new QuestionAnsweringConfig { -Query = "", -CallingOptions = new LuisCallingConfig +CallingOptions = new QuestionAnswersConfig { -Verbose = true, -Log = true, -ShowAllIntents = true, -TimezoneOffset = 1234, -SpellCheck = true, -BingSpellCheckSubscriptionKey = "", +Question = "App Service overview", +Top = 1, +AnswerContext = new KnowledgeBaseAnswerContext(4) +{ +PreviousQuestion = "Meet Surface Pro 4", +}, }, -ApiVersion = "", } }, }); @@ -262,38 +349,28 @@ public void Example_Conversations_AnalyzeConversation_AllParameters_Convenience( [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversation_AllParameters_Convenience_Async() + public async Task Example_Conversations_AnalyzeConversation_SuccessfulAnalyzeConversationsArbitrationDirectTarget_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("", "", "") + AnalyzeConversationInput analyzeConversationInput = new ConversationLanguageUnderstandingInput(new ConversationAnalysisInput(new TextConversationItem("1", "1", "Ports and connectors")), new ConversationLanguageUnderstandingActionContent("prj1", "dep1") { - Language = "", - Modality = InputModality.Transcript, - Role = ParticipantRole.Customer, - }), new ConversationLanguageUnderstandingActionContent("", "") - { - Verbose = true, - IsLoggingEnabled = true, - StringIndexType = StringIndexType.TextElementsV8, - DirectTarget = "", + DirectTarget = "qnaProject", TargetProjectParameters = { -["key"] = new LuisConfig +["qnaProject"] = new QuestionAnsweringConfig { -Query = "", -CallingOptions = new LuisCallingConfig +CallingOptions = new QuestionAnswersConfig { -Verbose = true, -Log = true, -ShowAllIntents = true, -TimezoneOffset = 1234, -SpellCheck = true, -BingSpellCheckSubscriptionKey = "", +Question = "App Service overview", +Top = 1, +AnswerContext = new KnowledgeBaseAnswerContext(4) +{ +PreviousQuestion = "Meet Surface Pro 4", +}, }, -ApiVersion = "", } }, }); @@ -302,13 +379,205 @@ public async Task Example_Conversations_AnalyzeConversation_AllParameters_Conven [Test] [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_ShortVersion() + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIExclusionTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIExclusionTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIExclusionTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIExclusionTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIRedactionCharTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIRedactionCharTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIRedactionCharTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIIRedactionCharTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIITaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIITaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIITaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationPIITaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationSummarizationTaskResult() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null); + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("createdDateTime").ToString()); @@ -323,13 +592,13 @@ public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_ [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_ShortVersion_Async() + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationSummarizationTaskResult_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null); + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("createdDateTime").ToString()); @@ -344,174 +613,1423 @@ public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobS [Test] [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_ShortVersion_Convenience() + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationSummarizationTaskResult_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_ShortVersion_Convenience_Async() + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationSummarizationTaskResult_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_AllParameters() + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationSummarizationTaskStatusRequest() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, null); + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("displayName").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("jobId").ToString()); Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); Console.WriteLine(result.GetProperty("status").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("nextLink").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("conversationsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("validConversationsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousConversationsCount").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_AllParameters_Async() + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationSummarizationTaskStatusRequest_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, null); + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("displayName").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("jobId").ToString()); Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); Console.WriteLine(result.GetProperty("status").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("nextLink").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("conversationsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("validConversationsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousConversationsCount").ToString()); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_AllParameters_Convenience() + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationSummarizationTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulConversationSummarizationTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulCustomConversationSummarizationTaskResult() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulCustomConversationSummarizationTaskResult_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086"), null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulCustomConversationSummarizationTaskResult_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_SuccessfulCustomConversationSummarizationTaskResult_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("3e9e8518-492f-47f9-abd1-9a7468231086")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000, +duration = 2700000, +}, +new +{ +word = "morning", +offset = 4500000, +duration = 920000, +}, +new +{ +word = "john", +offset = 590000, +duration = 2700000, +}, +new +{ +word = "doe", +offset = 6300000, +duration = 920000, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +excludePiiCategories = new object[] +{ +"Person" +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000, +duration = 2700000, +}, +new +{ +word = "morning", +offset = 4500000, +duration = 920000, +}, +new +{ +word = "john", +offset = 590000, +duration = 2700000, +}, +new +{ +word = "doe", +offset = 6300000, +duration = 920000, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +excludePiiCategories = new object[] +{ +"Person" +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000, +Duration = 2700000, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000, +Duration = 920000, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000, +Duration = 2700000, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000, +Duration = 920000, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIExclusionSubmit_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000, +Duration = 2700000, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000, +Duration = 920000, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000, +Duration = 2700000, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000, +Duration = 920000, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +ExcludePiiCategories = {ConversationPiiCategoryExclusions.Person}, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIRedactionCharSubmit() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000, +duration = 2700000, +}, +new +{ +word = "morning", +offset = 4500000, +duration = 920000, +}, +new +{ +word = "john", +offset = 590000, +duration = 2700000, +}, +new +{ +word = "doe", +offset = 6300000, +duration = 920000, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +piiCategories = new object[] +{ +"All" +}, +redactionCharacter = "-", +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIRedactionCharSubmit_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000, +duration = 2700000, +}, +new +{ +word = "morning", +offset = 4500000, +duration = 920000, +}, +new +{ +word = "john", +offset = 590000, +duration = 2700000, +}, +new +{ +word = "doe", +offset = 6300000, +duration = 920000, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +piiCategories = new object[] +{ +"All" +}, +redactionCharacter = "-", +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIRedactionCharSubmit_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000, +Duration = 2700000, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000, +Duration = 920000, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000, +Duration = 2700000, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000, +Duration = 920000, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +RedactionCharacter = RedactionCharacter.Minus, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIIRedactionCharSubmit_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000, +Duration = 2700000, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000, +Duration = 920000, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000, +Duration = 2700000, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000, +Duration = 920000, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +RedactionCharacter = RedactionCharacter.Minus, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIISubmit() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000, +duration = 2700000, +}, +new +{ +word = "morning", +offset = 4500000, +duration = 920000, +}, +new +{ +word = "john", +offset = 590000, +duration = 2700000, +}, +new +{ +word = "doe", +offset = 6300000, +duration = 920000, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +piiCategories = new object[] +{ +"All" +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIISubmit_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Redacting PII data from transcribed audio", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +domain = "generic", +conversationItems = new object[] +{ +new +{ +participantId = "1", +id = "1", +text = "Good morning John Doe.", +itn = "good morning john doe", +maskedItn = "good morning john doe", +lexical = "good morning john doe", +wordLevelTimings = new object[] +{ +new +{ +word = "good", +offset = 390000, +duration = 2700000, +}, +new +{ +word = "morning", +offset = 4500000, +duration = 920000, +}, +new +{ +word = "john", +offset = 590000, +duration = 2700000, +}, +new +{ +word = "doe", +offset = 6300000, +duration = 920000, +} +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation PII", +kind = "ConversationalPIITask", +parameters = new +{ +modelVersion = "latest", +piiCategories = new object[] +{ +"All" +}, +redactionSource = "lexical", +redactAudioTiming = true, +}, +} + }, + }); + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIISubmit_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000, +Duration = 2700000, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000, +Duration = 920000, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000, +Duration = 2700000, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000, +Duration = 920000, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationPIISubmit_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "1", + "good morning john doe", + "good morning john doe", + "Good morning John Doe.", + "good morning john doe") +{ +WordLevelTimings = {new WordLevelTiming +{ +Offset = 390000, +Duration = 2700000, +Word = "good", +}, new WordLevelTiming +{ +Offset = 4500000, +Duration = 920000, +Word = "morning", +}, new WordLevelTiming +{ +Offset = 590000, +Duration = 2700000, +Word = "john", +}, new WordLevelTiming +{ +Offset = 6300000, +Duration = 920000, +Word = "doe", +}}, +} +}) +{ +Domain = ConversationDomain.Generic, +} + }), new AnalyzeConversationOperationAction[] + { +new PiiOperationAction +{ +ActionContent = new ConversationPiiActionContent +{ +ModelVersion = "latest", +PiiCategories = {ConversationPiiCategories.All}, +RedactAudioTiming = true, +RedactionSource = TranscriptContentType.Lexical, +}, +Name = "Conversation PII", +} + }) + { + DisplayName = "Redacting PII data from transcribed audio", + }; + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationSummarizationTaskSubmit() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Conversation Summarization Example", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +conversationItems = new object[] +{ +new +{ +participantId = "speaker 1", +id = "1", +text = "Let's get started.", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 0, +duration = 20000000, +}, +}, +new +{ +participantId = "speaker 2", +id = "2", +text = "OK. How many remaining bugs do we have now?", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 20000000, +duration = 50000000, +}, +}, +new +{ +participantId = "speaker 3", +id = "3", +text = "Only 3.", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 50000000, +duration = 60000000, +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation Summarization Task 1", +kind = "ConversationalSummarizationTask", +parameters = new +{ +summaryAspects = new object[] +{ +"chapterTitle", +"narrative" +}, +}, +} + }, + }); + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationSummarizationTaskSubmit_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Conversation Summarization Example", + analysisInput = new + { + conversations = new object[] + { +new +{ +id = "1", +language = "en", +modality = "transcript", +conversationItems = new object[] +{ +new +{ +participantId = "speaker 1", +id = "1", +text = "Let's get started.", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 0, +duration = 20000000, +}, +}, +new +{ +participantId = "speaker 2", +id = "2", +text = "OK. How many remaining bugs do we have now?", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 20000000, +duration = 50000000, +}, +}, +new +{ +participantId = "speaker 3", +id = "3", +text = "Only 3.", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 50000000, +duration = 60000000, +}, +} +}, +} + }, + }, + tasks = new object[] + { +new +{ +taskName = "Conversation Summarization Task 1", +kind = "ConversationalSummarizationTask", +parameters = new +{ +summaryAspects = new object[] +{ +"chapterTitle", +"narrative" +}, +}, +} + }, + }); + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationSummarizationTaskSubmit_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Response response = client.GetAnalyzeConversationJobStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStatistics: true); + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 0, +Duration = 20000000, +}, +}, +new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 20000000, +Duration = 50000000, +}, +}, +new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 50000000, +Duration = 60000000, +}, +} +}) + }), new AnalyzeConversationOperationAction[] + { +new SummarizationOperationAction +{ +ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.ChapterTitle, SummaryAspect.Narrative}), +Name = "Conversation Summarization Task 1", +} + }) + { + DisplayName = "Conversation Summarization Example", + }; + Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeConversationJobState_GetAnalyzeConversationJobStatus_AllParameters_Convenience_Async() + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationSummarizationTaskSubmit_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Response response = await client.GetAnalyzeConversationJobStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStatistics: true); + AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] + { +new TranscriptConversation("1", "en", new TranscriptConversationItem[] +{ +new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 0, +Duration = 20000000, +}, +}, +new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 20000000, +Duration = 50000000, +}, +}, +new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 50000000, +Duration = 60000000, +}, +} +}) + }), new AnalyzeConversationOperationAction[] + { +new SummarizationOperationAction +{ +ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.ChapterTitle, SummaryAspect.Narrative}), +Name = "Conversation Summarization Task 1", +} + }) + { + DisplayName = "Conversation Summarization Example", + }; + Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversationSubmitOperation_ShortVersion() + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationSummarySubmit() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { + displayName = "Analyze conversations from Contoso meeting", analysisInput = new { conversations = new object[] { new { +id = "20220101meeting", +language = "en", modality = "text", +domain = "generic", conversationItems = new object[] { new { -id = "", -participantId = "", -text = "", +participantId = "user", +role = "customer", +id = "1", +text = "Hi!", +}, +new +{ +participantId = "agent", +role = "agent", +id = "2", +text = "Hello, how can I help you?", +}, +new +{ +participantId = "user", +role = "customer", +id = "3", +text = "I am having trouble issuing a return of a game on my xbox: call of duty", } }, -id = "", -language = "", } }, }, @@ -519,7 +2037,17 @@ public void Example_Conversations_AnalyzeConversationSubmitOperation_ShortVersio { new { -kind = "ConversationalPIITask", +taskName = "analyze 1", +kind = "ConversationalSummarizationTask", +parameters = new +{ +modelVersion = "latest", +summaryAspects = new object[] +{ +"issue", +"resolution" +}, +}, } }, }); @@ -528,32 +2056,49 @@ public void Example_Conversations_AnalyzeConversationSubmitOperation_ShortVersio [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversationSubmitOperation_ShortVersion_Async() + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationSummarySubmit_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { + displayName = "Analyze conversations from Contoso meeting", analysisInput = new { conversations = new object[] { new { +id = "20220101meeting", +language = "en", modality = "text", +domain = "generic", conversationItems = new object[] { new { -id = "", -participantId = "", -text = "", +participantId = "user", +role = "customer", +id = "1", +text = "Hi!", +}, +new +{ +participantId = "agent", +role = "agent", +id = "2", +text = "Hello, how can I help you?", +}, +new +{ +participantId = "user", +role = "customer", +id = "3", +text = "I am having trouble issuing a return of a game on my xbox: call of duty", } }, -id = "", -language = "", } }, }, @@ -561,7 +2106,17 @@ public async Task Example_Conversations_AnalyzeConversationSubmitOperation_Short { new { -kind = "ConversationalPIITask", +taskName = "analyze 1", +kind = "ConversationalSummarizationTask", +parameters = new +{ +modelVersion = "latest", +summaryAspects = new object[] +{ +"issue", +"resolution" +}, +}, } }, }); @@ -570,79 +2125,159 @@ public async Task Example_Conversations_AnalyzeConversationSubmitOperation_Short [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversationSubmitOperation_ShortVersion_Convenience() + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationSummarySubmit_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] { -new TextConversation("", "", new TextConversationItem[] +new TextConversation("20220101meeting", "en", new TextConversationItem[] { -new TextConversationItem("", "", "") +new TextConversationItem("1", "user", "Hi!") +{ +Role = ParticipantRole.Customer, +}, +new TextConversationItem("2", "agent", "Hello, how can I help you?") +{ +Role = ParticipantRole.Agent, +}, +new TextConversationItem("3", "user", "I am having trouble issuing a return of a game on my xbox: call of duty") +{ +Role = ParticipantRole.Customer, +} }) +{ +Domain = ConversationDomain.Generic, +} }), new AnalyzeConversationOperationAction[] { -new PiiOperationAction() - }); +new SummarizationOperationAction +{ +ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.Issue, SummaryAspect.Resolution}) +{ +ModelVersion = "latest", +}, +Name = "analyze 1", +} + }) + { + DisplayName = "Analyze conversations from Contoso meeting", + }; Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversationSubmitOperation_ShortVersion_Convenience_Async() + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulConversationSummarySubmit_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] { -new TextConversation("", "", new TextConversationItem[] +new TextConversation("20220101meeting", "en", new TextConversationItem[] +{ +new TextConversationItem("1", "user", "Hi!") +{ +Role = ParticipantRole.Customer, +}, +new TextConversationItem("2", "agent", "Hello, how can I help you?") +{ +Role = ParticipantRole.Agent, +}, +new TextConversationItem("3", "user", "I am having trouble issuing a return of a game on my xbox: call of duty") { -new TextConversationItem("", "", "") +Role = ParticipantRole.Customer, +} }) +{ +Domain = ConversationDomain.Generic, +} }), new AnalyzeConversationOperationAction[] { -new PiiOperationAction() - }); +new SummarizationOperationAction +{ +ActionContent = new ConversationSummarizationActionContent(new SummaryAspect[]{SummaryAspect.Issue, SummaryAspect.Resolution}) +{ +ModelVersion = "latest", +}, +Name = "analyze 1", +} + }) + { + DisplayName = "Analyze conversations from Contoso meeting", + }; Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversationSubmitOperation_AllParameters() + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulCustomConversationSummarizationTaskSubmit() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - displayName = "", + displayName = "Custom Conversation Summarization Example", analysisInput = new { conversations = new object[] { new { -modality = "text", +id = "1", +language = "en", +modality = "transcript", conversationItems = new object[] { new { -id = "", -participantId = "", -language = "", -modality = "transcript", -role = "customer", -text = "", +participantId = "speaker 1", +id = "1", +text = "Let's get started.", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 0, +duration = 20000000, +}, +}, +new +{ +participantId = "speaker 2", +id = "2", +text = "OK. How many remaining bugs do we have now?", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 20000000, +duration = 50000000, +}, +}, +new +{ +participantId = "speaker 3", +id = "3", +text = "Only 3.", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 50000000, +duration = 60000000, +}, } }, -id = "", -language = "", -domain = "finance", } }, }, @@ -650,24 +2285,17 @@ public void Example_Conversations_AnalyzeConversationSubmitOperation_AllParamete { new { -kind = "ConversationalPIITask", +taskName = "Custom Conversation Summarization Task 1", +kind = "CustomConversationalSummarizationTask", parameters = new { -loggingOptOut = true, -modelVersion = "", -piiCategories = new object[] -{ -"Address" -}, -redactAudioTiming = true, -redactionSource = "lexical", -redactionCharacter = "!", -excludePiiCategories = new object[] +summaryAspects = new object[] { -"Address" +"narrative" }, +projectName = "my_project", +deploymentName = "my_deployment", }, -taskName = "", } }, }); @@ -676,37 +2304,69 @@ public void Example_Conversations_AnalyzeConversationSubmitOperation_AllParamete [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversationSubmitOperation_AllParameters_Async() + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulCustomConversationSummarizationTaskSubmit_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - displayName = "", + displayName = "Custom Conversation Summarization Example", analysisInput = new { conversations = new object[] { new { -modality = "text", +id = "1", +language = "en", +modality = "transcript", conversationItems = new object[] { new { -id = "", -participantId = "", -language = "", -modality = "transcript", -role = "customer", -text = "", +participantId = "speaker 1", +id = "1", +text = "Let's get started.", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 0, +duration = 20000000, +}, +}, +new +{ +participantId = "speaker 2", +id = "2", +text = "OK. How many remaining bugs do we have now?", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 20000000, +duration = 50000000, +}, +}, +new +{ +participantId = "speaker 3", +id = "3", +text = "Only 3.", +lexical = "", +itn = "", +maskedItn = "", +conversationItemLevelTiming = new +{ +offset = 50000000, +duration = 60000000, +}, } }, -id = "", -language = "", -domain = "finance", } }, }, @@ -714,24 +2374,17 @@ public async Task Example_Conversations_AnalyzeConversationSubmitOperation_AllPa { new { -kind = "ConversationalPIITask", +taskName = "Custom Conversation Summarization Task 1", +kind = "CustomConversationalSummarizationTask", parameters = new { -loggingOptOut = true, -modelVersion = "", -piiCategories = new object[] -{ -"Address" -}, -redactAudioTiming = true, -redactionSource = "lexical", -redactionCharacter = "!", -excludePiiCategories = new object[] +summaryAspects = new object[] { -"Address" +"narrative" }, +projectName = "my_project", +deploymentName = "my_deployment", }, -taskName = "", } }, }); @@ -740,136 +2393,162 @@ public async Task Example_Conversations_AnalyzeConversationSubmitOperation_AllPa [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_AnalyzeConversationSubmitOperation_AllParameters_Convenience() + public void Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulCustomConversationSummarizationTaskSubmit_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] { -new TextConversation("", "", new TextConversationItem[] +new TranscriptConversation("1", "en", new TranscriptConversationItem[] { -new TextConversationItem("", "", "") +new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") { -Language = "", -Modality = InputModality.Transcript, -Role = ParticipantRole.Customer, -} -}) +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 0, +Duration = 20000000, +}, +}, +new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") { -Domain = ConversationDomain.Finance, +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 20000000, +Duration = 50000000, +}, +}, +new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 50000000, +Duration = 60000000, +}, } +}) }), new AnalyzeConversationOperationAction[] { -new PiiOperationAction +new CustomSummarizationOperationAction { -ActionContent = new ConversationPiiActionContent -{ -LoggingOptOut = true, -ModelVersion = "", -PiiCategories = {ConversationPiiCategories.Address}, -RedactAudioTiming = true, -RedactionSource = TranscriptContentType.Lexical, -RedactionCharacter = RedactionCharacter.ExclamationPoint, -ExcludePiiCategories = {ConversationPiiCategoryExclusions.Address}, -}, -Name = "", +ActionContent = new CustomConversationSummarizationActionContent("my_project", "my_deployment", new SummaryAspect[]{SummaryAspect.Narrative}), +Name = "Custom Conversation Summarization Task 1", } }) { - DisplayName = "", + DisplayName = "Custom Conversation Summarization Example", }; Operation operation = client.AnalyzeConversationSubmitOperation(WaitUntil.Completed, analyzeConversationOperationInput); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_AnalyzeConversationSubmitOperation_AllParameters_Convenience_Async() + public async Task Example_Conversations_AnalyzeConversationSubmitOperation_SuccessfulCustomConversationSummarizationTaskSubmit_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); AnalyzeConversationOperationInput analyzeConversationOperationInput = new AnalyzeConversationOperationInput(new MultiLanguageConversationInput(new ConversationInput[] { -new TextConversation("", "", new TextConversationItem[] +new TranscriptConversation("1", "en", new TranscriptConversationItem[] { -new TextConversationItem("", "", "") +new TranscriptConversationItem( + "1", + "speaker 1", + "", + "", + "Let's get started.", + "") { -Language = "", -Modality = InputModality.Transcript, -Role = ParticipantRole.Customer, -} -}) +ConversationItemLevelTiming = new ConversationItemLevelTiming { -Domain = ConversationDomain.Finance, +Offset = 0, +Duration = 20000000, +}, +}, +new TranscriptConversationItem( + "2", + "speaker 2", + "", + "", + "OK. How many remaining bugs do we have now?", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 20000000, +Duration = 50000000, +}, +}, +new TranscriptConversationItem( + "3", + "speaker 3", + "", + "", + "Only 3.", + "") +{ +ConversationItemLevelTiming = new ConversationItemLevelTiming +{ +Offset = 50000000, +Duration = 60000000, +}, } +}) }), new AnalyzeConversationOperationAction[] { -new PiiOperationAction -{ -ActionContent = new ConversationPiiActionContent +new CustomSummarizationOperationAction { -LoggingOptOut = true, -ModelVersion = "", -PiiCategories = {ConversationPiiCategories.Address}, -RedactAudioTiming = true, -RedactionSource = TranscriptContentType.Lexical, -RedactionCharacter = RedactionCharacter.ExclamationPoint, -ExcludePiiCategories = {ConversationPiiCategoryExclusions.Address}, -}, -Name = "", +ActionContent = new CustomConversationSummarizationActionContent("my_project", "my_deployment", new SummaryAspect[]{SummaryAspect.Narrative}), +Name = "Custom Conversation Summarization Task 1", } }) { - DisplayName = "", + DisplayName = "Custom Conversation Summarization Example", }; Operation operation = await client.AnalyzeConversationSubmitOperationAsync(WaitUntil.Completed, analyzeConversationOperationInput); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Conversations_CancelAnalyzeConversations_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - - Operation operation = client.CancelAnalyzeConversations(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_CancelAnalyzeConversations_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - - Operation operation = await client.CancelAnalyzeConversationsAsync(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Conversations_CancelAnalyzeConversations_AllParameters() + public void Example_Conversations_CancelAnalyzeConversations_SuccessfulAnalyzeConversationsJobsCancelRequest() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Operation operation = client.CancelAnalyzeConversations(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + Operation operation = client.CancelAnalyzeConversations(WaitUntil.Completed, Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Conversations_CancelAnalyzeConversations_AllParameters_Async() + public async Task Example_Conversations_CancelAnalyzeConversations_SuccessfulAnalyzeConversationsJobsCancelRequest_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); - Operation operation = await client.CancelAnalyzeConversationsAsync(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + Operation operation = await client.CancelAnalyzeConversationsAsync(WaitUntil.Completed, Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); } } } diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/Docs/TextAnalysisClient.xml b/sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/Docs/TextAnalysisClient.xml index 349d5134b2e0b..cbd007ade805e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/Docs/TextAnalysisClient.xml +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text/src/Generated/Docs/TextAnalysisClient.xml @@ -1785,49 +1785,219 @@ Console.WriteLine(result.GetProperty("kind").ToString()); This sample shows how to call AnalyzeTextOperationStatusAsync. "); +Uri endpoint = new Uri(""); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0")); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("29fe5bb0-83ae-4f86-85d6-775534dcd2d4")); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync. +"); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("15e4a46b-62e2-4386-8d36-9c2a92bb45dd")); ]]> -This sample shows how to call AnalyzeTextOperationStatusAsync with all parameters. +This sample shows how to call AnalyzeTextOperationStatusAsync. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStats: true, top: 1234, skip: 1234); +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0")); ]]> This sample shows how to call AnalyzeTextOperationStatus. "); +Uri endpoint = new Uri(""); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call AnalyzeTextOperationStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call AnalyzeTextOperationStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); +]]> +This sample shows how to call AnalyzeTextOperationStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0")); +]]> +This sample shows how to call AnalyzeTextOperationStatus. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("29fe5bb0-83ae-4f86-85d6-775534dcd2d4")); +]]> +This sample shows how to call AnalyzeTextOperationStatus. +"); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("15e4a46b-62e2-4386-8d36-9c2a92bb45dd")); ]]> -This sample shows how to call AnalyzeTextOperationStatus with all parameters. +This sample shows how to call AnalyzeTextOperationStatus. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStats: true, top: 1234, skip: 1234); +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0")); ]]> This sample shows how to call AnalyzeTextOperationStatusAsync and parse the result. "); +Uri endpoint = new Uri(""); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("29fe5bb0-83ae-4f86-85d6-775534dcd2d4"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatusAsync and parse the result. +"); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null, null, null); +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("15e4a46b-62e2-4386-8d36-9c2a92bb45dd"), null, null, null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("createdDateTime").ToString()); @@ -1839,59 +2009,124 @@ Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); ]]> -This sample shows how to call AnalyzeTextOperationStatusAsync with all parameters and parse the result. +This sample shows how to call AnalyzeTextOperationStatusAsync and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, 1234, 1234, null); +Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0"), null, null, null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("displayName").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("jobId").ToString()); Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); Console.WriteLine(result.GetProperty("status").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("nextLink").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString()); ]]> This sample shows how to call AnalyzeTextOperationStatus and parse the result. "); +Uri endpoint = new Uri(""); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatus and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("29fe5bb0-83ae-4f86-85d6-775534dcd2d4"), null, null, null, null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("createdDateTime").ToString()); +Console.WriteLine(result.GetProperty("jobId").ToString()); +Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); +Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); +]]> +This sample shows how to call AnalyzeTextOperationStatus and parse the result. +"); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null, null, null); +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("15e4a46b-62e2-4386-8d36-9c2a92bb45dd"), null, null, null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("createdDateTime").ToString()); @@ -1903,171 +2138,820 @@ Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); ]]> -This sample shows how to call AnalyzeTextOperationStatus with all parameters and parse the result. +This sample shows how to call AnalyzeTextOperationStatus and parse the result. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, 1234, 1234, null); +Response response = client.AnalyzeTextOperationStatus(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0"), null, null, null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; -Console.WriteLine(result.GetProperty("displayName").ToString()); Console.WriteLine(result.GetProperty("createdDateTime").ToString()); -Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); Console.WriteLine(result.GetProperty("jobId").ToString()); Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); Console.WriteLine(result.GetProperty("status").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("nextLink").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString()); -Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString()); -Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString()); ]]> This sample shows how to call AnalyzeTextSubmitOperationAsync. "); +Uri endpoint = new Uri(""); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.") + { + Language = "en", + }}, +}; +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new AbstractiveSummarizationOperationAction + { + ActionContent = new AbstractiveSummarizationActionContent + { + SentenceCount = 1, + }, + Name = "Document Abstractive Summarization Task 1", + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "I had a wonderful trip to Seattle last week.") + { + Language = "en", + }, new MultiLanguageInput("2", "I'm flying to NYC tomorrow. See you there.") + { + Language = "en", + }}, +}; +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new EntitiesOperationAction + { + ActionContent = new EntitiesActionContent + { + ModelVersion = "latest", + }, + Name = "Recognize Entities", + }, + new CustomEntitiesOperationAction + { + ActionContent = new CustomEntitiesActionContent("MyProject", "MyDeployment"), + Name = "Recognize US Regions", + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.") + { + Language = "en", + }}, +}; +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new CustomAbstractiveSummarizationOperationAction(new CustomAbstractiveSummarizationActionContent("my_project", "my_deployment")) + { + Name = "Custom Document Abstractive Summarization Task 1", + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") + { + Language = "en", + }}, +}; +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new CustomHealthcareOperationAction + { + ActionContent = new CustomHealthcareActionContent("{PROJECT-NAME}", "{DEPLOYMENT-NAME}"), + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "The food is great. But the service is bad.") + { + Language = "en", + }}, +}; +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new CustomSentimentAnalysisOperationAction + { + ActionContent = new CustomSentimentAnalysisActionContent("{PROJECT-NAME}", "{DEPLOYMENT-NAME}"), + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") + { + Language = "en", + }}, +}; +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new HealthcareOperationAction + { + ActionContent = new HealthcareActionContent + { + ModelVersion = "latest", + FhirVersion = FhirVersion._401, + DocumentType = HealthcareDocumentType.DischargeSummary, + }, + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") + { + Language = "en", + }}, +}; +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new HealthcareOperationAction + { + ActionContent = new HealthcareActionContent + { + ModelVersion = "latest", + }, + } +}); +]]> + + + +This sample shows how to call AnalyzeTextSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.") + { + Language = "en", + }}, +}; +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new AbstractiveSummarizationOperationAction + { + ActionContent = new AbstractiveSummarizationActionContent + { + SentenceCount = 1, + }, + Name = "Document Abstractive Summarization Task 1", + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "I had a wonderful trip to Seattle last week.") + { + Language = "en", + }, new MultiLanguageInput("2", "I'm flying to NYC tomorrow. See you there.") + { + Language = "en", + }}, +}; +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new EntitiesOperationAction + { + ActionContent = new EntitiesActionContent + { + ModelVersion = "latest", + }, + Name = "Recognize Entities", + }, + new CustomEntitiesOperationAction + { + ActionContent = new CustomEntitiesActionContent("MyProject", "MyDeployment"), + Name = "Recognize US Regions", + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.") + { + Language = "en", + }}, +}; +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new CustomAbstractiveSummarizationOperationAction(new CustomAbstractiveSummarizationActionContent("my_project", "my_deployment")) + { + Name = "Custom Document Abstractive Summarization Task 1", + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") + { + Language = "en", + }}, +}; +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new CustomHealthcareOperationAction + { + ActionContent = new CustomHealthcareActionContent("{PROJECT-NAME}", "{DEPLOYMENT-NAME}"), + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "The food is great. But the service is bad.") + { + Language = "en", + }}, +}; +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new CustomSentimentAnalysisOperationAction + { + ActionContent = new CustomSentimentAnalysisActionContent("{PROJECT-NAME}", "{DEPLOYMENT-NAME}"), + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") + { + Language = "en", + }}, +}; +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new HealthcareOperationAction + { + ActionContent = new HealthcareActionContent + { + ModelVersion = "latest", + FhirVersion = FhirVersion._401, + DocumentType = HealthcareDocumentType.DischargeSummary, + }, + } +}); +]]> +This sample shows how to call AnalyzeTextSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +MultiLanguageTextInput textInput = new MultiLanguageTextInput +{ + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") + { + Language = "en", + }}, +}; +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +{ + new HealthcareOperationAction + { + ActionContent = new HealthcareActionContent + { + ModelVersion = "latest", + }, + } +}); +]]> + + + +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Document Abstractive Summarization Task Example", + analysisInput = new + { + documents = new object[] + { + new + { + id = "1", + language = "en", + text = "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.", + } + }, + }, + tasks = new object[] + { + new + { + kind = "AbstractiveSummarization", + taskName = "Document Abstractive Summarization Task 1", + parameters = new + { + sentenceCount = 1, + }, + } + }, +}); +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Extracting Location & US Region", + analysisInput = new + { + documents = new object[] + { + new + { + id = "1", + language = "en", + text = "I had a wonderful trip to Seattle last week.", + }, + new + { + id = "2", + language = "en", + text = "I'm flying to NYC tomorrow. See you there.", + } + }, + }, + tasks = new object[] + { + new + { + kind = "EntityRecognition", + taskName = "Recognize Entities", + parameters = new + { + modelVersion = "latest", + }, + }, + new + { + kind = "CustomEntityRecognition", + taskName = "Recognize US Regions", + parameters = new + { + projectName = "MyProject", + deploymentName = "MyDeployment", + }, + } + }, +}); +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Document Custom Abstractive Summarization Task Example", + analysisInput = new + { + documents = new object[] + { + new + { + id = "1", + language = "en", + text = "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.", + } + }, + }, + tasks = new object[] + { + new + { + kind = "CustomAbstractiveSummarization", + taskName = "Custom Document Abstractive Summarization Task 1", + parameters = new + { + projectName = "my_project", + deploymentName = "my_deployment", + }, + } + }, +}); +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new +{ + analysisInput = new + { + documents = new object[] + { + new + { + text = "Prescribed 100mg ibuprofen, taken twice daily.", + id = "1", + language = "en", + } + }, + }, + tasks = new object[] + { + new + { + kind = "CustomHealthcare", + parameters = new + { + projectName = "{PROJECT-NAME}", + deploymentName = "{DEPLOYMENT-NAME}", + }, + } + }, +}); +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -MultiLanguageTextInput textInput = new MultiLanguageTextInput(); -Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +using RequestContent content = RequestContent.Create(new { - new CustomEntitiesOperationAction() + analysisInput = new + { + documents = new object[] + { + new + { + text = "The food is great. But the service is bad.", + id = "1", + language = "en", + } + }, + }, + tasks = new object[] + { + new + { + kind = "CustomSentimentAnalysis", + parameters = new + { + projectName = "{PROJECT-NAME}", + deploymentName = "{DEPLOYMENT-NAME}", + }, + } + }, }); +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); ]]> -This sample shows how to call AnalyzeTextSubmitOperationAsync with all parameters. +This sample shows how to call AnalyzeTextSubmitOperationAsync. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -MultiLanguageTextInput textInput = new MultiLanguageTextInput +using RequestContent content = RequestContent.Create(new { - MultiLanguageInputs = {new MultiLanguageInput("", "") + analysisInput = new { - Language = "", - }}, -}; -Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + documents = new object[] + { + new + { + text = "Prescribed 100mg ibuprofen, taken twice daily.", + id = "1", + language = "en", + } + }, + }, + tasks = new object[] + { + new + { + kind = "Healthcare", + parameters = new + { + modelVersion = "latest", + fhirVersion = "4.0.1", + documentType = "DischargeSummary", + }, + } + }, +}); +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeTextSubmitOperationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new { - new CustomEntitiesOperationAction + analysisInput = new { - ActionContent = new CustomEntitiesActionContent("", "") + documents = new object[] { - LoggingOptOut = true, - StringIndexType = StringIndexType.TextElementsV8, + new + { + text = "Prescribed 100mg ibuprofen, taken twice daily.", + id = "1", + language = "en", + } }, - Name = "", - } -}, displayName: "", defaultLanguage: ""); + }, + tasks = new object[] + { + new + { + kind = "Healthcare", + parameters = new + { + modelVersion = "latest", + }, + } + }, +}); +Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); ]]> - + This sample shows how to call AnalyzeTextSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -MultiLanguageTextInput textInput = new MultiLanguageTextInput(); -Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] +using RequestContent content = RequestContent.Create(new { - new CustomEntitiesOperationAction() + displayName = "Document Abstractive Summarization Task Example", + analysisInput = new + { + documents = new object[] + { + new + { + id = "1", + language = "en", + text = "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.", + } + }, + }, + tasks = new object[] + { + new + { + kind = "AbstractiveSummarization", + taskName = "Document Abstractive Summarization Task 1", + parameters = new + { + sentenceCount = 1, + }, + } + }, }); +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); ]]> -This sample shows how to call AnalyzeTextSubmitOperation with all parameters. +This sample shows how to call AnalyzeTextSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -MultiLanguageTextInput textInput = new MultiLanguageTextInput +using RequestContent content = RequestContent.Create(new { - MultiLanguageInputs = {new MultiLanguageInput("", "") + displayName = "Extracting Location & US Region", + analysisInput = new { - Language = "", - }}, -}; -Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + documents = new object[] + { + new + { + id = "1", + language = "en", + text = "I had a wonderful trip to Seattle last week.", + }, + new + { + id = "2", + language = "en", + text = "I'm flying to NYC tomorrow. See you there.", + } + }, + }, + tasks = new object[] + { + new + { + kind = "EntityRecognition", + taskName = "Recognize Entities", + parameters = new + { + modelVersion = "latest", + }, + }, + new + { + kind = "CustomEntityRecognition", + taskName = "Recognize US Regions", + parameters = new + { + projectName = "MyProject", + deploymentName = "MyDeployment", + }, + } + }, +}); +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeTextSubmitOperation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + +using RequestContent content = RequestContent.Create(new { - new CustomEntitiesOperationAction + displayName = "Document Custom Abstractive Summarization Task Example", + analysisInput = new { - ActionContent = new CustomEntitiesActionContent("", "") + documents = new object[] { - LoggingOptOut = true, - StringIndexType = StringIndexType.TextElementsV8, + new + { + id = "1", + language = "en", + text = "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.", + } }, - Name = "", - } -}, displayName: "", defaultLanguage: ""); -]]> - - - -This sample shows how to call AnalyzeTextSubmitOperationAsync. + }, + tasks = new object[] + { + new + { + kind = "CustomAbstractiveSummarization", + taskName = "Custom Document Abstractive Summarization Task 1", + parameters = new + { + projectName = "my_project", + deploymentName = "my_deployment", + }, + } + }, +}); +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); +]]> +This sample shows how to call AnalyzeTextSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - analysisInput = new object(), + analysisInput = new + { + documents = new object[] + { + new + { + text = "Prescribed 100mg ibuprofen, taken twice daily.", + id = "1", + language = "en", + } + }, + }, tasks = new object[] { new { - kind = "CustomEntityRecognition", + kind = "CustomHealthcare", + parameters = new + { + projectName = "{PROJECT-NAME}", + deploymentName = "{DEPLOYMENT-NAME}", + }, } }, }); -Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); ]]> -This sample shows how to call AnalyzeTextSubmitOperationAsync with all parameters and request content. +This sample shows how to call AnalyzeTextSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - displayName = "", analysisInput = new { documents = new object[] { new { - id = "", - text = "", - language = "", + text = "The food is great. But the service is bad.", + id = "1", + language = "en", } }, }, @@ -2075,61 +2959,70 @@ using RequestContent content = RequestContent.Create(new { new { - kind = "CustomEntityRecognition", + kind = "CustomSentimentAnalysis", parameters = new { - loggingOptOut = true, - projectName = "", - deploymentName = "", - stringIndexType = "TextElements_v8", + projectName = "{PROJECT-NAME}", + deploymentName = "{DEPLOYMENT-NAME}", }, - taskName = "", } }, - defaultLanguage = "", }); -Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); -]]> - - - +Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); +]]> This sample shows how to call AnalyzeTextSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - analysisInput = new object(), + analysisInput = new + { + documents = new object[] + { + new + { + text = "Prescribed 100mg ibuprofen, taken twice daily.", + id = "1", + language = "en", + } + }, + }, tasks = new object[] { new { - kind = "CustomEntityRecognition", + kind = "Healthcare", + parameters = new + { + modelVersion = "latest", + fhirVersion = "4.0.1", + documentType = "DischargeSummary", + }, } }, }); Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); ]]> -This sample shows how to call AnalyzeTextSubmitOperation with all parameters and request content. +This sample shows how to call AnalyzeTextSubmitOperation. "); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - displayName = "", analysisInput = new { documents = new object[] { new { - id = "", - text = "", - language = "", + text = "Prescribed 100mg ibuprofen, taken twice daily.", + id = "1", + language = "en", } }, }, @@ -2137,18 +3030,13 @@ using RequestContent content = RequestContent.Create(new { new { - kind = "CustomEntityRecognition", + kind = "Healthcare", parameters = new { - loggingOptOut = true, - projectName = "", - deploymentName = "", - stringIndexType = "TextElements_v8", + modelVersion = "latest", }, - taskName = "", } }, - defaultLanguage = "", }); Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); ]]> @@ -2157,38 +3045,22 @@ Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, con This sample shows how to call AnalyzeTextCancelOperationAsync. "); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - -Operation operation = await client.AnalyzeTextCancelOperationAsync(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -]]> -This sample shows how to call AnalyzeTextCancelOperationAsync with all parameters. -"); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Operation operation = await client.AnalyzeTextCancelOperationAsync(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +Operation operation = await client.AnalyzeTextCancelOperationAsync(WaitUntil.Completed, Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); ]]> This sample shows how to call AnalyzeTextCancelOperation. "); -AzureKeyCredential credential = new AzureKeyCredential(""); -TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - -Operation operation = client.AnalyzeTextCancelOperation(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); -]]> -This sample shows how to call AnalyzeTextCancelOperation with all parameters. -"); +Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); -Operation operation = client.AnalyzeTextCancelOperation(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); +Operation operation = client.AnalyzeTextCancelOperation(WaitUntil.Completed, Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); ]]> diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Text/tests/Generated/Samples/Samples_TextAnalysisClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Text/tests/Generated/Samples/Samples_TextAnalysisClient.cs index 93838dc84445a..710acbfa64e12 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Text/tests/Generated/Samples/Samples_TextAnalysisClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Text/tests/Generated/Samples/Samples_TextAnalysisClient.cs @@ -1942,13 +1942,290 @@ public async Task Example_Text_AnalyzeText_SuccessfulSentimentAnalysisRequest_Co [Test] [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_ShortVersion() + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulAbstractiveSummarizationTaskResult() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulAbstractiveSummarizationTaskResult_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulAbstractiveSummarizationTaskResult_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulAbstractiveSummarizationTaskResult_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulAnalyzeTextJobsMultipleTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulAnalyzeTextJobsMultipleTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulAnalyzeTextJobsMultipleTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulAnalyzeTextJobsMultipleTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomAbstractiveSummarizationTaskResult() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomAbstractiveSummarizationTaskResult_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomAbstractiveSummarizationTaskResult_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomAbstractiveSummarizationTaskResult_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomHealthcareTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomHealthcareTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomHealthcareTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomHealthcareTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomSentimentAnalysisTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("29fe5bb0-83ae-4f86-85d6-775534dcd2d4"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomSentimentAnalysisTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null, null, null); + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("29fe5bb0-83ae-4f86-85d6-775534dcd2d4"), null, null, null, null); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; Console.WriteLine(result.GetProperty("createdDateTime").ToString()); @@ -1963,177 +2240,879 @@ public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_ShortVersion( [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_ShortVersion_Async() + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomSentimentAnalysisTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("29fe5bb0-83ae-4f86-85d6-775534dcd2d4")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulCustomSentimentAnalysisTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("29fe5bb0-83ae-4f86-85d6-775534dcd2d4")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulHealthcareDocumentTypeTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("15e4a46b-62e2-4386-8d36-9c2a92bb45dd"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulHealthcareDocumentTypeTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("15e4a46b-62e2-4386-8d36-9c2a92bb45dd"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulHealthcareDocumentTypeTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("15e4a46b-62e2-4386-8d36-9c2a92bb45dd")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulHealthcareDocumentTypeTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("15e4a46b-62e2-4386-8d36-9c2a92bb45dd")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulHealthcareTaskStatusRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulHealthcareTaskStatusRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0"), null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("createdDateTime").ToString()); + Console.WriteLine(result.GetProperty("jobId").ToString()); + Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); + Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulHealthcareTaskStatusRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = client.AnalyzeTextOperationStatus(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_SuccessfulHealthcareTaskStatusRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("1780194a-e9c1-4298-b0d4-fdc59ba818a0")); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulAbstractiveSummarizationTaskSubmit() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Document Abstractive Summarization Task Example", + analysisInput = new + { + documents = new object[] + { +new +{ +id = "1", +language = "en", +text = "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "AbstractiveSummarization", +taskName = "Document Abstractive Summarization Task 1", +parameters = new +{ +sentenceCount = 1, +}, +} + }, + }); + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulAbstractiveSummarizationTaskSubmit_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Document Abstractive Summarization Task Example", + analysisInput = new + { + documents = new object[] + { +new +{ +id = "1", +language = "en", +text = "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "AbstractiveSummarization", +taskName = "Document Abstractive Summarization Task 1", +parameters = new +{ +sentenceCount = 1, +}, +} + }, + }); + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulAbstractiveSummarizationTaskSubmit_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.") +{ +Language = "en", +}}, + }; + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new AbstractiveSummarizationOperationAction +{ +ActionContent = new AbstractiveSummarizationActionContent +{ +SentenceCount = 1, +}, +Name = "Document Abstractive Summarization Task 1", +} + }); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulAbstractiveSummarizationTaskSubmit_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.") +{ +Language = "en", +}}, + }; + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new AbstractiveSummarizationOperationAction +{ +ActionContent = new AbstractiveSummarizationActionContent +{ +SentenceCount = 1, +}, +Name = "Document Abstractive Summarization Task 1", +} + }); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulAnalyzeTextJobsMultipleTaskSubmitRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Extracting Location & US Region", + analysisInput = new + { + documents = new object[] + { +new +{ +id = "1", +language = "en", +text = "I had a wonderful trip to Seattle last week.", +}, +new +{ +id = "2", +language = "en", +text = "I'm flying to NYC tomorrow. See you there.", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "EntityRecognition", +taskName = "Recognize Entities", +parameters = new +{ +modelVersion = "latest", +}, +}, +new +{ +kind = "CustomEntityRecognition", +taskName = "Recognize US Regions", +parameters = new +{ +projectName = "MyProject", +deploymentName = "MyDeployment", +}, +} + }, + }); + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulAnalyzeTextJobsMultipleTaskSubmitRequest_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Extracting Location & US Region", + analysisInput = new + { + documents = new object[] + { +new +{ +id = "1", +language = "en", +text = "I had a wonderful trip to Seattle last week.", +}, +new +{ +id = "2", +language = "en", +text = "I'm flying to NYC tomorrow. See you there.", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "EntityRecognition", +taskName = "Recognize Entities", +parameters = new +{ +modelVersion = "latest", +}, +}, +new +{ +kind = "CustomEntityRecognition", +taskName = "Recognize US Regions", +parameters = new +{ +projectName = "MyProject", +deploymentName = "MyDeployment", +}, +} + }, + }); + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulAnalyzeTextJobsMultipleTaskSubmitRequest_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "I had a wonderful trip to Seattle last week.") +{ +Language = "en", +}, new MultiLanguageInput("2", "I'm flying to NYC tomorrow. See you there.") +{ +Language = "en", +}}, + }; + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new EntitiesOperationAction +{ +ActionContent = new EntitiesActionContent +{ +ModelVersion = "latest", +}, +Name = "Recognize Entities", +}, +new CustomEntitiesOperationAction +{ +ActionContent = new CustomEntitiesActionContent("MyProject", "MyDeployment"), +Name = "Recognize US Regions", +} + }); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulAnalyzeTextJobsMultipleTaskSubmitRequest_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "I had a wonderful trip to Seattle last week.") +{ +Language = "en", +}, new MultiLanguageInput("2", "I'm flying to NYC tomorrow. See you there.") +{ +Language = "en", +}}, + }; + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new EntitiesOperationAction +{ +ActionContent = new EntitiesActionContent +{ +ModelVersion = "latest", +}, +Name = "Recognize Entities", +}, +new CustomEntitiesOperationAction +{ +ActionContent = new CustomEntitiesActionContent("MyProject", "MyDeployment"), +Name = "Recognize US Regions", +} + }); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomAbstractiveSummarizationTaskSubmit() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Document Custom Abstractive Summarization Task Example", + analysisInput = new + { + documents = new object[] + { +new +{ +id = "1", +language = "en", +text = "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "CustomAbstractiveSummarization", +taskName = "Custom Document Abstractive Summarization Task 1", +parameters = new +{ +projectName = "my_project", +deploymentName = "my_deployment", +}, +} + }, + }); + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomAbstractiveSummarizationTaskSubmit_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Document Custom Abstractive Summarization Task Example", + analysisInput = new + { + documents = new object[] + { +new +{ +id = "1", +language = "en", +text = "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "CustomAbstractiveSummarization", +taskName = "Custom Document Abstractive Summarization Task 1", +parameters = new +{ +projectName = "my_project", +deploymentName = "my_deployment", +}, +} + }, + }); + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomAbstractiveSummarizationTaskSubmit_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.") +{ +Language = "en", +}}, + }; + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new CustomAbstractiveSummarizationOperationAction(new CustomAbstractiveSummarizationActionContent("my_project", "my_deployment")) +{ +Name = "Custom Document Abstractive Summarization Task 1", +} + }); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomAbstractiveSummarizationTaskSubmit_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI Cognitive Services, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there is magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pre-trained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks.") +{ +Language = "en", +}}, + }; + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new CustomAbstractiveSummarizationOperationAction(new CustomAbstractiveSummarizationActionContent("my_project", "my_deployment")) +{ +Name = "Custom Document Abstractive Summarization Task 1", +} + }); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomHealthcarePostRequest() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); + + using RequestContent content = RequestContent.Create(new + { + analysisInput = new + { + documents = new object[] + { +new +{ +text = "Prescribed 100mg ibuprofen, taken twice daily.", +id = "1", +language = "en", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "CustomHealthcare", +parameters = new +{ +projectName = "{PROJECT-NAME}", +deploymentName = "{DEPLOYMENT-NAME}", +}, +} + }, + }); + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomHealthcarePostRequest_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), null, null, null, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); + using RequestContent content = RequestContent.Create(new + { + analysisInput = new + { + documents = new object[] + { +new +{ +text = "Prescribed 100mg ibuprofen, taken twice daily.", +id = "1", +language = "en", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "CustomHealthcare", +parameters = new +{ +projectName = "{PROJECT-NAME}", +deploymentName = "{DEPLOYMENT-NAME}", +}, +} + }, + }); + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_ShortVersion_Convenience() + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomHealthcarePostRequest_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") +{ +Language = "en", +}}, + }; + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new CustomHealthcareOperationAction +{ +ActionContent = new CustomHealthcareActionContent("{PROJECT-NAME}", "{DEPLOYMENT-NAME}"), +} + }); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_ShortVersion_Convenience_Async() + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomHealthcarePostRequest_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") +{ +Language = "en", +}}, + }; + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new CustomHealthcareOperationAction +{ +ActionContent = new CustomHealthcareActionContent("{PROJECT-NAME}", "{DEPLOYMENT-NAME}"), +} + }); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_AllParameters() + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomSentimentAnalysisTaskSubmit() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, 1234, 1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").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("nextLink").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString()); + using RequestContent content = RequestContent.Create(new + { + analysisInput = new + { + documents = new object[] + { +new +{ +text = "The food is great. But the service is bad.", +id = "1", +language = "en", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "CustomSentimentAnalysis", +parameters = new +{ +projectName = "{PROJECT-NAME}", +deploymentName = "{DEPLOYMENT-NAME}", +}, +} + }, + }); + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_AllParameters_Async() + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomSentimentAnalysisTaskSubmit_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), true, 1234, 1234, null); - - JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; - Console.WriteLine(result.GetProperty("displayName").ToString()); - Console.WriteLine(result.GetProperty("createdDateTime").ToString()); - Console.WriteLine(result.GetProperty("expirationDateTime").ToString()); - Console.WriteLine(result.GetProperty("jobId").ToString()); - Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString()); - Console.WriteLine(result.GetProperty("status").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("nextLink").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("completed").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("failed").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("inProgress").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("total").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("lastUpdateDateTime").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("status").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("taskName").ToString()); - Console.WriteLine(result.GetProperty("tasks").GetProperty("items")[0].GetProperty("kind").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("documentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("validDocumentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("erroneousDocumentsCount").ToString()); - Console.WriteLine(result.GetProperty("statistics").GetProperty("transactionsCount").ToString()); + using RequestContent content = RequestContent.Create(new + { + analysisInput = new + { + documents = new object[] + { +new +{ +text = "The food is great. But the service is bad.", +id = "1", +language = "en", +} + }, + }, + tasks = new object[] + { +new +{ +kind = "CustomSentimentAnalysis", +parameters = new +{ +projectName = "{PROJECT-NAME}", +deploymentName = "{DEPLOYMENT-NAME}", +}, +} + }, + }); + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_AllParameters_Convenience() + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomSentimentAnalysisTaskSubmit_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Response response = client.AnalyzeTextOperationStatus(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStats: true, top: 1234, skip: 1234); + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "The food is great. But the service is bad.") +{ +Language = "en", +}}, + }; + Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new CustomSentimentAnalysisOperationAction +{ +ActionContent = new CustomSentimentAnalysisActionContent("{PROJECT-NAME}", "{DEPLOYMENT-NAME}"), +} + }); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_AnalyzeTextJobState_AnalyzeTextOperationStatus_AllParameters_Convenience_Async() + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulCustomSentimentAnalysisTaskSubmit_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Response response = await client.AnalyzeTextOperationStatusAsync(Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a"), showStats: true, top: 1234, skip: 1234); + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "The food is great. But the service is bad.") +{ +Language = "en", +}}, + }; + Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] + { +new CustomSentimentAnalysisOperationAction +{ +ActionContent = new CustomSentimentAnalysisActionContent("{PROJECT-NAME}", "{DEPLOYMENT-NAME}"), +} + }); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Text_AnalyzeTextSubmitOperation_ShortVersion() + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulHealthcareDocumentTypePostRequest() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - analysisInput = new object(), + analysisInput = new + { + documents = new object[] + { +new +{ +text = "Prescribed 100mg ibuprofen, taken twice daily.", +id = "1", +language = "en", +} + }, + }, tasks = new object[] { new { -kind = "CustomEntityRecognition", +kind = "Healthcare", +parameters = new +{ +modelVersion = "latest", +fhirVersion = "4.0.1", +documentType = "DischargeSummary", +}, } }, }); @@ -2142,20 +3121,37 @@ public void Example_Text_AnalyzeTextSubmitOperation_ShortVersion() [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Text_AnalyzeTextSubmitOperation_ShortVersion_Async() + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulHealthcareDocumentTypePostRequest_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - analysisInput = new object(), + analysisInput = new + { + documents = new object[] + { +new +{ +text = "Prescribed 100mg ibuprofen, taken twice daily.", +id = "1", +language = "en", +} + }, + }, tasks = new object[] { new { -kind = "CustomEntityRecognition", +kind = "Healthcare", +parameters = new +{ +modelVersion = "latest", +fhirVersion = "4.0.1", +documentType = "DischargeSummary", +}, } }, }); @@ -2164,54 +3160,81 @@ public async Task Example_Text_AnalyzeTextSubmitOperation_ShortVersion_Async() [Test] [Ignore("Only validating compilation of examples")] - public void Example_Text_AnalyzeTextSubmitOperation_ShortVersion_Convenience() + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulHealthcareDocumentTypePostRequest_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - MultiLanguageTextInput textInput = new MultiLanguageTextInput(); + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") +{ +Language = "en", +}}, + }; Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] { -new CustomEntitiesOperationAction() +new HealthcareOperationAction +{ +ActionContent = new HealthcareActionContent +{ +ModelVersion = "latest", +FhirVersion = FhirVersion._401, +DocumentType = HealthcareDocumentType.DischargeSummary, +}, +} }); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Text_AnalyzeTextSubmitOperation_ShortVersion_Convenience_Async() + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulHealthcareDocumentTypePostRequest_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - MultiLanguageTextInput textInput = new MultiLanguageTextInput(); + MultiLanguageTextInput textInput = new MultiLanguageTextInput + { + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") +{ +Language = "en", +}}, + }; Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] { -new CustomEntitiesOperationAction() +new HealthcareOperationAction +{ +ActionContent = new HealthcareActionContent +{ +ModelVersion = "latest", +FhirVersion = FhirVersion._401, +DocumentType = HealthcareDocumentType.DischargeSummary, +}, +} }); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Text_AnalyzeTextSubmitOperation_AllParameters() + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulHealthcarePostRequest() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - displayName = "", analysisInput = new { documents = new object[] { new { -id = "", -text = "", -language = "", +text = "Prescribed 100mg ibuprofen, taken twice daily.", +id = "1", +language = "en", } }, }, @@ -2219,42 +3242,36 @@ public void Example_Text_AnalyzeTextSubmitOperation_AllParameters() { new { -kind = "CustomEntityRecognition", +kind = "Healthcare", parameters = new { -loggingOptOut = true, -projectName = "", -deploymentName = "", -stringIndexType = "TextElements_v8", +modelVersion = "latest", }, -taskName = "", } }, - defaultLanguage = "", }); Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, content); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Text_AnalyzeTextSubmitOperation_AllParameters_Async() + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulHealthcarePostRequest_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); using RequestContent content = RequestContent.Create(new { - displayName = "", analysisInput = new { documents = new object[] { new { -id = "", -text = "", -language = "", +text = "Prescribed 100mg ibuprofen, taken twice daily.", +id = "1", +language = "en", } }, }, @@ -2262,122 +3279,91 @@ public async Task Example_Text_AnalyzeTextSubmitOperation_AllParameters_Async() { new { -kind = "CustomEntityRecognition", +kind = "Healthcare", parameters = new { -loggingOptOut = true, -projectName = "", -deploymentName = "", -stringIndexType = "TextElements_v8", +modelVersion = "latest", }, -taskName = "", } }, - defaultLanguage = "", }); Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, content); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Text_AnalyzeTextSubmitOperation_AllParameters_Convenience() + public void Example_Text_AnalyzeTextSubmitOperation_SuccessfulHealthcarePostRequest_Convenience() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); MultiLanguageTextInput textInput = new MultiLanguageTextInput { - MultiLanguageInputs = {new MultiLanguageInput("", "") + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") { -Language = "", +Language = "en", }}, }; Operation operation = client.AnalyzeTextSubmitOperation(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] { -new CustomEntitiesOperationAction +new HealthcareOperationAction { -ActionContent = new CustomEntitiesActionContent("", "") +ActionContent = new HealthcareActionContent { -LoggingOptOut = true, -StringIndexType = StringIndexType.TextElementsV8, +ModelVersion = "latest", }, -Name = "", } - }, displayName: "", defaultLanguage: ""); + }); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Text_AnalyzeTextSubmitOperation_AllParameters_Convenience_Async() + public async Task Example_Text_AnalyzeTextSubmitOperation_SuccessfulHealthcarePostRequest_Convenience_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); MultiLanguageTextInput textInput = new MultiLanguageTextInput { - MultiLanguageInputs = {new MultiLanguageInput("", "") + MultiLanguageInputs = {new MultiLanguageInput("1", "Prescribed 100mg ibuprofen, taken twice daily.") { -Language = "", +Language = "en", }}, }; Operation operation = await client.AnalyzeTextSubmitOperationAsync(WaitUntil.Completed, textInput, new AnalyzeTextOperationAction[] { -new CustomEntitiesOperationAction +new HealthcareOperationAction { -ActionContent = new CustomEntitiesActionContent("", "") +ActionContent = new HealthcareActionContent { -LoggingOptOut = true, -StringIndexType = StringIndexType.TextElementsV8, +ModelVersion = "latest", }, -Name = "", } - }, displayName: "", defaultLanguage: ""); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public void Example_Text_AnalyzeTextCancelOperation_ShortVersion() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - - Operation operation = client.AnalyzeTextCancelOperation(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Example_Text_AnalyzeTextCancelOperation_ShortVersion_Async() - { - Uri endpoint = new Uri(""); - AzureKeyCredential credential = new AzureKeyCredential(""); - TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - - Operation operation = await client.AnalyzeTextCancelOperationAsync(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + }); } [Test] [Ignore("Only validating compilation of examples")] - public void Example_Text_AnalyzeTextCancelOperation_AllParameters() + public void Example_Text_AnalyzeTextCancelOperation_SuccessfulAnalyzeTextJobsCancelRequest() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Operation operation = client.AnalyzeTextCancelOperation(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + Operation operation = client.AnalyzeTextCancelOperation(WaitUntil.Completed, Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); } [Test] [Ignore("Only validating compilation of examples")] - public async Task Example_Text_AnalyzeTextCancelOperation_AllParameters_Async() + public async Task Example_Text_AnalyzeTextCancelOperation_SuccessfulAnalyzeTextJobsCancelRequest_Async() { - Uri endpoint = new Uri(""); + Uri endpoint = new Uri(""); AzureKeyCredential credential = new AzureKeyCredential(""); TextAnalysisClient client = new TextAnalysisClient(endpoint, credential); - Operation operation = await client.AnalyzeTextCancelOperationAsync(WaitUntil.Completed, Guid.Parse("73f411fe-4f43-4b4b-9cbd-6828d8f4cf9a")); + Operation operation = await client.AnalyzeTextCancelOperationAsync(WaitUntil.Completed, Guid.Parse("c0f2a446-05d9-48fc-ba8f-3ef4af8d0b18")); } } } From 2437d8570cb42f63d95858ec37f9a91707f42f32 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 25 Sep 2024 14:50:17 +0000 Subject: [PATCH 5/5] Update SDK codes ma_pu_4 --- .../Samples/Sample_MongoClusterResource.cs | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterResource.cs b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterResource.cs index 710fb1db676cb..923f56a029418 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterResource.cs +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/samples/Generated/Samples/Sample_MongoClusterResource.cs @@ -305,6 +305,68 @@ public async Task GetConnectionStrings_ListTheAvailableConnectionStringsForTheMo Console.WriteLine($"Succeeded: {result}"); } + // Checks and confirms the Mongo Cluster name is availability for use. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CheckMongoClusterNameAvailability_ChecksAndConfirmsTheMongoClusterNameIsAvailabilityForUse() + { + // Generated from example definition: 2024-07-01/MongoClusters_NameAvailability.json + // this example is just showing the usage of "MongoClusters_CheckMongoClusterNameAvailability" 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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("westus2"); + MongoClusterNameAvailabilityContent content = new MongoClusterNameAvailabilityContent() + { + Name = "newmongocluster", + ResourceType = "Microsoft.DocumentDB/mongoClusters", + }; + MongoClusterNameAvailabilityResult result = await subscriptionResource.CheckMongoClusterNameAvailabilityAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Checks and returns that the Mongo Cluster name is already in-use. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CheckMongoClusterNameAvailability_ChecksAndReturnsThatTheMongoClusterNameIsAlreadyInUse() + { + // Generated from example definition: 2024-07-01/MongoClusters_NameAvailability_AlreadyExists.json + // this example is just showing the usage of "MongoClusters_CheckMongoClusterNameAvailability" 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 SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "ffffffff-ffff-ffff-ffff-ffffffffffff"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("westus2"); + MongoClusterNameAvailabilityContent content = new MongoClusterNameAvailabilityContent() + { + Name = "existingmongocluster", + ResourceType = "Microsoft.DocumentDB/mongoClusters", + }; + MongoClusterNameAvailabilityResult result = await subscriptionResource.CheckMongoClusterNameAvailabilityAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + // Promotes a replica Mongo Cluster resource to a primary role. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")]