Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form Recognizer] Update to latest swagger #24494

Merged
merged 2 commits into from
Oct 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sdk/formrecognizer/azure-ai-formrecognizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ customDocumentModels.forEach(documentModelInfo -> {
// Delete Model
documentModelAdminClient.deleteModel(modelId.get());
```
For more detailed examples, refer to [samples][sample_readme].
For more detailed examples, refer to [samples][sample_examples].

## Troubleshooting
### General
Expand Down Expand Up @@ -614,8 +614,9 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[register_AAD_application]: https://docs.microsoft.com/azure/cognitive-services/authentication#assign-a-role-to-a-service-principal
[fr_labeling_tool]: https://aka.ms/azsdk/formrecognizer/labelingtool
[fr_build_training_set]: https://aka.ms/azsdk/formrecognizer/buildtrainingset

[sample_examples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/formrecognizer/azure-ai-formrecognizer/src/samples#examples
[sample_readme]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/formrecognizer/azure-ai-formrecognizer/src/samples#readme

[create_composed_model]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/administration/CreateComposedModel.java
[create_composed_model_async]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/java/com/azure/ai/formrecognizer/administration/CreateComposedModelAsync.java
[sample_readme]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/formrecognizer/azure-ai-formrecognizer/src/samples/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@

package com.azure.ai.formrecognizer;

import com.azure.ai.formrecognizer.models.AnalyzeDocumentOptions;
import com.azure.ai.formrecognizer.models.DocumentAnalysisException;
import com.azure.ai.formrecognizer.implementation.FormRecognizerClientImpl;
import com.azure.ai.formrecognizer.implementation.models.AnalyzeDocumentRequest;
import com.azure.ai.formrecognizer.implementation.models.AnalyzeResultOperation;
import com.azure.ai.formrecognizer.implementation.models.OperationStatus;
import com.azure.ai.formrecognizer.implementation.models.StringIndexType;
import com.azure.ai.formrecognizer.implementation.util.Transforms;
import com.azure.ai.formrecognizer.models.AnalyzeDocumentOptions;
import com.azure.ai.formrecognizer.models.AnalyzeResult;
import com.azure.ai.formrecognizer.models.DocumentAnalysisException;
import com.azure.ai.formrecognizer.models.DocumentOperationResult;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.polling.LongRunningOperationStatus;
import com.azure.core.util.polling.PollResponse;
Expand Down Expand Up @@ -129,7 +130,8 @@ public final class DocumentAnalysisAsyncClient {
DEFAULT_POLL_INTERVAL,
activationOperation(() ->
service.analyzeDocumentWithResponseAsync(modelId,
finalAnalyzeDocumentOptions.getPages(),
CoreUtils.isNullOrEmpty(finalAnalyzeDocumentOptions.getPages())
? null : String.join(",", finalAnalyzeDocumentOptions.getPages()),
finalAnalyzeDocumentOptions.getLocale() == null ? null
: finalAnalyzeDocumentOptions.getLocale(),
StringIndexType.UTF16CODE_UNIT,
Expand Down Expand Up @@ -233,7 +235,8 @@ public final class DocumentAnalysisAsyncClient {
activationOperation(() ->
service.analyzeDocumentWithResponseAsync(modelId,
null,
finalAnalyzeDocumentOptions.getPages(),
CoreUtils.isNullOrEmpty(finalAnalyzeDocumentOptions.getPages())
? null : String.join(",", finalAnalyzeDocumentOptions.getPages()),
finalAnalyzeDocumentOptions.getLocale() == null ? null
: finalAnalyzeDocumentOptions.getLocale(),
StringIndexType.UTF16CODE_UNIT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.serializer.CollectionFormat;
import com.azure.core.util.serializer.JacksonAdapter;
import com.azure.core.util.serializer.SerializerAdapter;
import java.nio.ByteBuffer;
import java.util.List;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

Expand Down Expand Up @@ -349,20 +347,18 @@ Mono<Response<GetModelsResponse>> getModelsNext(
public Mono<AnalyzeDocumentResponse> analyzeDocumentWithResponseAsync(
String modelId,
ContentType contentType,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
Flux<ByteBuffer> analyzeRequest,
Long contentLength) {
final String accept = "application/json";
String pagesConverted =
JacksonAdapter.createDefaultSerializerAdapter().serializeList(pages, CollectionFormat.CSV);
return FluxUtil.withContext(
context ->
service.analyzeDocument(
this.getEndpoint(),
modelId,
pagesConverted,
pages,
locale,
stringIndexType,
this.getApiVersion(),
Expand Down Expand Up @@ -394,19 +390,17 @@ public Mono<AnalyzeDocumentResponse> analyzeDocumentWithResponseAsync(
public Mono<AnalyzeDocumentResponse> analyzeDocumentWithResponseAsync(
String modelId,
ContentType contentType,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
Flux<ByteBuffer> analyzeRequest,
Long contentLength,
Context context) {
final String accept = "application/json";
String pagesConverted =
JacksonAdapter.createDefaultSerializerAdapter().serializeList(pages, CollectionFormat.CSV);
return service.analyzeDocument(
this.getEndpoint(),
modelId,
pagesConverted,
pages,
locale,
stringIndexType,
this.getApiVersion(),
Expand Down Expand Up @@ -437,7 +431,7 @@ public Mono<AnalyzeDocumentResponse> analyzeDocumentWithResponseAsync(
public Mono<Void> analyzeDocumentAsync(
String modelId,
ContentType contentType,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
Flux<ByteBuffer> analyzeRequest,
Expand Down Expand Up @@ -468,7 +462,7 @@ public Mono<Void> analyzeDocumentAsync(
public Mono<Void> analyzeDocumentAsync(
String modelId,
ContentType contentType,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
Flux<ByteBuffer> analyzeRequest,
Expand Down Expand Up @@ -498,7 +492,7 @@ public Mono<Void> analyzeDocumentAsync(
public void analyzeDocument(
String modelId,
ContentType contentType,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
Flux<ByteBuffer> analyzeRequest,
Expand Down Expand Up @@ -528,7 +522,7 @@ public void analyzeDocument(
public AnalyzeDocumentResponse analyzeDocumentWithResponse(
String modelId,
ContentType contentType,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
Flux<ByteBuffer> analyzeRequest,
Expand Down Expand Up @@ -556,19 +550,17 @@ public AnalyzeDocumentResponse analyzeDocumentWithResponse(
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AnalyzeDocumentResponse> analyzeDocumentWithResponseAsync(
String modelId,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
AnalyzeDocumentRequest analyzeRequest) {
final String accept = "application/json";
String pagesConverted =
JacksonAdapter.createDefaultSerializerAdapter().serializeList(pages, CollectionFormat.CSV);
return FluxUtil.withContext(
context ->
service.analyzeDocument(
this.getEndpoint(),
modelId,
pagesConverted,
pages,
locale,
stringIndexType,
this.getApiVersion(),
Expand All @@ -595,18 +587,16 @@ public Mono<AnalyzeDocumentResponse> analyzeDocumentWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AnalyzeDocumentResponse> analyzeDocumentWithResponseAsync(
String modelId,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
AnalyzeDocumentRequest analyzeRequest,
Context context) {
final String accept = "application/json";
String pagesConverted =
JacksonAdapter.createDefaultSerializerAdapter().serializeList(pages, CollectionFormat.CSV);
return service.analyzeDocument(
this.getEndpoint(),
modelId,
pagesConverted,
pages,
locale,
stringIndexType,
this.getApiVersion(),
Expand All @@ -632,7 +622,7 @@ public Mono<AnalyzeDocumentResponse> analyzeDocumentWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> analyzeDocumentAsync(
String modelId,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
AnalyzeDocumentRequest analyzeRequest) {
Expand All @@ -658,7 +648,7 @@ public Mono<Void> analyzeDocumentAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> analyzeDocumentAsync(
String modelId,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
AnalyzeDocumentRequest analyzeRequest,
Expand All @@ -683,7 +673,7 @@ public Mono<Void> analyzeDocumentAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
public void analyzeDocument(
String modelId,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
AnalyzeDocumentRequest analyzeRequest) {
Expand All @@ -708,7 +698,7 @@ public void analyzeDocument(
@ServiceMethod(returns = ReturnType.SINGLE)
public AnalyzeDocumentResponse analyzeDocumentWithResponse(
String modelId,
List<String> pages,
String pages,
String locale,
StringIndexType stringIndexType,
AnalyzeDocumentRequest analyzeRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ All of these samples need the endpoint to your Form Recognizer resource ([instru
|[Authentication][authentication_sample]|Authenticate the client|
|[AnalyzeBusinessCards][analyze_business_cards] and [AnalyzeBusinessCardsAsync][analyze_business_cards_async]|Analyze business cards from an input stream|
|[AnalyzeBusinessCardsFromUrl][analyze_business_cards_from_url] and [AnalyzeBusinessCardsFromUrlAsync][analyze_business_cards_from_url_async]|Analyze business cards from a URL|
|[AnalyzeLayout][analyze_content] and [AnalyzeLayoutAsync][analyze_layout_async]|Analyze document layout, such as tables, lines, words, and selection marks like radio buttons and check boxes from a file stream|
|[AnalyzeLayout][analyze_layout] and [AnalyzeLayoutAsync][analyze_layout_async]|Analyze document layout, such as tables, lines, words, and selection marks like radio buttons and check boxes from a file stream|
|[AnalyzeLayoutFromUrl][analyze_layout_from_url] and [AnalyzeLayoutFromUrlAsync][analyze_layout_from_url_async]|Extract document layout such as tables, lines, words, and selection marks like radio buttons and check boxes from a URL|
|[AnalyzeIdentityDocuments][analyze_id_documents] and [AnalyzeIdentityDocumentsAsync][analyze_id_documents_async]|Analyze data from an identity document like a passport or a US drivers license using a prebuilt model|
|[AnalyzeIdentityDocumentsFromUrl][analyze_id_documents_from_url] and [AnalyzeIdentityDocumentsFromUrlAsync][analyze_id_documents_from_url_async]|Analyze data from a URL of a passport or a US drivers license using a prebuilt model|
Expand All @@ -43,7 +43,7 @@ All of these samples need the endpoint to your Form Recognizer resource ([instru
|[ManageCustomModels][manage_custom_models] and [ManageCustomModelsAsync][manage_custom_models_async]|Manage the custom models in your account|
|[CopyModel][copy_model] and [CopyModelAsync][copy_model_async]|Copy custom model from one Form Recognizer resource to another|
|[CreateComposedModel][create_composed_model] and [CreateComposedModelAsync][create_composed_model_async]|Creates a composed model from a collection of existing built models with labels|
|[GetOperation][get_operation] and [GetOperation][get_operation]| Get/list all document model associated with the Form Recognizer resource|
|[GetOperation][get_operation] and [GetOperationAsync][get_operation_async]| Get/list all document model associated with the Form Recognizer resource|

## Troubleshooting
Troubleshooting steps can be found [here][SDK_README_TROUBLESHOOTING].
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading