88using Azure . AI . Language . Documents . Tests ;
99using Azure . Core . TestFramework ;
1010using NUnit . Framework ;
11+ using System . Collections . Generic ;
1112#region Snippet:Documents_Identity_Namespace
1213using Azure . Identity ;
1314#endregion
1415
15- namespace Azure . AI . Language . TextAnalytics . Tests . Samples
16+ namespace Azure . AI . Language . Documents . Tests . Samples
1617{
1718 public partial class CreateClient : SamplesBase < DocumentAnalysisClientTestEnvironment >
1819 {
@@ -26,7 +27,7 @@ public void CreateDocumentAnalysisClientForSpecificApiVersion()
2627 endpoint = TestEnvironment . Endpoint ;
2728 credential = new ( TestEnvironment . ApiKey ) ;
2829#endif
29- DocumentAnalysisClientOptions options = new DocumentAnalysisClientOptions ( DocumentAnalysisClientOptions . ServiceVersion . V2023_04_01 ) ;
30+ DocumentAnalysisClientOptions options = new DocumentAnalysisClientOptions ( DocumentAnalysisClientOptions . ServiceVersion . V2024_11_15_Preview ) ;
3031 var client = new DocumentAnalysisClient ( endpoint , credential , options ) ;
3132 #endregion
3233 }
@@ -68,29 +69,26 @@ public void BadArgument()
6869 #region Snippet:DocumentAnalysisClient_BadRequest
6970 try
7071 {
71- string textA =
72- "We love this trail and make the trip every year. The views are breathtaking and well worth the hike!"
73- + " Yesterday was foggy though, so we missed the spectacular views. We tried again today and it was"
74- + " amazing. Everyone in my family liked the trail although it was too challenging for the less"
75- + " athletic among us. Not necessarily recommended for small children. A hotel close to the trail"
76- + " offers services for childcare in case you want that." ;
72+ var body = new MultiLanguageDocumentInput ( )
73+ {
74+ Documents =
75+ {
76+ new MultiLanguageInput ( "D" , null , null ) ,
77+ }
78+ } ;
7779
78- AnalyzeTextInput body = new TextEntityRecognitionInput ( )
80+ var actions = new List < AnalyzeDocumentsOperationAction > ( )
7981 {
80- TextInput = new MultiLanguageTextInput ( )
82+ new PiiEntityRecognitionOperationAction ( )
8183 {
82- MultiLanguageInputs =
84+ Parameters = new PiiActionContent ( )
8385 {
84- new MultiLanguageInput ( "D ", textA ) ,
85- }
86+ ModelVersion = "NotValid ", // Invalid model version will is a bad request.
87+ } ,
8688 } ,
87- ActionContent = new EntitiesActionContent ( )
88- {
89- ModelVersion = "NotValid" , // Invalid model version will is a bad request.
90- }
9189 } ;
9290
93- Response < AnalyzeTextResult > response = client . AnalyzeText ( body ) ;
91+ var response = client . AnalyzeDocumentsOperation ( body , actions ) ;
9492 }
9593 catch ( RequestFailedException ex )
9694 {
0 commit comments