Skip to content

Commit 57c80b1

Browse files
authored
[DocumentIntelligence] Regenerating to the spec in main (Azure#47541)
1 parent 0d7872f commit 57c80b1

File tree

6 files changed

+51
-18
lines changed

6 files changed

+51
-18
lines changed

sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeBatchDocumentsOptions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ public AnalyzeBatchDocumentsOptions(string modelId, BlobFileListContentSource bl
4444
ResultContainerUri = resultContainerUri;
4545
}
4646

47+
// NOTE: keeping this constructor so it doesn't break autogenerated samples.
48+
internal AnalyzeBatchDocumentsOptions(Uri resultContainerUri)
49+
{
50+
}
51+
4752
private AnalyzeBatchDocumentsOptions(string modelId)
4853
{
4954
Argument.AssertNotNullOrEmpty(modelId, nameof(modelId));

sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/AnalyzeDocumentOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private AnalyzeDocumentOptions(string modelId) : this()
6262
ModelId = modelId;
6363
}
6464

65-
private AnalyzeDocumentOptions()
65+
internal AnalyzeDocumentOptions()
6666
{
6767
Features = new ChangeTrackingList<DocumentAnalysisFeature>();
6868
QueryFields = new ChangeTrackingList<string>();

sdk/documentintelligence/Azure.AI.DocumentIntelligence/src/Generated/Docs/DocumentIntelligenceClient.xml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ Uri endpoint = new Uri("<endpoint>");
6969
AzureKeyCredential credential = new AzureKeyCredential("<key>");
7070
DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential);
7171
72-
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout");
72+
AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions();
73+
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-layout", analyzeRequest);
7374
AnalyzeResult responseData = operation.Value;
7475
]]></code>
7576
This sample shows how to call AnalyzeDocumentAsync.
@@ -78,7 +79,8 @@ Uri endpoint = new Uri("<endpoint>");
7879
AzureKeyCredential credential = new AzureKeyCredential("<key>");
7980
DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential);
8081
81-
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "customModel");
82+
AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions();
83+
Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "customModel", analyzeRequest);
8284
AnalyzeResult responseData = operation.Value;
8385
]]></code></example>
8486
</member>
@@ -90,7 +92,8 @@ Uri endpoint = new Uri("<endpoint>");
9092
AzureKeyCredential credential = new AzureKeyCredential("<key>");
9193
DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential);
9294
93-
Operation<AnalyzeResult> operation = client.AnalyzeDocument(WaitUntil.Completed, "prebuilt-layout");
95+
AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions();
96+
Operation<AnalyzeResult> operation = client.AnalyzeDocument(WaitUntil.Completed, "prebuilt-layout", analyzeRequest);
9497
AnalyzeResult responseData = operation.Value;
9598
]]></code>
9699
This sample shows how to call AnalyzeDocument.
@@ -99,7 +102,8 @@ Uri endpoint = new Uri("<endpoint>");
99102
AzureKeyCredential credential = new AzureKeyCredential("<key>");
100103
DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential);
101104
102-
Operation<AnalyzeResult> operation = client.AnalyzeDocument(WaitUntil.Completed, "customModel");
105+
AnalyzeDocumentOptions analyzeRequest = new AnalyzeDocumentOptions();
106+
Operation<AnalyzeResult> operation = client.AnalyzeDocument(WaitUntil.Completed, "customModel", analyzeRequest);
103107
AnalyzeResult responseData = operation.Value;
104108
]]></code></example>
105109
</member>
@@ -205,7 +209,12 @@ Uri endpoint = new Uri("<endpoint>");
205209
AzureKeyCredential credential = new AzureKeyCredential("<key>");
206210
DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential);
207211
208-
Operation<AnalyzeBatchResult> operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, "customModel");
212+
AnalyzeBatchDocumentsOptions analyzeBatchRequest = new AnalyzeBatchDocumentsOptions(new Uri("https://myStorageAccount.blob.core.windows.net/myOutputContainer?mySasToken"))
213+
{
214+
ResultPrefix = "trainingDocsResult/",
215+
OverwriteExisting = true,
216+
};
217+
Operation<AnalyzeBatchResult> operation = await client.AnalyzeBatchDocumentsAsync(WaitUntil.Completed, "customModel", analyzeBatchRequest);
209218
AnalyzeBatchResult responseData = operation.Value;
210219
]]></code></example>
211220
</member>
@@ -217,7 +226,12 @@ Uri endpoint = new Uri("<endpoint>");
217226
AzureKeyCredential credential = new AzureKeyCredential("<key>");
218227
DocumentIntelligenceClient client = new DocumentIntelligenceClient(endpoint, credential);
219228
220-
Operation<AnalyzeBatchResult> operation = client.AnalyzeBatchDocuments(WaitUntil.Completed, "customModel");
229+
AnalyzeBatchDocumentsOptions analyzeBatchRequest = new AnalyzeBatchDocumentsOptions(new Uri("https://myStorageAccount.blob.core.windows.net/myOutputContainer?mySasToken"))
230+
{
231+
ResultPrefix = "trainingDocsResult/",
232+
OverwriteExisting = true,
233+
};
234+
Operation<AnalyzeBatchResult> operation = client.AnalyzeBatchDocuments(WaitUntil.Completed, "customModel", analyzeBatchRequest);
221235
AnalyzeBatchResult responseData = operation.Value;
222236
]]></code></example>
223237
</member>

sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/ClientExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ namespace Azure.AI.DocumentIntelligence.Samples
1212

1313
internal static class ClientExtensions
1414
{
15-
public static Task<Operation<AnalyzeResult>> AnalyzeDocumentAsync(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId)
15+
public static Task<Operation<AnalyzeResult>> AnalyzeDocumentAsync(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId, AnalyzeDocumentOptions options)
1616
{
1717
return null;
1818
}
1919

20-
public static Operation<AnalyzeResult> AnalyzeDocument(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId)
20+
public static Operation<AnalyzeResult> AnalyzeDocument(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId, AnalyzeDocumentOptions options)
2121
{
2222
return null;
2323
}
2424

25-
public static Task<Operation<AnalyzeBatchResult>> AnalyzeBatchDocumentsAsync(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId)
25+
public static Task<Operation<AnalyzeBatchResult>> AnalyzeBatchDocumentsAsync(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId, AnalyzeBatchDocumentsOptions options)
2626
{
2727
return null;
2828
}
2929

30-
public static Operation<AnalyzeBatchResult> AnalyzeBatchDocuments(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId)
30+
public static Operation<AnalyzeBatchResult> AnalyzeBatchDocuments(this DocumentIntelligenceClient client, WaitUntil waitUntil, string modelId, AnalyzeBatchDocumentsOptions options)
3131
{
3232
return null;
3333
}

sdk/documentintelligence/Azure.AI.DocumentIntelligence/tests/Generated/Samples/Samples_DocumentIntelligenceClient.cs

Lines changed: 20 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
directory: specification/ai/DocumentIntelligence
2-
commit: 1caf268a55260f68057065bd2c37a83d2c000db5
2+
commit: 28a0baf2c401a0b9bf839688c4d235398868835e
33
repo: Azure/azure-rest-api-specs

0 commit comments

Comments
 (0)