From e42525616cd1abd92b1230aacde87b7a4681dab2 Mon Sep 17 00:00:00 2001 From: Mariana Rios Flores Date: Tue, 20 Apr 2021 15:21:01 -0700 Subject: [PATCH 1/3] TA --- .../tests/samples/SampleSnippets.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/SampleSnippets.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/SampleSnippets.cs index d806342a047ec..690f66b666d81 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/SampleSnippets.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/samples/SampleSnippets.cs @@ -17,12 +17,14 @@ public partial class Snippets: SamplesBase [Test] public void CreateTextAnalyticsClient() { + #region Snippet:CreateTextAnalyticsClient +#if SNIPPET + string endpoint = ""; + string apiKey = ""; +#else string endpoint = TestEnvironment.Endpoint; string apiKey = TestEnvironment.ApiKey; - - #region Snippet:CreateTextAnalyticsClient - //@@ string endpoint = ""; - //@@ string apiKey = ""; +#endif var client = new TextAnalyticsClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #endregion } @@ -30,10 +32,12 @@ public void CreateTextAnalyticsClient() [Test] public void CreateTextAnalyticsClientTokenCredential() { - string endpoint = TestEnvironment.Endpoint; - #region Snippet:CreateTextAnalyticsClientTokenCredential - //@@ string endpoint = ""; +#if SNIPPET + string endpoint = ""; +#else + string endpoint = TestEnvironment.Endpoint; +#endif var client = new TextAnalyticsClient(new Uri(endpoint), new DefaultAzureCredential()); #endregion } From 3e1e132c40e314d1d2ae34e89c073ef0801fb49e Mon Sep 17 00:00:00 2001 From: Mariana Rios Flores Date: Tue, 20 Apr 2021 15:35:11 -0700 Subject: [PATCH 2/3] document translation --- .../tests/samples/SampleSnippets.cs | 47 +++++++++++-------- .../tests/samples/Sample_MultipleInputs.cs | 19 ++++---- .../samples/Sample_MultipleInputsAsync.cs | 20 ++++---- .../samples/Sample_PollIndividualDocuments.cs | 11 +++-- .../Sample_PollIndividualDocumentsAsync.cs | 11 +++-- .../tests/samples/Sample_StartTranslation.cs | 11 +++-- .../samples/Sample_StartTranslationAsync.cs | 11 +++-- 7 files changed, 72 insertions(+), 58 deletions(-) diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs index b884bd613773a..30a3d991fc0d7 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs @@ -18,12 +18,14 @@ public partial class SampleSnippets : SamplesBase()); - #region Snippet:BadRequest - - //@@ var invalidInput = new DocumentTranslationInput(new TranslationSource(sourceSasUri, new List()); +#if SNIPPET + var invalidInput = new DocumentTranslationInput(new TranslationSource(sourceSasUri, new List()); +#else + var invalidInput = new DocumentTranslationInput(new TranslationSource(new Uri(endpoint)), new List()); +#endif try { @@ -59,26 +62,30 @@ public void BadRequestSnippet() [Ignore("Samples not working yet")] public void DocumentTranslationInput() { + #region Snippet:DocumentTranslationSingleInput +#if SNIPPET + Uri sourceSasUri = ; + Uri frenchTargetSasUri = ; +#else Uri sourceSasUri = new Uri(""); Uri frenchTargetSasUri = new Uri(""); - Uri arabicTargetSasUri = new Uri(""); - Uri spanishTargetSasUri = new Uri(""); - - #region Snippet:DocumentTranslationSingleInput - //@@ Uri sourceSasUri = ; - //@@ Uri frenchTargetSasUri = ; +#endif var input = new DocumentTranslationInput(sourceSasUri, frenchTargetSasUri, "fr"); #endregion + #region Snippet:DocumentTranslationMultipleInputs +#if SNIPPET + Uri source1SasUri = ; + Uri source2SasUri = ; + Uri frenchTargetSasUri = ; + Uri spanishTargetSasUri = ; +#else + Uri arabicTargetSasUri = new Uri(""); + Uri spanishTargetSasUri = new Uri(""); Uri source1SasUri = new Uri(""); Uri source2SasUri = new Uri(""); - - #region Snippet:DocumentTranslationMultipleInputs - //@@ Uri source1SasUri = ; - //@@ Uri source2SasUri = ; - //@@ Uri frenchTargetSasUri = ; - //@@ Uri spanishTargetSasUri = ; +#endif var inputs = new List { diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs index dc7843dc92840..1d728ec789c5a 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs @@ -22,21 +22,22 @@ public void MultipleInputs() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); + #region Snippet:MultipleInputs +#if SNIPPET + Uri source1SasUriUri = ; + Uri source2SasUri = ; + Uri frenchTargetSasUri = ; + Uri arabicTargetSasUri = ; + Uri spanishTargetSasUri = ; + Uri frenchGlossarySasUri = ; +#else Uri source1SasUriUri = new Uri(""); Uri source2SasUri = new Uri(""); Uri frenchTargetSasUri = new Uri(""); Uri arabicTargetSasUri = new Uri(""); Uri spanishTargetSasUri = new Uri(""); Uri frenchGlossarySasUri = new Uri(""); - - #region Snippet:MultipleInputs - - //@@ Uri source1SasUriUri = ; - //@@ Uri source2SasUri = ; - //@@ Uri frenchTargetSasUri = ; - //@@ Uri arabicTargetSasUri = ; - //@@ Uri spanishTargetSasUri = ; - //@@ Uri frenchGlossarySasUri = ; +#endif var glossaryFormat = "TSV"; var input1 = new DocumentTranslationInput(source1SasUriUri, frenchTargetSasUri, "fr", new TranslationGlossary(frenchGlossarySasUri, glossaryFormat)); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs index a490ed07b653d..e58e0453a2c16 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs @@ -22,21 +22,23 @@ public async Task MultipleInputsAsync() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); + #region Snippet:MultipleInputsAsync + +#if SNIPPET + Uri source1SasUriUri = ; + Uri source2SasUri = ; + Uri frenchTargetSasUri = ; + Uri arabicTargetSasUri = ; + Uri spanishTargetSasUri = ; + Uri frenchGlossarySasUri = ; +#else Uri source1SasUriUri = new Uri(""); Uri source2SasUri = new Uri(""); Uri frenchTargetSasUri = new Uri(""); Uri arabicTargetSasUri = new Uri(""); Uri spanishTargetSasUri = new Uri(""); Uri frenchGlossarySasUri = new Uri(""); - - #region Snippet:MultipleInputsAsync - - //@@ Uri source1SasUriUri = ; - //@@ Uri source2SasUri = ; - //@@ Uri frenchTargetSasUri = ; - //@@ Uri arabicTargetSasUri = ; - //@@ Uri spanishTargetSasUri = ; - //@@ Uri frenchGlossarySasUri = ; +#endif var glossaryFormat = "TSV"; var input1 = new DocumentTranslationInput(source1SasUriUri, frenchTargetSasUri, "fr", new TranslationGlossary(frenchGlossarySasUri, glossaryFormat)); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs index 3e1632d6537ef..ac1456a3bc9f2 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs @@ -21,13 +21,14 @@ public void PollIndividualDocuments() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); + #region Snippet:PollIndividualDocuments +#if SNIPPET + Uri sourceUri = ; + Uri targetUri = ; +#else Uri sourceUri = new Uri(""); Uri targetUri = new Uri(""); - - #region Snippet:PollIndividualDocuments - - //@@ Uri sourceUri = ; - //@@ Uri targetUri = ; +#endif var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); DocumentTranslationOperation operation = client.StartTranslation(input); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs index 2c9b57082ca0d..fd38470c6d0fb 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs @@ -21,13 +21,14 @@ public async Task PollIndividualDocumentsAsync() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); + #region Snippet:PollIndividualDocumentsAsync +#if SNIPPET + Uri sourceUri = ; + Uri targetUri = ; +#else Uri sourceUri = new Uri(""); Uri targetUri = new Uri(""); - - #region Snippet:PollIndividualDocumentsAsync - - //@@ Uri sourceUri = ; - //@@ Uri targetUri = ; +#endif var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs index d702d0fe8937b..47a0d429af5df 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs @@ -21,13 +21,14 @@ public void StartTranslation() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); + #region Snippet:StartTranslation +#if SNIPPET + Uri sourceUri = ; + Uri targetUri = ; +#else Uri sourceUri = new Uri(""); Uri targetUri = new Uri(""); - - #region Snippet:StartTranslation - - //@@ Uri sourceUri = ; - //@@ Uri targetUri = ; +#endif var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs index 174f431df5671..5af3c1ead7b55 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs @@ -21,13 +21,14 @@ public async Task StartTranslationAsync() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); + #region Snippet:StartTranslationAsync +#if SNIPPET + Uri sourceUri = ; + Uri targetUri = ; +#else Uri sourceUri = new Uri(""); Uri targetUri = new Uri(""); - - #region Snippet:StartTranslationAsync - - //@@ Uri sourceUri = ; - //@@ Uri targetUri = ; +#endif var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); From 97fe8a321712cc611ce83e0c946d81b0983547e7 Mon Sep 17 00:00:00 2001 From: Mariana Rios Flores Date: Wed, 21 Apr 2021 14:50:21 -0700 Subject: [PATCH 3/3] pr feedback --- .../Azure.AI.Translation.Document/README.md | 37 ++++++++++--------- .../samples/Sample1_StartTranslation.md | 4 +- .../Sample2_PollIndividualDocuments.md | 4 +- .../samples/Sample4_MultipleInputs.md | 13 ++++--- .../tests/samples/SampleSnippets.cs | 22 +++-------- .../tests/samples/Sample_MultipleInputs.cs | 10 +---- .../samples/Sample_MultipleInputsAsync.cs | 11 +----- .../samples/Sample_PollIndividualDocuments.cs | 5 --- .../Sample_PollIndividualDocumentsAsync.cs | 5 --- .../tests/samples/Sample_StartTranslation.cs | 5 --- .../samples/Sample_StartTranslationAsync.cs | 5 --- 11 files changed, 37 insertions(+), 84 deletions(-) diff --git a/sdk/translation/Azure.AI.Translation.Document/README.md b/sdk/translation/Azure.AI.Translation.Document/README.md index 9c558b461bc66..de7b54dc67ae2 100644 --- a/sdk/translation/Azure.AI.Translation.Document/README.md +++ b/sdk/translation/Azure.AI.Translation.Document/README.md @@ -94,8 +94,8 @@ To start a translation operation you need to create one instance or a list of `D A single source URL to documents can be translated to many different languages: ```C# Snippet:DocumentTranslationSingleInput -Uri sourceSasUri = ; -Uri frenchTargetSasUri = ; +Uri sourceSasUri = new Uri(""); +Uri frenchTargetSasUri = new Uri(""); var input = new DocumentTranslationInput(sourceSasUri, frenchTargetSasUri, "fr"); ``` @@ -103,10 +103,10 @@ var input = new DocumentTranslationInput(sourceSasUri, frenchTargetSasUri, "fr") Or multiple different sources can be provided each with their own targets. ```C# Snippet:DocumentTranslationMultipleInputs -Uri source1SasUri = ; -Uri source2SasUri = ; -Uri frenchTargetSasUri = ; -Uri spanishTargetSasUri = ; +Uri arabicTargetSasUri = new Uri(""); +Uri spanishTargetSasUri = new Uri(""); +Uri source1SasUri = new Uri(""); +Uri source2SasUri = new Uri(""); var inputs = new List { @@ -116,7 +116,7 @@ var inputs = new List targets: new List { new TranslationTarget(frenchTargetSasUri, "fr"), - new TranslationTarget(spanishTargetSasUri, "es") + new TranslationTarget(arabicTargetSasUri, "ar") }), }; ``` @@ -160,8 +160,8 @@ Note: our `DocumentTranslationClient` provides both synchronous and asynchronous Start a translation operation to translate documents in the source container and write the translated files to the target container. `DocumentTranslationOperation` allows you to poll the status of the translation operation and get the status of the individual documents. ```C# Snippet:StartTranslationAsync -Uri sourceUri = ; -Uri targetUri = ; +Uri sourceUri = new Uri(""); +Uri targetUri = new Uri(""); var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); @@ -232,12 +232,13 @@ Console.WriteLine($"Cancelled Documents: {docsCancelled}"); Start a translation operation to translate documents in multiple source containers to multiple target containers in different languages. `DocumentTranslationOperation` allows you to poll the status of the translation operation and get the status of the individual documents. ```C# Snippet:MultipleInputsAsync -Uri source1SasUriUri = ; -Uri source2SasUri = ; -Uri frenchTargetSasUri = ; -Uri arabicTargetSasUri = ; -Uri spanishTargetSasUri = ; -Uri frenchGlossarySasUri = ; +Uri source1SasUriUri = new Uri(""); +Uri source2SasUri = new Uri(""); +Uri frenchTargetSasUri = new Uri(""); +Uri arabicTargetSasUri = new Uri(""); +Uri spanishTargetSasUri = new Uri(""); +Uri frenchGlossarySasUri = new Uri(""); + var glossaryFormat = "TSV"; var input1 = new DocumentTranslationInput(source1SasUriUri, frenchTargetSasUri, "fr", new TranslationGlossary(frenchGlossarySasUri, glossaryFormat)); @@ -279,8 +280,8 @@ await foreach (DocumentStatusResult document in operation.GetValuesAsync()) Start a translation operation to translate documents in the source container and write the translated files to the target container. `DocumentTranslationOperation` allows you to poll the status of the translation operation and get the status of the individual documents. ```C# Snippet:StartTranslation -Uri sourceUri = ; -Uri targetUri = ; +Uri sourceUri = new Uri(""); +Uri targetUri = new Uri(""); var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); @@ -342,7 +343,7 @@ When you interact with the Cognitive Services Document Translation client librar For example, if you submit a request with an empty targets list, a `400` error is returned, indicating "Bad Request". ```C# Snippet:BadRequest -var invalidInput = new DocumentTranslationInput(new TranslationSource(sourceSasUri, new List()); +var invalidInput = new DocumentTranslationInput(new TranslationSource(new Uri(endpoint)), new List()); try { diff --git a/sdk/translation/Azure.AI.Translation.Document/samples/Sample1_StartTranslation.md b/sdk/translation/Azure.AI.Translation.Document/samples/Sample1_StartTranslation.md index 2949a2697b037..20bc258c12187 100644 --- a/sdk/translation/Azure.AI.Translation.Document/samples/Sample1_StartTranslation.md +++ b/sdk/translation/Azure.AI.Translation.Document/samples/Sample1_StartTranslation.md @@ -25,8 +25,8 @@ To call `StartTranslationAsync` you need to initialize an object of type `Docume More on generating SAS Tokens [here](https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/get-started-with-document-translation?tabs=csharp#create-sas-access-tokens-for-document-translation) ```C# Snippet:StartTranslationAsync -Uri sourceUri = ; -Uri targetUri = ; +Uri sourceUri = new Uri(""); +Uri targetUri = new Uri(""); var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); diff --git a/sdk/translation/Azure.AI.Translation.Document/samples/Sample2_PollIndividualDocuments.md b/sdk/translation/Azure.AI.Translation.Document/samples/Sample2_PollIndividualDocuments.md index 91b26481f6a30..4676589493c4c 100644 --- a/sdk/translation/Azure.AI.Translation.Document/samples/Sample2_PollIndividualDocuments.md +++ b/sdk/translation/Azure.AI.Translation.Document/samples/Sample2_PollIndividualDocuments.md @@ -18,8 +18,8 @@ var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCreden To poll the status of documents in an operation you use the `DocumentTranslationOperation` class which contains two functions `GetAllDocumentsStatusAsync` which returns the status of all documents in the operation and `GetDocumentStatusAsync` which returns the status of a specific document given its ID. ```C# Snippet:PollIndividualDocumentsAsync -Uri sourceUri = ; -Uri targetUri = ; +Uri sourceUri = new Uri(""); +Uri targetUri = new Uri(""); var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); diff --git a/sdk/translation/Azure.AI.Translation.Document/samples/Sample4_MultipleInputs.md b/sdk/translation/Azure.AI.Translation.Document/samples/Sample4_MultipleInputs.md index c09b6f04d582d..26234edd2e848 100644 --- a/sdk/translation/Azure.AI.Translation.Document/samples/Sample4_MultipleInputs.md +++ b/sdk/translation/Azure.AI.Translation.Document/samples/Sample4_MultipleInputs.md @@ -25,12 +25,13 @@ To call `StartTranslationAsync` you need to initialize a list of `DocumentTransl More on generating SAS Tokens [here](https://docs.microsoft.com/azure/cognitive-services/translator/document-translation/get-started-with-document-translation?tabs=csharp#create-sas-access-tokens-for-document-translation) ```C# Snippet:MultipleInputsAsync -Uri source1SasUriUri = ; -Uri source2SasUri = ; -Uri frenchTargetSasUri = ; -Uri arabicTargetSasUri = ; -Uri spanishTargetSasUri = ; -Uri frenchGlossarySasUri = ; +Uri source1SasUriUri = new Uri(""); +Uri source2SasUri = new Uri(""); +Uri frenchTargetSasUri = new Uri(""); +Uri arabicTargetSasUri = new Uri(""); +Uri spanishTargetSasUri = new Uri(""); +Uri frenchGlossarySasUri = new Uri(""); + var glossaryFormat = "TSV"; var input1 = new DocumentTranslationInput(source1SasUriUri, frenchTargetSasUri, "fr", new TranslationGlossary(frenchGlossarySasUri, glossaryFormat)); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs index 30a3d991fc0d7..eaa34facc0596 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/SampleSnippets.cs @@ -34,18 +34,18 @@ public void CreateDocumentTranslationClient() [Ignore("Samples not working yet")] public void BadRequestSnippet() { +#if SNIPPET + string endpoint = ""; +#else string endpoint = TestEnvironment.Endpoint; +#endif string apiKey = TestEnvironment.ApiKey; var credentials = new AzureKeyCredential(apiKey); var client = new DocumentTranslationClient(new Uri(endpoint), credentials); #region Snippet:BadRequest -#if SNIPPET - var invalidInput = new DocumentTranslationInput(new TranslationSource(sourceSasUri, new List()); -#else var invalidInput = new DocumentTranslationInput(new TranslationSource(new Uri(endpoint)), new List()); -#endif try { @@ -63,29 +63,17 @@ public void BadRequestSnippet() public void DocumentTranslationInput() { #region Snippet:DocumentTranslationSingleInput -#if SNIPPET - Uri sourceSasUri = ; - Uri frenchTargetSasUri = ; -#else Uri sourceSasUri = new Uri(""); Uri frenchTargetSasUri = new Uri(""); -#endif var input = new DocumentTranslationInput(sourceSasUri, frenchTargetSasUri, "fr"); #endregion #region Snippet:DocumentTranslationMultipleInputs -#if SNIPPET - Uri source1SasUri = ; - Uri source2SasUri = ; - Uri frenchTargetSasUri = ; - Uri spanishTargetSasUri = ; -#else Uri arabicTargetSasUri = new Uri(""); Uri spanishTargetSasUri = new Uri(""); Uri source1SasUri = new Uri(""); Uri source2SasUri = new Uri(""); -#endif var inputs = new List { @@ -95,7 +83,7 @@ public void DocumentTranslationInput() targets: new List { new TranslationTarget(frenchTargetSasUri, "fr"), - new TranslationTarget(spanishTargetSasUri, "es") + new TranslationTarget(arabicTargetSasUri, "ar") }), }; #endregion diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs index 1d728ec789c5a..4b48419f5de36 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputs.cs @@ -23,21 +23,13 @@ public void MultipleInputs() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region Snippet:MultipleInputs -#if SNIPPET - Uri source1SasUriUri = ; - Uri source2SasUri = ; - Uri frenchTargetSasUri = ; - Uri arabicTargetSasUri = ; - Uri spanishTargetSasUri = ; - Uri frenchGlossarySasUri = ; -#else Uri source1SasUriUri = new Uri(""); Uri source2SasUri = new Uri(""); Uri frenchTargetSasUri = new Uri(""); Uri arabicTargetSasUri = new Uri(""); Uri spanishTargetSasUri = new Uri(""); Uri frenchGlossarySasUri = new Uri(""); -#endif + var glossaryFormat = "TSV"; var input1 = new DocumentTranslationInput(source1SasUriUri, frenchTargetSasUri, "fr", new TranslationGlossary(frenchGlossarySasUri, glossaryFormat)); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs index e58e0453a2c16..5045d5bf6eec9 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_MultipleInputsAsync.cs @@ -23,22 +23,13 @@ public async Task MultipleInputsAsync() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region Snippet:MultipleInputsAsync - -#if SNIPPET - Uri source1SasUriUri = ; - Uri source2SasUri = ; - Uri frenchTargetSasUri = ; - Uri arabicTargetSasUri = ; - Uri spanishTargetSasUri = ; - Uri frenchGlossarySasUri = ; -#else Uri source1SasUriUri = new Uri(""); Uri source2SasUri = new Uri(""); Uri frenchTargetSasUri = new Uri(""); Uri arabicTargetSasUri = new Uri(""); Uri spanishTargetSasUri = new Uri(""); Uri frenchGlossarySasUri = new Uri(""); -#endif + var glossaryFormat = "TSV"; var input1 = new DocumentTranslationInput(source1SasUriUri, frenchTargetSasUri, "fr", new TranslationGlossary(frenchGlossarySasUri, glossaryFormat)); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs index ac1456a3bc9f2..5a84087731a69 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocuments.cs @@ -22,13 +22,8 @@ public void PollIndividualDocuments() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region Snippet:PollIndividualDocuments -#if SNIPPET - Uri sourceUri = ; - Uri targetUri = ; -#else Uri sourceUri = new Uri(""); Uri targetUri = new Uri(""); -#endif var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); DocumentTranslationOperation operation = client.StartTranslation(input); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs index fd38470c6d0fb..fb5535dfcec77 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_PollIndividualDocumentsAsync.cs @@ -22,13 +22,8 @@ public async Task PollIndividualDocumentsAsync() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region Snippet:PollIndividualDocumentsAsync -#if SNIPPET - Uri sourceUri = ; - Uri targetUri = ; -#else Uri sourceUri = new Uri(""); Uri targetUri = new Uri(""); -#endif var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs index 47a0d429af5df..dcc12900f8226 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslation.cs @@ -22,13 +22,8 @@ public void StartTranslation() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region Snippet:StartTranslation -#if SNIPPET - Uri sourceUri = ; - Uri targetUri = ; -#else Uri sourceUri = new Uri(""); Uri targetUri = new Uri(""); -#endif var input = new DocumentTranslationInput(sourceUri, targetUri, "es"); diff --git a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs index 5af3c1ead7b55..1eac680d0118d 100644 --- a/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs +++ b/sdk/translation/Azure.AI.Translation.Document/tests/samples/Sample_StartTranslationAsync.cs @@ -22,13 +22,8 @@ public async Task StartTranslationAsync() var client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey)); #region Snippet:StartTranslationAsync -#if SNIPPET - Uri sourceUri = ; - Uri targetUri = ; -#else Uri sourceUri = new Uri(""); Uri targetUri = new Uri(""); -#endif var input = new DocumentTranslationInput(sourceUri, targetUri, "es");