Class DocumentModelAdministrationClient
Instantiating a synchronous Document Model Administration Client
DocumentModelAdministrationClient documentModelAdministrationClient = new DocumentModelAdministrationClientBuilder().buildClient();
-
Method Summary
Modifier and TypeMethodDescriptioncom.azure.core.util.polling.SyncPoller<DocumentOperationResult,
DocumentModel> beginBuildModel
(String trainingFilesUrl, DocumentBuildMode buildMode) Builds a custom document analysis model.com.azure.core.util.polling.SyncPoller<DocumentOperationResult,
DocumentModel> beginBuildModel
(String trainingFilesUrl, DocumentBuildMode buildMode, BuildModelOptions buildModelOptions, com.azure.core.util.Context context) Builds a custom document analysis model.com.azure.core.util.polling.SyncPoller<DocumentOperationResult,
DocumentModel> beginCopyModelTo
(String modelId, CopyAuthorization target) Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.com.azure.core.util.polling.SyncPoller<DocumentOperationResult,
DocumentModel> beginCopyModelTo
(String modelId, CopyAuthorization target, com.azure.core.util.Context context) Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.com.azure.core.util.polling.SyncPoller<DocumentOperationResult,
DocumentModel> beginCreateComposedModel
(List<String> componentModelIds) Create a composed model from the provided list of existing models in the account.com.azure.core.util.polling.SyncPoller<DocumentOperationResult,
DocumentModel> beginCreateComposedModel
(List<String> componentModelIds, CreateComposedModelOptions createComposedModelOptions, com.azure.core.util.Context context) Create a composed model from the provided list of existing models in the account.void
deleteModel
(String modelId) Deletes the specified custom document analysis model.com.azure.core.http.rest.Response<Void>
deleteModelWithResponse
(String modelId, com.azure.core.util.Context context) Deletes the specified custom document analysis model.Get account information of the Form Recognizer account.com.azure.core.http.rest.Response<AccountProperties>
getAccountPropertiesWithResponse
(com.azure.core.util.Context context) Get account information of the Form Recognizer account with an Http response and a specifiedContext
.Generate authorization for copying a custom model into the target Form Recognizer resource.com.azure.core.http.rest.Response<CopyAuthorization>
getCopyAuthorizationWithResponse
(CopyAuthorizationOptions copyAuthorizationOptions, com.azure.core.util.Context context) Generate authorization for copying a custom model into the target Form Recognizer resource.Creates a newDocumentAnalysisClient
object.Get detailed information for a specified model ID.com.azure.core.http.rest.Response<DocumentModel>
getModelWithResponse
(String modelId, com.azure.core.util.Context context) Get detailed information for a specified model ID.getOperation
(String operationId) Get detailed operation information for the specified ID with Http response.com.azure.core.http.rest.Response<ModelOperation>
getOperationWithResponse
(String operationId, com.azure.core.util.Context context) Get detailed operation information for the specified ID with Http response.com.azure.core.http.rest.PagedIterable<DocumentModelInfo>
List information for each model on the Form Recognizer account that were built successfully.com.azure.core.http.rest.PagedIterable<DocumentModelInfo>
listModels
(com.azure.core.util.Context context) List information for each model on the Form Recognizer account that were built successfully with a Http response and a specifiedContext
.com.azure.core.http.rest.PagedIterable<ModelOperationInfo>
List information for each model operation on the Form Recognizer account in the past 24 hours.com.azure.core.http.rest.PagedIterable<ModelOperationInfo>
listOperations
(com.azure.core.util.Context context) List information for each operation on the Form Recognizer account in the past 24 hours with an HTTP response and a specifiedContext
.
-
Method Details
-
getDocumentAnalysisClient
Creates a newDocumentAnalysisClient
object. The newDocumentAnalysisClient
uses the same request policy pipeline as theDocumentAnalysisClient
.- Returns:
- A new
DocumentAnalysisClient
object.
-
beginBuildModel
public com.azure.core.util.polling.SyncPoller<DocumentOperationResult,DocumentModel> beginBuildModel(String trainingFilesUrl, DocumentBuildMode buildMode) Builds a custom document analysis model.Models are built using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff', image/bmp. Other type of content is ignored.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
String trainingFilesUrl = "{SAS-URL-of-your-container-in-blob-storage}"; DocumentModel documentModel = documentModelAdministrationClient.beginBuildModel(trainingFilesUrl, DocumentBuildMode.TEMPLATE) .getFinalResult(); System.out.printf("Model ID: %s%n", documentModel.getModelId()); System.out.printf("Model Created on: %s%n", documentModel.getCreatedOn()); documentModel.getDocTypes().forEach((key, docTypeInfo) -> { docTypeInfo.getFieldSchema().forEach((field, documentFieldSchema) -> { System.out.printf("Field: %s", field); System.out.printf("Field type: %s", documentFieldSchema.getType()); System.out.printf("Field confidence: %.2f", docTypeInfo.getFieldConfidence().get(field)); }); });
- Parameters:
trainingFilesUrl
- an Azure Storage blob container's SAS URI. A container URI (without SAS) can be used if the container is public or has a managed identity configured. For more information on setting up a training data set, see: here.buildMode
- the preferred technique for creating models. For faster training of models useDocumentBuildMode.TEMPLATE
. See here for more information on building mode for custom documents.- Returns:
- A
SyncPoller
that polls the building model operation until it has completed, has failed, or has been cancelled. The completed operation returns the trainedcustom document analysis model
. - Throws:
DocumentModelOperationException
- If building model fails withOperationStatus.FAILED
is created.NullPointerException
- IftrainingFilesUrl
is null.
-
beginBuildModel
public com.azure.core.util.polling.SyncPoller<DocumentOperationResult,DocumentModel> beginBuildModel(String trainingFilesUrl, DocumentBuildMode buildMode, BuildModelOptions buildModelOptions, com.azure.core.util.Context context) Builds a custom document analysis model.Models are built using documents that are of the following content type - 'application/pdf', 'image/jpeg', 'image/png', 'image/tiff', image/bmp. Other type of content is ignored.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
String trainingFilesUrl = "{SAS-URL-of-your-container-in-blob-storage}"; String modelId = "custom-model-id"; String prefix = "Invoice"; Map<String, String> attrs = new HashMap<String, String>(); attrs.put("createdBy", "sample"); DocumentModel documentModel = documentModelAdministrationClient.beginBuildModel(trainingFilesUrl, DocumentBuildMode.TEMPLATE, new BuildModelOptions() .setModelId(modelId) .setDescription("model desc") .setPrefix(prefix) .setTags(attrs), Context.NONE) .getFinalResult(); System.out.printf("Model ID: %s%n", documentModel.getModelId()); System.out.printf("Model Description: %s%n", documentModel.getDescription()); System.out.printf("Model Created on: %s%n", documentModel.getCreatedOn()); System.out.printf("Model assigned tags: %s%n", documentModel.getTags()); documentModel.getDocTypes().forEach((key, docTypeInfo) -> { docTypeInfo.getFieldSchema().forEach((field, documentFieldSchema) -> { System.out.printf("Field: %s", field); System.out.printf("Field type: %s", documentFieldSchema.getType()); System.out.printf("Field confidence: %.2f", docTypeInfo.getFieldConfidence().get(field)); }); });
- Parameters:
trainingFilesUrl
- an Azure Storage blob container's SAS URI. A container URI (without SAS) can be used if the container is public or has a managed identity configured. For more information on setting up a training data set, see: here.buildMode
- the preferred technique for creating models. For faster training of models useDocumentBuildMode.TEMPLATE
. See here for more information on building mode for custom documents.buildModelOptions
- The configurableoptions
to pass when building a custom document analysis model.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A
SyncPoller
that polls the building model operation until it has completed, has failed, or has been cancelled. The completed operation returns the builtcustom document analysis model
. - Throws:
DocumentModelOperationException
- If building the model fails withOperationStatus.FAILED
is created.NullPointerException
- IftrainingFilesUrl
is null.
-
getAccountProperties
Get account information of the Form Recognizer account.Code sample
AccountProperties accountProperties = documentModelAdministrationClient.getAccountProperties(); System.out.printf("Max number of models that can be build for this account: %d%n", accountProperties.getDocumentModelLimit()); System.out.printf("Current count of built document analysis models: %d%n", accountProperties.getDocumentModelCount());
- Returns:
- The requested account information of the Form Recognizer account.
-
getAccountPropertiesWithResponse
public com.azure.core.http.rest.Response<AccountProperties> getAccountPropertiesWithResponse(com.azure.core.util.Context context) Get account information of the Form Recognizer account with an Http response and a specifiedContext
.Code sample
Response<AccountProperties> response = documentModelAdministrationClient.getAccountPropertiesWithResponse(Context.NONE); System.out.printf("Response Status Code: %d.", response.getStatusCode()); AccountProperties accountProperties = response.getValue(); System.out.printf("Max number of models that can be build for this account: %d%n", accountProperties.getDocumentModelLimit()); System.out.printf("Current count of built document analysis models: %d%n", accountProperties.getDocumentModelCount());
- Parameters:
context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- The requested account information of the Form Recognizer account.
-
deleteModel
Deletes the specified custom document analysis model.Code sample
String modelId = "{custom-model-id}"; documentModelAdministrationClient.deleteModel(modelId); System.out.printf("Model ID: %s is deleted.%n", modelId);
- Parameters:
modelId
- The unique model identifier.- Throws:
IllegalArgumentException
- IfmodelId
is null or empty.
-
deleteModelWithResponse
public com.azure.core.http.rest.Response<Void> deleteModelWithResponse(String modelId, com.azure.core.util.Context context) Deletes the specified custom document analysis model.Code sample
String modelId = "{custom-model-id}"; Response<Void> response = documentModelAdministrationClient.deleteModelWithResponse(modelId, Context.NONE); System.out.printf("Response Status Code: %d.", response.getStatusCode()); System.out.printf("Model ID: %s is deleted.%n", modelId);
- Parameters:
modelId
- The unique model identifier.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- A
Response
containing containing status code and HTTP headers. - Throws:
IllegalArgumentException
- IfmodelId
is null or empty.
-
getCopyAuthorization
Generate authorization for copying a custom model into the target Form Recognizer resource.This should be called by the target resource (where the model will be copied to) and the output can be passed as the target parameter into
beginCopyModelTo(String, CopyAuthorization)
.- Returns:
- The
CopyAuthorization
-
getCopyAuthorizationWithResponse
public com.azure.core.http.rest.Response<CopyAuthorization> getCopyAuthorizationWithResponse(CopyAuthorizationOptions copyAuthorizationOptions, com.azure.core.util.Context context) Generate authorization for copying a custom model into the target Form Recognizer resource.This should be called by the target resource (where the model will be copied to) and the output can be passed as the target parameter into
beginCopyModelTo(String, CopyAuthorization)
.- Parameters:
copyAuthorizationOptions
- The configurableoptions
to pass when copying a model.context
- Additional context that is passed through the Http pipeline during the service call.Code sample
String modelId = "my-copied-model"; Map<String, String> attrs = new HashMap<String, String>(); attrs.put("createdBy", "sample"); Response<CopyAuthorization> copyAuthorizationResponse = documentModelAdministrationClient.getCopyAuthorizationWithResponse( new CopyAuthorizationOptions() .setModelId(modelId) .setDescription("model-desc") .setTags(attrs), Context.NONE); System.out.printf("Copy Authorization operation returned with status: %s", copyAuthorizationResponse.getStatusCode()); CopyAuthorization copyAuthorization = copyAuthorizationResponse.getValue(); System.out.printf("Copy Authorization for model id: %s, access token: %s, " + "expiration time: %s, target resource ID; %s, target resource region: %s%n", copyAuthorization.getTargetModelId(), copyAuthorization.getAccessToken(), copyAuthorization.getExpiresOn(), copyAuthorization.getTargetResourceId(), copyAuthorization.getTargetResourceRegion() );
- Returns:
- A
Response
containing theCopyAuthorization
-
beginCreateComposedModel
public com.azure.core.util.polling.SyncPoller<DocumentOperationResult,DocumentModel> beginCreateComposedModel(List<String> componentModelIds) Create a composed model from the provided list of existing models in the account.This operations fails if the list consists of an invalid, non-existing model Id or duplicate IDs.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
String modelId1 = "{custom-model-id_1}"; String modelId2 = "{custom-model-id_2}"; final DocumentModel documentModel = documentModelAdministrationClient.beginCreateComposedModel(Arrays.asList(modelId1, modelId2)) .getFinalResult(); System.out.printf("Model ID: %s%n", documentModel.getModelId()); System.out.printf("Model Description: %s%n", documentModel.getDescription()); System.out.printf("Model Created on: %s%n", documentModel.getCreatedOn()); documentModel.getDocTypes().forEach((key, docTypeInfo) -> { docTypeInfo.getFieldSchema().forEach((field, documentFieldSchema) -> { System.out.printf("Field: %s", field); System.out.printf("Field type: %s", documentFieldSchema.getType()); System.out.printf("Field confidence: %.2f", docTypeInfo.getFieldConfidence().get(field)); }); });
- Parameters:
componentModelIds
- The list of models IDs to form the composed model.- Returns:
- A
SyncPoller
that polls the create composed model operation until it has completed, has failed, or has been cancelled. The completed operation returns thecomposed model
. - Throws:
DocumentModelOperationException
- If create composed model operation fails and model withOperationStatus.FAILED
is created.NullPointerException
- If the list ofmodelIDs
is null or empty.
-
beginCreateComposedModel
public com.azure.core.util.polling.SyncPoller<DocumentOperationResult,DocumentModel> beginCreateComposedModel(List<String> componentModelIds, CreateComposedModelOptions createComposedModelOptions, com.azure.core.util.Context context) Create a composed model from the provided list of existing models in the account.This operations fails if the list consists of an invalid, non-existing model Id or duplicate IDs.
The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
String modelId1 = "{custom-model-id_1}"; String modelId2 = "{custom-model-id_2}"; String modelId = "my-composed-model"; Map<String, String> attrs = new HashMap<String, String>(); attrs.put("createdBy", "sample"); final DocumentModel documentModel = documentModelAdministrationClient.beginCreateComposedModel(Arrays.asList(modelId1, modelId2), new CreateComposedModelOptions() .setModelId(modelId) .setDescription("my composed model desc") .setTags(attrs), Context.NONE) .setPollInterval(Duration.ofSeconds(5)) .getFinalResult(); System.out.printf("Model ID: %s%n", documentModel.getModelId()); System.out.printf("Model Description: %s%n", documentModel.getDescription()); System.out.printf("Model Created on: %s%n", documentModel.getCreatedOn()); System.out.printf("Model assigned tags: %s%n", documentModel.getTags()); documentModel.getDocTypes().forEach((key, docTypeInfo) -> { docTypeInfo.getFieldSchema().forEach((field, documentFieldSchema) -> { System.out.printf("Field: %s", field); System.out.printf("Field type: %s", documentFieldSchema.getType()); System.out.printf("Field confidence: %.2f", docTypeInfo.getFieldConfidence().get(field)); }); });
- Parameters:
componentModelIds
- The list of models IDs to form the composed model.createComposedModelOptions
- The configurableoptions
to pass when creating a composed model.context
- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- A
SyncPoller
that polls the create composed model operation until it has completed, has failed, or has been cancelled. The completed operation returns thecomposed model
. - Throws:
DocumentModelOperationException
- If create composed model operation fails and model withOperationStatus.FAILED
is created.NullPointerException
- If the list ofmodelIDs
is null or empty.
-
beginCopyModelTo
public com.azure.core.util.polling.SyncPoller<DocumentOperationResult,DocumentModel> beginCopyModelTo(String modelId, CopyAuthorization target) Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.This should be called with the source Form Recognizer resource (with the model that is intended to be copied). The target parameter should be supplied from the target resource's output from
getCopyAuthorization()
method.The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
String copyModelId = "copy-model"; // Get authorization to copy the model to target resource CopyAuthorization copyAuthorization = documentModelAdministrationClient.getCopyAuthorization(); // Start copy operation from the source client DocumentModel documentModel = documentModelAdministrationClient.beginCopyModelTo(copyModelId, copyAuthorization).getFinalResult(); System.out.printf("Copied model has model ID: %s, was created on: %s.%n,", documentModel.getModelId(), documentModel.getCreatedOn());
- Parameters:
modelId
- Model identifier of the model to copy to target resource.target
- the copy authorization to the target Form Recognizer resource. The copy authorization can be generated from the target resource's call togetCopyAuthorization()
- Returns:
- A
SyncPoller
that polls the copy model operation until it has completed, has failed, or has been cancelled.
-
beginCopyModelTo
public com.azure.core.util.polling.SyncPoller<DocumentOperationResult,DocumentModel> beginCopyModelTo(String modelId, CopyAuthorization target, com.azure.core.util.Context context) Copy a custom model stored in this resource (the source) to the user specified target Form Recognizer resource.This should be called with the source Form Recognizer resource (with the model that is intended to be copied). The target parameter should be supplied from the target resource's output from
getCopyAuthorization()
method.The service does not support cancellation of the long running operation and returns with an error message indicating absence of cancellation support.
Code sample
String copyModelId = "copy-model"; // Get authorization to copy the model to target resource CopyAuthorization copyAuthorization = documentModelAdministrationClient.getCopyAuthorization(); // Start copy operation from the source client DocumentModel documentModel = documentModelAdministrationClient.beginCopyModelTo(copyModelId, copyAuthorization, Context.NONE).getFinalResult(); System.out.printf("Copied model has model ID: %s, was created on: %s.%n,", documentModel.getModelId(), documentModel.getCreatedOn());
- Parameters:
modelId
- Model identifier of the model to copy to target resource.target
- the copy authorization to the target Form Recognizer resource. The copy authorization can be generated from the target resource's call togetCopyAuthorization()
.context
- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- A
SyncPoller
that polls the copy model operation until it has completed, has failed, or has been cancelled.
-
listModels
List information for each model on the Form Recognizer account that were built successfully.Code sample
documentModelAdministrationClient.listModels() .forEach(documentModel -> System.out.printf("Model ID: %s, Model description: %s, Created on: %s.%n", documentModel.getModelId(), documentModel.getDescription(), documentModel.getCreatedOn()) );
- Returns:
PagedIterable
ofDocumentModelInfo
custom form model information.
-
listModels
public com.azure.core.http.rest.PagedIterable<DocumentModelInfo> listModels(com.azure.core.util.Context context) List information for each model on the Form Recognizer account that were built successfully with a Http response and a specifiedContext
.Code sample
documentModelAdministrationClient.listModels(Context.NONE) .forEach(documentModel -> System.out.printf("Model ID: %s, Model description: %s, Created on: %s.%n", documentModel.getModelId(), documentModel.getDescription(), documentModel.getCreatedOn()) );
- Parameters:
context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
PagedIterable
ofDocumentModelInfo
custom form model information.
-
getModel
Get detailed information for a specified model ID.Code sample
String modelId = "{custom-model-id}"; DocumentModel documentModel = documentModelAdministrationClient.getModel(modelId); System.out.printf("Model ID: %s%n", documentModel.getModelId()); System.out.printf("Model Description: %s%n", documentModel.getDescription()); System.out.printf("Model Created on: %s%n", documentModel.getCreatedOn()); documentModel.getDocTypes().forEach((key, docTypeInfo) -> { docTypeInfo.getFieldSchema().forEach((field, documentFieldSchema) -> { System.out.printf("Field: %s", field); System.out.printf("Field type: %s", documentFieldSchema.getType()); System.out.printf("Field confidence: %.2f", docTypeInfo.getFieldConfidence().get(field)); }); });
- Parameters:
modelId
- The unique model identifier.- Returns:
- The detailed information for the specified model.
- Throws:
IllegalArgumentException
- IfmodelId
is null or empty.
-
getModelWithResponse
public com.azure.core.http.rest.Response<DocumentModel> getModelWithResponse(String modelId, com.azure.core.util.Context context) Get detailed information for a specified model ID.Code sample
String modelId = "{custom-model-id}"; Response<DocumentModel> response = documentModelAdministrationClient.getModelWithResponse(modelId, Context.NONE); System.out.printf("Response Status Code: %d.", response.getStatusCode()); DocumentModel documentModel = response.getValue(); System.out.printf("Model ID: %s%n", documentModel.getModelId()); System.out.printf("Model Description: %s%n", documentModel.getDescription()); System.out.printf("Model Created on: %s%n", documentModel.getCreatedOn()); documentModel.getDocTypes().forEach((key, docTypeInfo) -> { docTypeInfo.getFieldSchema().forEach((field, documentFieldSchema) -> { System.out.printf("Field: %s", field); System.out.printf("Field type: %s", documentFieldSchema.getType()); System.out.printf("Field confidence: %.2f", docTypeInfo.getFieldConfidence().get(field)); }); });
- Parameters:
modelId
- The unique model identifier.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- The detailed information for the specified model.
- Throws:
IllegalArgumentException
- IfmodelId
is null or empty.
-
getOperation
Get detailed operation information for the specified ID with Http response.This operations fails if the operation ID used is past 24 hours.
Code sample
String operationId = "{operation-id}"; ModelOperation modelOperation = documentModelAdministrationClient.getOperation(operationId); System.out.printf("Operation ID: %s%n", modelOperation.getOperationId()); System.out.printf("Operation Kind: %s%n", modelOperation.getKind()); System.out.printf("Operation Status: %s%n", modelOperation.getStatus()); System.out.printf("Model ID created with this operation: %s%n", modelOperation.getModelId()); if (ModelOperationStatus.FAILED.equals(modelOperation.getStatus())) { System.out.printf("Operation fail error: %s%n", modelOperation.getError().getMessage()); }
- Parameters:
operationId
- Unique operation ID.- Returns:
- The detailed information for the specified operation.
- Throws:
IllegalArgumentException
- IfoperationId
is null or empty.
-
getOperationWithResponse
public com.azure.core.http.rest.Response<ModelOperation> getOperationWithResponse(String operationId, com.azure.core.util.Context context) Get detailed operation information for the specified ID with Http response.This operations fails if the operation ID used is past 24 hours.
Code sample
String operationId = "{operation-id}"; Response<ModelOperation> response = documentModelAdministrationClient.getOperationWithResponse(operationId, Context.NONE); System.out.printf("Response Status Code: %d.", response.getStatusCode()); ModelOperation modelOperation = response.getValue(); System.out.printf("Operation ID: %s%n", modelOperation.getOperationId()); System.out.printf("Operation Kind: %s%n", modelOperation.getKind()); System.out.printf("Operation Status: %s%n", modelOperation.getStatus()); System.out.printf("Model ID created with this operation: %s%n", modelOperation.getModelId()); if (ModelOperationStatus.FAILED.equals(modelOperation.getStatus())) { System.out.printf("Operation fail error: %s%n", modelOperation.getError().getMessage()); }
- Parameters:
operationId
- Unique operation ID.context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
- The detailed information for the specified operation.
- Throws:
IllegalArgumentException
- IfoperationId
is null or empty.
-
listOperations
List information for each model operation on the Form Recognizer account in the past 24 hours.Code sample
PagedIterable<ModelOperationInfo> modelOperationInfo = documentModelAdministrationClient.listOperations(); modelOperationInfo.forEach(modelOperation -> { System.out.printf("Operation ID: %s%n", modelOperation.getOperationId()); System.out.printf("Operation Status: %s%n", modelOperation.getStatus()); System.out.printf("Operation Created on: %s%n", modelOperation.getCreatedOn()); System.out.printf("Operation Percent completed: %d%n", modelOperation.getPercentCompleted()); System.out.printf("Operation Kind: %s%n", modelOperation.getKind()); System.out.printf("Operation Last updated on: %s%n", modelOperation.getLastUpdatedOn()); System.out.printf("Operation resource location: %s%n", modelOperation.getResourceLocation()); });
- Returns:
PagedIterable
ofModelOperationInfo
custom form model information.
-
listOperations
public com.azure.core.http.rest.PagedIterable<ModelOperationInfo> listOperations(com.azure.core.util.Context context) List information for each operation on the Form Recognizer account in the past 24 hours with an HTTP response and a specifiedContext
.Code sample
PagedIterable<ModelOperationInfo> modelOperationInfo = documentModelAdministrationClient.listOperations(Context.NONE); modelOperationInfo.forEach(modelOperation -> { System.out.printf("Operation ID: %s%n", modelOperation.getOperationId()); System.out.printf("Operation Status: %s%n", modelOperation.getStatus()); System.out.printf("Operation Created on: %s%n", modelOperation.getCreatedOn()); System.out.printf("Operation Percent completed: %d%n", modelOperation.getPercentCompleted()); System.out.printf("Operation Kind: %s%n", modelOperation.getKind()); System.out.printf("Operation Last updated on: %s%n", modelOperation.getLastUpdatedOn()); System.out.printf("Operation resource location: %s%n", modelOperation.getResourceLocation()); });
- Parameters:
context
- Additional context that is passed through the Http pipeline during the service call.- Returns:
PagedIterable
ofModelOperationInfo
custom form model information.
-