diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextract.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextract.java index 1675d271c4f..b62dab6f715 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextract.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextract.java @@ -268,6 +268,137 @@ AnalyzeExpenseResult analyzeExpense(AnalyzeExpenseRequest analyzeExpenseRequest) AnalyzeIDResult analyzeID(AnalyzeIDRequest analyzeIDRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Creates an adapter, which can be fine-tuned for enhanced performance on + * user provided documents. Takes an AdapterName and FeatureType. Currently + * the only supported feature type is QUERIES. You can also + * provide a Description, Tags, and a ClientRequestToken. You can choose + * whether or not the adapter should be AutoUpdated with the AutoUpdate + * argument. By default, AutoUpdate is set to DISABLED. + *

+ * + * @param createAdapterRequest + * @return createAdapterResult The response from the CreateAdapter service + * method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + CreateAdapterResult createAdapter(CreateAdapterRequest createAdapterRequest) + throws AmazonClientException, AmazonServiceException; + + /** + *

+ * Creates a new version of an adapter. Operates on a provided AdapterId and + * a specified dataset provided via the DatasetConfig argument. Requires + * that you specify an Amazon S3 bucket with the OutputConfig argument. You + * can provide an optional KMSKeyId, an optional ClientRequestToken, and + * optional tags. + *

+ * + * @param createAdapterVersionRequest + * @return createAdapterVersionResult The response from the + * CreateAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + CreateAdapterVersionResult createAdapterVersion( + CreateAdapterVersionRequest createAdapterVersionRequest) throws AmazonClientException, + AmazonServiceException; + + /** + *

+ * Deletes an Amazon Textract adapter. Takes an AdapterId and deletes the + * adapter specified by the ID. + *

+ * + * @param deleteAdapterRequest + * @return deleteAdapterResult The response from the DeleteAdapter service + * method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + DeleteAdapterResult deleteAdapter(DeleteAdapterRequest deleteAdapterRequest) + throws AmazonClientException, AmazonServiceException; + + /** + *

+ * Deletes an Amazon Textract adapter version. Requires that you specify + * both an AdapterId and a AdapterVersion. Deletes the adapter version + * specified by the AdapterId and the AdapterVersion. + *

+ * + * @param deleteAdapterVersionRequest + * @return deleteAdapterVersionResult The response from the + * DeleteAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + DeleteAdapterVersionResult deleteAdapterVersion( + DeleteAdapterVersionRequest deleteAdapterVersionRequest) throws AmazonClientException, + AmazonServiceException; + /** *

* Detects text in the input document. Amazon Textract can detect lines of @@ -317,6 +448,63 @@ AnalyzeIDResult analyzeID(AnalyzeIDRequest analyzeIDRequest) throws AmazonClient DetectDocumentTextResult detectDocumentText(DetectDocumentTextRequest detectDocumentTextRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Gets configuration information for an adapter specified by an AdapterId, + * returning information on AdapterName, Description, CreationTime, + * AutoUpdate status, and FeatureTypes. + *

+ * + * @param getAdapterRequest + * @return getAdapterResult The response from the GetAdapter service method, + * as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + GetAdapterResult getAdapter(GetAdapterRequest getAdapterRequest) throws AmazonClientException, + AmazonServiceException; + + /** + *

+ * Gets configuration information for the specified adapter version, + * including: AdapterId, AdapterVersion, FeatureTypes, Status, + * StatusMessage, DatasetConfig, KMSKeyId, OutputConfig, Tags and + * EvaluationMetrics. + *

+ * + * @param getAdapterVersionRequest + * @return getAdapterVersionResult The response from the GetAdapterVersion + * service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + GetAdapterVersionResult getAdapterVersion(GetAdapterVersionRequest getAdapterVersionRequest) + throws AmazonClientException, AmazonServiceException; + /** *

* Gets the results for an Amazon Textract asynchronous operation that @@ -653,6 +841,88 @@ GetLendingAnalysisSummaryResult getLendingAnalysisSummary( GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * List all version of an adapter that meet the specified filtration + * criteria. + *

+ * + * @param listAdapterVersionsRequest + * @return listAdapterVersionsResult The response from the + * ListAdapterVersions service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + ListAdapterVersionsResult listAdapterVersions( + ListAdapterVersionsRequest listAdapterVersionsRequest) throws AmazonClientException, + AmazonServiceException; + + /** + *

+ * Lists all adapters that match the specified filtration criteria. + *

+ * + * @param listAdaptersRequest + * @return listAdaptersResult The response from the ListAdapters service + * method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + ListAdaptersResult listAdapters(ListAdaptersRequest listAdaptersRequest) + throws AmazonClientException, AmazonServiceException; + + /** + *

+ * Lists all tags for an Amazon Textract resource. + *

+ * + * @param listTagsForResourceRequest + * @return listTagsForResourceResult The response from the + * ListTagsForResource service method, as returned by Amazon + * Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + ListTagsForResourceResult listTagsForResource( + ListTagsForResourceRequest listTagsForResourceRequest) throws AmazonClientException, + AmazonServiceException; + /** *

* Starts the asynchronous analysis of an input document for relationships @@ -904,6 +1174,88 @@ StartLendingAnalysisResult startLendingAnalysis( StartLendingAnalysisRequest startLendingAnalysisRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Adds one or more tags to the specified resource. + *

+ * + * @param tagResourceRequest + * @return tagResourceResult The response from the TagResource service + * method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws ServiceQuotaExceededException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + TagResourceResult tagResource(TagResourceRequest tagResourceRequest) + throws AmazonClientException, AmazonServiceException; + + /** + *

+ * Removes any tags with the specified keys from the specified resource. + *

+ * + * @param untagResourceRequest + * @return untagResourceResult The response from the UntagResource service + * method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest) + throws AmazonClientException, AmazonServiceException; + + /** + *

+ * Update the configuration for an adapter. FeatureTypes configurations + * cannot be updated. At least one new parameter must be specified as an + * argument. + *

+ * + * @param updateAdapterRequest + * @return updateAdapterResult The response from the UpdateAdapter service + * method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + UpdateAdapterResult updateAdapter(UpdateAdapterRequest updateAdapterRequest) + throws AmazonClientException, AmazonServiceException; + /** * Shuts down this client object, releasing any resources that might be held * open. This is an optional method, and callers are not expected to call diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsync.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsync.java index d16cbc343a1..19a9fe843a6 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsync.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsync.java @@ -409,6 +409,288 @@ Future analyzeIDAsync(AnalyzeIDRequest analyzeIDRequest, AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException; + /** + *

+ * Creates an adapter, which can be fine-tuned for enhanced performance on + * user provided documents. Takes an AdapterName and FeatureType. Currently + * the only supported feature type is QUERIES. You can also + * provide a Description, Tags, and a ClientRequestToken. You can choose + * whether or not the adapter should be AutoUpdated with the AutoUpdate + * argument. By default, AutoUpdate is set to DISABLED. + *

+ * + * @param createAdapterRequest + * @return A Java Future object containing the response from the + * CreateAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future createAdapterAsync(CreateAdapterRequest createAdapterRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Creates an adapter, which can be fine-tuned for enhanced performance on + * user provided documents. Takes an AdapterName and FeatureType. Currently + * the only supported feature type is QUERIES. You can also + * provide a Description, Tags, and a ClientRequestToken. You can choose + * whether or not the adapter should be AutoUpdated with the AutoUpdate + * argument. By default, AutoUpdate is set to DISABLED. + *

+ * + * @param createAdapterRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * CreateAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future createAdapterAsync(CreateAdapterRequest createAdapterRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Creates a new version of an adapter. Operates on a provided AdapterId and + * a specified dataset provided via the DatasetConfig argument. Requires + * that you specify an Amazon S3 bucket with the OutputConfig argument. You + * can provide an optional KMSKeyId, an optional ClientRequestToken, and + * optional tags. + *

+ * + * @param createAdapterVersionRequest + * @return A Java Future object containing the response from the + * CreateAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future createAdapterVersionAsync( + CreateAdapterVersionRequest createAdapterVersionRequest) throws AmazonServiceException, + AmazonClientException; + + /** + *

+ * Creates a new version of an adapter. Operates on a provided AdapterId and + * a specified dataset provided via the DatasetConfig argument. Requires + * that you specify an Amazon S3 bucket with the OutputConfig argument. You + * can provide an optional KMSKeyId, an optional ClientRequestToken, and + * optional tags. + *

+ * + * @param createAdapterVersionRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * CreateAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future createAdapterVersionAsync( + CreateAdapterVersionRequest createAdapterVersionRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Deletes an Amazon Textract adapter. Takes an AdapterId and deletes the + * adapter specified by the ID. + *

+ * + * @param deleteAdapterRequest + * @return A Java Future object containing the response from the + * DeleteAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future deleteAdapterAsync(DeleteAdapterRequest deleteAdapterRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Deletes an Amazon Textract adapter. Takes an AdapterId and deletes the + * adapter specified by the ID. + *

+ * + * @param deleteAdapterRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * DeleteAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future deleteAdapterAsync(DeleteAdapterRequest deleteAdapterRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Deletes an Amazon Textract adapter version. Requires that you specify + * both an AdapterId and a AdapterVersion. Deletes the adapter version + * specified by the AdapterId and the AdapterVersion. + *

+ * + * @param deleteAdapterVersionRequest + * @return A Java Future object containing the response from the + * DeleteAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future deleteAdapterVersionAsync( + DeleteAdapterVersionRequest deleteAdapterVersionRequest) throws AmazonServiceException, + AmazonClientException; + + /** + *

+ * Deletes an Amazon Textract adapter version. Requires that you specify + * both an AdapterId and a AdapterVersion. Deletes the adapter version + * specified by the AdapterId and the AdapterVersion. + *

+ * + * @param deleteAdapterVersionRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * DeleteAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future deleteAdapterVersionAsync( + DeleteAdapterVersionRequest deleteAdapterVersionRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + /** *

* Detects text in the input document. Amazon Textract can detect lines of @@ -511,9 +793,135 @@ Future detectDocumentTextAsync( * Textract indicating either a problem with the data in the * request, or a server side issue. */ - Future detectDocumentTextAsync( - DetectDocumentTextRequest detectDocumentTextRequest, - AsyncHandler asyncHandler) + Future detectDocumentTextAsync( + DetectDocumentTextRequest detectDocumentTextRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Gets configuration information for an adapter specified by an AdapterId, + * returning information on AdapterName, Description, CreationTime, + * AutoUpdate status, and FeatureTypes. + *

+ * + * @param getAdapterRequest + * @return A Java Future object containing the response from the GetAdapter + * service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getAdapterAsync(GetAdapterRequest getAdapterRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Gets configuration information for an adapter specified by an AdapterId, + * returning information on AdapterName, Description, CreationTime, + * AutoUpdate status, and FeatureTypes. + *

+ * + * @param getAdapterRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the GetAdapter + * service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getAdapterAsync(GetAdapterRequest getAdapterRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Gets configuration information for the specified adapter version, + * including: AdapterId, AdapterVersion, FeatureTypes, Status, + * StatusMessage, DatasetConfig, KMSKeyId, OutputConfig, Tags and + * EvaluationMetrics. + *

+ * + * @param getAdapterVersionRequest + * @return A Java Future object containing the response from the + * GetAdapterVersion service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getAdapterVersionAsync( + GetAdapterVersionRequest getAdapterVersionRequest) throws AmazonServiceException, + AmazonClientException; + + /** + *

+ * Gets configuration information for the specified adapter version, + * including: AdapterId, AdapterVersion, FeatureTypes, Status, + * StatusMessage, DatasetConfig, KMSKeyId, OutputConfig, Tags and + * EvaluationMetrics. + *

+ * + * @param getAdapterVersionRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * GetAdapterVersion service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getAdapterVersionAsync( + GetAdapterVersionRequest getAdapterVersionRequest, + AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException; /** @@ -991,27 +1399,286 @@ Future getExpenseAnalysisAsync( * call to GetExpenseAnalysis. *

*

- * For more information, see Analyzing Invoices and Receipts. + * For more information, see Analyzing Invoices and Receipts. + *

+ * + * @param getExpenseAnalysisRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * GetExpenseAnalysis service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InvalidJobIdException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getExpenseAnalysisAsync( + GetExpenseAnalysisRequest getExpenseAnalysisRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Gets the results for an Amazon Textract asynchronous operation that + * analyzes text in a lending document. + *

+ *

+ * You start asynchronous text analysis by calling + * StartLendingAnalysis, which returns a job identifier ( + * JobId). When the text analysis operation finishes, Amazon + * Textract publishes a completion status to the Amazon Simple Notification + * Service (Amazon SNS) topic that's registered in the initial call to + * StartLendingAnalysis. + *

+ *

+ * To get the results of the text analysis operation, first check that the + * status value published to the Amazon SNS topic is SUCCEEDED. If so, call + * GetLendingAnalysis, and pass the job identifier (JobId) from + * the initial call to StartLendingAnalysis. + *

+ * + * @param getLendingAnalysisRequest + * @return A Java Future object containing the response from the + * GetLendingAnalysis service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InvalidJobIdException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getLendingAnalysisAsync( + GetLendingAnalysisRequest getLendingAnalysisRequest) throws AmazonServiceException, + AmazonClientException; + + /** + *

+ * Gets the results for an Amazon Textract asynchronous operation that + * analyzes text in a lending document. + *

+ *

+ * You start asynchronous text analysis by calling + * StartLendingAnalysis, which returns a job identifier ( + * JobId). When the text analysis operation finishes, Amazon + * Textract publishes a completion status to the Amazon Simple Notification + * Service (Amazon SNS) topic that's registered in the initial call to + * StartLendingAnalysis. + *

+ *

+ * To get the results of the text analysis operation, first check that the + * status value published to the Amazon SNS topic is SUCCEEDED. If so, call + * GetLendingAnalysis, and pass the job identifier (JobId) from + * the initial call to StartLendingAnalysis. + *

+ * + * @param getLendingAnalysisRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * GetLendingAnalysis service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InvalidJobIdException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getLendingAnalysisAsync( + GetLendingAnalysisRequest getLendingAnalysisRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Gets summarized results for the StartLendingAnalysis + * operation, which analyzes text in a lending document. The returned + * summary consists of information about documents grouped together by a + * common document type. Information like detected signatures, page numbers, + * and split documents is returned with respect to the type of grouped + * document. + *

+ *

+ * You start asynchronous text analysis by calling + * StartLendingAnalysis, which returns a job identifier ( + * JobId). When the text analysis operation finishes, Amazon + * Textract publishes a completion status to the Amazon Simple Notification + * Service (Amazon SNS) topic that's registered in the initial call to + * StartLendingAnalysis. + *

+ *

+ * To get the results of the text analysis operation, first check that the + * status value published to the Amazon SNS topic is SUCCEEDED. If so, call + * GetLendingAnalysisSummary, and pass the job identifier ( + * JobId) from the initial call to + * StartLendingAnalysis. + *

+ * + * @param getLendingAnalysisSummaryRequest + * @return A Java Future object containing the response from the + * GetLendingAnalysisSummary service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InvalidJobIdException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getLendingAnalysisSummaryAsync( + GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Gets summarized results for the StartLendingAnalysis + * operation, which analyzes text in a lending document. The returned + * summary consists of information about documents grouped together by a + * common document type. Information like detected signatures, page numbers, + * and split documents is returned with respect to the type of grouped + * document. + *

+ *

+ * You start asynchronous text analysis by calling + * StartLendingAnalysis, which returns a job identifier ( + * JobId). When the text analysis operation finishes, Amazon + * Textract publishes a completion status to the Amazon Simple Notification + * Service (Amazon SNS) topic that's registered in the initial call to + * StartLendingAnalysis. + *

+ *

+ * To get the results of the text analysis operation, first check that the + * status value published to the Amazon SNS topic is SUCCEEDED. If so, call + * GetLendingAnalysisSummary, and pass the job identifier ( + * JobId) from the initial call to + * StartLendingAnalysis. + *

+ * + * @param getLendingAnalysisSummaryRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * GetLendingAnalysisSummary service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InvalidJobIdException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future getLendingAnalysisSummaryAsync( + GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * List all version of an adapter that meet the specified filtration + * criteria. + *

+ * + * @param listAdapterVersionsRequest + * @return A Java Future object containing the response from the + * ListAdapterVersions service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future listAdapterVersionsAsync( + ListAdapterVersionsRequest listAdapterVersionsRequest) throws AmazonServiceException, + AmazonClientException; + + /** + *

+ * List all version of an adapter that meet the specified filtration + * criteria. *

* - * @param getExpenseAnalysisRequest + * @param listAdapterVersionsRequest * @param asyncHandler Asynchronous callback handler for events in the * life-cycle of the request. Users could provide the * implementation of the four callback methods in this interface * to process the operation result or handle the exception. * @return A Java Future object containing the response from the - * GetExpenseAnalysis service method, as returned by Amazon + * ListAdapterVersions service method, as returned by Amazon * Textract. * @throws InvalidParameterException * @throws AccessDeniedException * @throws ProvisionedThroughputExceededException - * @throws InvalidJobIdException * @throws InternalServerErrorException * @throws ThrottlingException - * @throws InvalidS3ObjectException - * @throws InvalidKMSKeyException + * @throws ValidationException + * @throws ResourceNotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1020,43 +1687,25 @@ Future getExpenseAnalysisAsync( * Textract indicating either a problem with the data in the * request, or a server side issue. */ - Future getExpenseAnalysisAsync( - GetExpenseAnalysisRequest getExpenseAnalysisRequest, - AsyncHandler asyncHandler) + Future listAdapterVersionsAsync( + ListAdapterVersionsRequest listAdapterVersionsRequest, + AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException; /** *

- * Gets the results for an Amazon Textract asynchronous operation that - * analyzes text in a lending document. - *

- *

- * You start asynchronous text analysis by calling - * StartLendingAnalysis, which returns a job identifier ( - * JobId). When the text analysis operation finishes, Amazon - * Textract publishes a completion status to the Amazon Simple Notification - * Service (Amazon SNS) topic that's registered in the initial call to - * StartLendingAnalysis. - *

- *

- * To get the results of the text analysis operation, first check that the - * status value published to the Amazon SNS topic is SUCCEEDED. If so, call - * GetLendingAnalysis, and pass the job identifier (JobId) from - * the initial call to StartLendingAnalysis. + * Lists all adapters that match the specified filtration criteria. *

* - * @param getLendingAnalysisRequest + * @param listAdaptersRequest * @return A Java Future object containing the response from the - * GetLendingAnalysis service method, as returned by Amazon - * Textract. + * ListAdapters service method, as returned by Amazon Textract. * @throws InvalidParameterException * @throws AccessDeniedException * @throws ProvisionedThroughputExceededException - * @throws InvalidJobIdException * @throws InternalServerErrorException * @throws ThrottlingException - * @throws InvalidS3ObjectException - * @throws InvalidKMSKeyException + * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1065,46 +1714,27 @@ Future getExpenseAnalysisAsync( * Textract indicating either a problem with the data in the * request, or a server side issue. */ - Future getLendingAnalysisAsync( - GetLendingAnalysisRequest getLendingAnalysisRequest) throws AmazonServiceException, - AmazonClientException; + Future listAdaptersAsync(ListAdaptersRequest listAdaptersRequest) + throws AmazonServiceException, AmazonClientException; /** *

- * Gets the results for an Amazon Textract asynchronous operation that - * analyzes text in a lending document. - *

- *

- * You start asynchronous text analysis by calling - * StartLendingAnalysis, which returns a job identifier ( - * JobId). When the text analysis operation finishes, Amazon - * Textract publishes a completion status to the Amazon Simple Notification - * Service (Amazon SNS) topic that's registered in the initial call to - * StartLendingAnalysis. - *

- *

- * To get the results of the text analysis operation, first check that the - * status value published to the Amazon SNS topic is SUCCEEDED. If so, call - * GetLendingAnalysis, and pass the job identifier (JobId) from - * the initial call to StartLendingAnalysis. + * Lists all adapters that match the specified filtration criteria. *

* - * @param getLendingAnalysisRequest + * @param listAdaptersRequest * @param asyncHandler Asynchronous callback handler for events in the * life-cycle of the request. Users could provide the * implementation of the four callback methods in this interface * to process the operation result or handle the exception. * @return A Java Future object containing the response from the - * GetLendingAnalysis service method, as returned by Amazon - * Textract. + * ListAdapters service method, as returned by Amazon Textract. * @throws InvalidParameterException * @throws AccessDeniedException * @throws ProvisionedThroughputExceededException - * @throws InvalidJobIdException * @throws InternalServerErrorException * @throws ThrottlingException - * @throws InvalidS3ObjectException - * @throws InvalidKMSKeyException + * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1113,48 +1743,26 @@ Future getLendingAnalysisAsync( * Textract indicating either a problem with the data in the * request, or a server side issue. */ - Future getLendingAnalysisAsync( - GetLendingAnalysisRequest getLendingAnalysisRequest, - AsyncHandler asyncHandler) + Future listAdaptersAsync(ListAdaptersRequest listAdaptersRequest, + AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException; /** *

- * Gets summarized results for the StartLendingAnalysis - * operation, which analyzes text in a lending document. The returned - * summary consists of information about documents grouped together by a - * common document type. Information like detected signatures, page numbers, - * and split documents is returned with respect to the type of grouped - * document. - *

- *

- * You start asynchronous text analysis by calling - * StartLendingAnalysis, which returns a job identifier ( - * JobId). When the text analysis operation finishes, Amazon - * Textract publishes a completion status to the Amazon Simple Notification - * Service (Amazon SNS) topic that's registered in the initial call to - * StartLendingAnalysis. - *

- *

- * To get the results of the text analysis operation, first check that the - * status value published to the Amazon SNS topic is SUCCEEDED. If so, call - * GetLendingAnalysisSummary, and pass the job identifier ( - * JobId) from the initial call to - * StartLendingAnalysis. + * Lists all tags for an Amazon Textract resource. *

* - * @param getLendingAnalysisSummaryRequest + * @param listTagsForResourceRequest * @return A Java Future object containing the response from the - * GetLendingAnalysisSummary service method, as returned by Amazon + * ListTagsForResource service method, as returned by Amazon * Textract. + * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws AccessDeniedException * @throws ProvisionedThroughputExceededException - * @throws InvalidJobIdException * @throws InternalServerErrorException * @throws ThrottlingException - * @throws InvalidS3ObjectException - * @throws InvalidKMSKeyException + * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1163,51 +1771,30 @@ Future getLendingAnalysisAsync( * Textract indicating either a problem with the data in the * request, or a server side issue. */ - Future getLendingAnalysisSummaryAsync( - GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest) - throws AmazonServiceException, AmazonClientException; + Future listTagsForResourceAsync( + ListTagsForResourceRequest listTagsForResourceRequest) throws AmazonServiceException, + AmazonClientException; /** *

- * Gets summarized results for the StartLendingAnalysis - * operation, which analyzes text in a lending document. The returned - * summary consists of information about documents grouped together by a - * common document type. Information like detected signatures, page numbers, - * and split documents is returned with respect to the type of grouped - * document. - *

- *

- * You start asynchronous text analysis by calling - * StartLendingAnalysis, which returns a job identifier ( - * JobId). When the text analysis operation finishes, Amazon - * Textract publishes a completion status to the Amazon Simple Notification - * Service (Amazon SNS) topic that's registered in the initial call to - * StartLendingAnalysis. - *

- *

- * To get the results of the text analysis operation, first check that the - * status value published to the Amazon SNS topic is SUCCEEDED. If so, call - * GetLendingAnalysisSummary, and pass the job identifier ( - * JobId) from the initial call to - * StartLendingAnalysis. + * Lists all tags for an Amazon Textract resource. *

* - * @param getLendingAnalysisSummaryRequest + * @param listTagsForResourceRequest * @param asyncHandler Asynchronous callback handler for events in the * life-cycle of the request. Users could provide the * implementation of the four callback methods in this interface * to process the operation result or handle the exception. * @return A Java Future object containing the response from the - * GetLendingAnalysisSummary service method, as returned by Amazon + * ListTagsForResource service method, as returned by Amazon * Textract. + * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws AccessDeniedException * @throws ProvisionedThroughputExceededException - * @throws InvalidJobIdException * @throws InternalServerErrorException * @throws ThrottlingException - * @throws InvalidS3ObjectException - * @throws InvalidKMSKeyException + * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1216,9 +1803,9 @@ Future getLendingAnalysisSummaryAsync( * Textract indicating either a problem with the data in the * request, or a server side issue. */ - Future getLendingAnalysisSummaryAsync( - GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest, - AsyncHandler asyncHandler) + Future listTagsForResourceAsync( + ListTagsForResourceRequest listTagsForResourceRequest, + AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException; /** @@ -1743,4 +2330,183 @@ Future startLendingAnalysisAsync( AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException; + /** + *

+ * Adds one or more tags to the specified resource. + *

+ * + * @param tagResourceRequest + * @return A Java Future object containing the response from the TagResource + * service method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws ServiceQuotaExceededException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future tagResourceAsync(TagResourceRequest tagResourceRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Adds one or more tags to the specified resource. + *

+ * + * @param tagResourceRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the TagResource + * service method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws ServiceQuotaExceededException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future tagResourceAsync(TagResourceRequest tagResourceRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Removes any tags with the specified keys from the specified resource. + *

+ * + * @param untagResourceRequest + * @return A Java Future object containing the response from the + * UntagResource service method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future untagResourceAsync(UntagResourceRequest untagResourceRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Removes any tags with the specified keys from the specified resource. + *

+ * + * @param untagResourceRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * UntagResource service method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future untagResourceAsync(UntagResourceRequest untagResourceRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Update the configuration for an adapter. FeatureTypes configurations + * cannot be updated. At least one new parameter must be specified as an + * argument. + *

+ * + * @param updateAdapterRequest + * @return A Java Future object containing the response from the + * UpdateAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future updateAdapterAsync(UpdateAdapterRequest updateAdapterRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Update the configuration for an adapter. FeatureTypes configurations + * cannot be updated. At least one new parameter must be specified as an + * argument. + *

+ * + * @param updateAdapterRequest + * @param asyncHandler Asynchronous callback handler for events in the + * life-cycle of the request. Users could provide the + * implementation of the four callback methods in this interface + * to process the operation result or handle the exception. + * @return A Java Future object containing the response from the + * UpdateAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + Future updateAdapterAsync(UpdateAdapterRequest updateAdapterRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + } diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsyncClient.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsyncClient.java index 0e3e7023c2c..ad6faa5998f 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsyncClient.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsyncClient.java @@ -686,6 +686,356 @@ public AnalyzeIDResult call() throws Exception { }); } + /** + *

+ * Creates an adapter, which can be fine-tuned for enhanced performance on + * user provided documents. Takes an AdapterName and FeatureType. Currently + * the only supported feature type is QUERIES. You can also + * provide a Description, Tags, and a ClientRequestToken. You can choose + * whether or not the adapter should be AutoUpdated with the AutoUpdate + * argument. By default, AutoUpdate is set to DISABLED. + *

+ * + * @param createAdapterRequest + * @return A Java Future object containing the response from the + * CreateAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future createAdapterAsync( + final CreateAdapterRequest createAdapterRequest) throws AmazonServiceException, + AmazonClientException { + return executorService.submit(new Callable() { + public CreateAdapterResult call() throws Exception { + return createAdapter(createAdapterRequest); + } + }); + } + + /** + *

+ * Creates an adapter, which can be fine-tuned for enhanced performance on + * user provided documents. Takes an AdapterName and FeatureType. Currently + * the only supported feature type is QUERIES. You can also + * provide a Description, Tags, and a ClientRequestToken. You can choose + * whether or not the adapter should be AutoUpdated with the AutoUpdate + * argument. By default, AutoUpdate is set to DISABLED. + *

+ * + * @param createAdapterRequest + * @return A Java Future object containing the response from the + * CreateAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future createAdapterAsync( + final CreateAdapterRequest createAdapterRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public CreateAdapterResult call() throws Exception { + CreateAdapterResult result = null; + try { + result = createAdapter(createAdapterRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(createAdapterRequest, result); + return result; + } + }); + } + + /** + *

+ * Creates a new version of an adapter. Operates on a provided AdapterId and + * a specified dataset provided via the DatasetConfig argument. Requires + * that you specify an Amazon S3 bucket with the OutputConfig argument. You + * can provide an optional KMSKeyId, an optional ClientRequestToken, and + * optional tags. + *

+ * + * @param createAdapterVersionRequest + * @return A Java Future object containing the response from the + * CreateAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future createAdapterVersionAsync( + final CreateAdapterVersionRequest createAdapterVersionRequest) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public CreateAdapterVersionResult call() throws Exception { + return createAdapterVersion(createAdapterVersionRequest); + } + }); + } + + /** + *

+ * Creates a new version of an adapter. Operates on a provided AdapterId and + * a specified dataset provided via the DatasetConfig argument. Requires + * that you specify an Amazon S3 bucket with the OutputConfig argument. You + * can provide an optional KMSKeyId, an optional ClientRequestToken, and + * optional tags. + *

+ * + * @param createAdapterVersionRequest + * @return A Java Future object containing the response from the + * CreateAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future createAdapterVersionAsync( + final CreateAdapterVersionRequest createAdapterVersionRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public CreateAdapterVersionResult call() throws Exception { + CreateAdapterVersionResult result = null; + try { + result = createAdapterVersion(createAdapterVersionRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(createAdapterVersionRequest, result); + return result; + } + }); + } + + /** + *

+ * Deletes an Amazon Textract adapter. Takes an AdapterId and deletes the + * adapter specified by the ID. + *

+ * + * @param deleteAdapterRequest + * @return A Java Future object containing the response from the + * DeleteAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future deleteAdapterAsync( + final DeleteAdapterRequest deleteAdapterRequest) throws AmazonServiceException, + AmazonClientException { + return executorService.submit(new Callable() { + public DeleteAdapterResult call() throws Exception { + return deleteAdapter(deleteAdapterRequest); + } + }); + } + + /** + *

+ * Deletes an Amazon Textract adapter. Takes an AdapterId and deletes the + * adapter specified by the ID. + *

+ * + * @param deleteAdapterRequest + * @return A Java Future object containing the response from the + * DeleteAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future deleteAdapterAsync( + final DeleteAdapterRequest deleteAdapterRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public DeleteAdapterResult call() throws Exception { + DeleteAdapterResult result = null; + try { + result = deleteAdapter(deleteAdapterRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(deleteAdapterRequest, result); + return result; + } + }); + } + + /** + *

+ * Deletes an Amazon Textract adapter version. Requires that you specify + * both an AdapterId and a AdapterVersion. Deletes the adapter version + * specified by the AdapterId and the AdapterVersion. + *

+ * + * @param deleteAdapterVersionRequest + * @return A Java Future object containing the response from the + * DeleteAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future deleteAdapterVersionAsync( + final DeleteAdapterVersionRequest deleteAdapterVersionRequest) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public DeleteAdapterVersionResult call() throws Exception { + return deleteAdapterVersion(deleteAdapterVersionRequest); + } + }); + } + + /** + *

+ * Deletes an Amazon Textract adapter version. Requires that you specify + * both an AdapterId and a AdapterVersion. Deletes the adapter version + * specified by the AdapterId and the AdapterVersion. + *

+ * + * @param deleteAdapterVersionRequest + * @return A Java Future object containing the response from the + * DeleteAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future deleteAdapterVersionAsync( + final DeleteAdapterVersionRequest deleteAdapterVersionRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public DeleteAdapterVersionResult call() throws Exception { + DeleteAdapterVersionResult result = null; + try { + result = deleteAdapterVersion(deleteAdapterVersionRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(deleteAdapterVersionRequest, result); + return result; + } + }); + } + /** *

* Detects text in the input document. Amazon Textract can detect lines of @@ -794,16 +1144,174 @@ public Future detectDocumentTextAsync( final DetectDocumentTextRequest detectDocumentTextRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { - return executorService.submit(new Callable() { - public DetectDocumentTextResult call() throws Exception { - DetectDocumentTextResult result = null; + return executorService.submit(new Callable() { + public DetectDocumentTextResult call() throws Exception { + DetectDocumentTextResult result = null; + try { + result = detectDocumentText(detectDocumentTextRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(detectDocumentTextRequest, result); + return result; + } + }); + } + + /** + *

+ * Gets configuration information for an adapter specified by an AdapterId, + * returning information on AdapterName, Description, CreationTime, + * AutoUpdate status, and FeatureTypes. + *

+ * + * @param getAdapterRequest + * @return A Java Future object containing the response from the GetAdapter + * service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future getAdapterAsync(final GetAdapterRequest getAdapterRequest) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public GetAdapterResult call() throws Exception { + return getAdapter(getAdapterRequest); + } + }); + } + + /** + *

+ * Gets configuration information for an adapter specified by an AdapterId, + * returning information on AdapterName, Description, CreationTime, + * AutoUpdate status, and FeatureTypes. + *

+ * + * @param getAdapterRequest + * @return A Java Future object containing the response from the GetAdapter + * service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future getAdapterAsync(final GetAdapterRequest getAdapterRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public GetAdapterResult call() throws Exception { + GetAdapterResult result = null; + try { + result = getAdapter(getAdapterRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(getAdapterRequest, result); + return result; + } + }); + } + + /** + *

+ * Gets configuration information for the specified adapter version, + * including: AdapterId, AdapterVersion, FeatureTypes, Status, + * StatusMessage, DatasetConfig, KMSKeyId, OutputConfig, Tags and + * EvaluationMetrics. + *

+ * + * @param getAdapterVersionRequest + * @return A Java Future object containing the response from the + * GetAdapterVersion service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future getAdapterVersionAsync( + final GetAdapterVersionRequest getAdapterVersionRequest) throws AmazonServiceException, + AmazonClientException { + return executorService.submit(new Callable() { + public GetAdapterVersionResult call() throws Exception { + return getAdapterVersion(getAdapterVersionRequest); + } + }); + } + + /** + *

+ * Gets configuration information for the specified adapter version, + * including: AdapterId, AdapterVersion, FeatureTypes, Status, + * StatusMessage, DatasetConfig, KMSKeyId, OutputConfig, Tags and + * EvaluationMetrics. + *

+ * + * @param getAdapterVersionRequest + * @return A Java Future object containing the response from the + * GetAdapterVersion service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future getAdapterVersionAsync( + final GetAdapterVersionRequest getAdapterVersionRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public GetAdapterVersionResult call() throws Exception { + GetAdapterVersionResult result = null; try { - result = detectDocumentText(detectDocumentTextRequest); + result = getAdapterVersion(getAdapterVersionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } - asyncHandler.onSuccess(detectDocumentTextRequest, result); + asyncHandler.onSuccess(getAdapterVersionRequest, result); return result; } }); @@ -1418,36 +1926,307 @@ public GetLendingAnalysisResult call() throws Exception { /** *

- * Gets the results for an Amazon Textract asynchronous operation that - * analyzes text in a lending document. - *

- *

- * You start asynchronous text analysis by calling - * StartLendingAnalysis, which returns a job identifier ( - * JobId). When the text analysis operation finishes, Amazon - * Textract publishes a completion status to the Amazon Simple Notification - * Service (Amazon SNS) topic that's registered in the initial call to - * StartLendingAnalysis. - *

- *

- * To get the results of the text analysis operation, first check that the - * status value published to the Amazon SNS topic is SUCCEEDED. If so, call - * GetLendingAnalysis, and pass the job identifier (JobId) from - * the initial call to StartLendingAnalysis. + * Gets the results for an Amazon Textract asynchronous operation that + * analyzes text in a lending document. + *

+ *

+ * You start asynchronous text analysis by calling + * StartLendingAnalysis, which returns a job identifier ( + * JobId). When the text analysis operation finishes, Amazon + * Textract publishes a completion status to the Amazon Simple Notification + * Service (Amazon SNS) topic that's registered in the initial call to + * StartLendingAnalysis. + *

+ *

+ * To get the results of the text analysis operation, first check that the + * status value published to the Amazon SNS topic is SUCCEEDED. If so, call + * GetLendingAnalysis, and pass the job identifier (JobId) from + * the initial call to StartLendingAnalysis. + *

+ * + * @param getLendingAnalysisRequest + * @return A Java Future object containing the response from the + * GetLendingAnalysis service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InvalidJobIdException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future getLendingAnalysisAsync( + final GetLendingAnalysisRequest getLendingAnalysisRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public GetLendingAnalysisResult call() throws Exception { + GetLendingAnalysisResult result = null; + try { + result = getLendingAnalysis(getLendingAnalysisRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(getLendingAnalysisRequest, result); + return result; + } + }); + } + + /** + *

+ * Gets summarized results for the StartLendingAnalysis + * operation, which analyzes text in a lending document. The returned + * summary consists of information about documents grouped together by a + * common document type. Information like detected signatures, page numbers, + * and split documents is returned with respect to the type of grouped + * document. + *

+ *

+ * You start asynchronous text analysis by calling + * StartLendingAnalysis, which returns a job identifier ( + * JobId). When the text analysis operation finishes, Amazon + * Textract publishes a completion status to the Amazon Simple Notification + * Service (Amazon SNS) topic that's registered in the initial call to + * StartLendingAnalysis. + *

+ *

+ * To get the results of the text analysis operation, first check that the + * status value published to the Amazon SNS topic is SUCCEEDED. If so, call + * GetLendingAnalysisSummary, and pass the job identifier ( + * JobId) from the initial call to + * StartLendingAnalysis. + *

+ * + * @param getLendingAnalysisSummaryRequest + * @return A Java Future object containing the response from the + * GetLendingAnalysisSummary service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InvalidJobIdException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future getLendingAnalysisSummaryAsync( + final GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public GetLendingAnalysisSummaryResult call() throws Exception { + return getLendingAnalysisSummary(getLendingAnalysisSummaryRequest); + } + }); + } + + /** + *

+ * Gets summarized results for the StartLendingAnalysis + * operation, which analyzes text in a lending document. The returned + * summary consists of information about documents grouped together by a + * common document type. Information like detected signatures, page numbers, + * and split documents is returned with respect to the type of grouped + * document. + *

+ *

+ * You start asynchronous text analysis by calling + * StartLendingAnalysis, which returns a job identifier ( + * JobId). When the text analysis operation finishes, Amazon + * Textract publishes a completion status to the Amazon Simple Notification + * Service (Amazon SNS) topic that's registered in the initial call to + * StartLendingAnalysis. + *

+ *

+ * To get the results of the text analysis operation, first check that the + * status value published to the Amazon SNS topic is SUCCEEDED. If so, call + * GetLendingAnalysisSummary, and pass the job identifier ( + * JobId) from the initial call to + * StartLendingAnalysis. + *

+ * + * @param getLendingAnalysisSummaryRequest + * @return A Java Future object containing the response from the + * GetLendingAnalysisSummary service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InvalidJobIdException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future getLendingAnalysisSummaryAsync( + final GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public GetLendingAnalysisSummaryResult call() throws Exception { + GetLendingAnalysisSummaryResult result = null; + try { + result = getLendingAnalysisSummary(getLendingAnalysisSummaryRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(getLendingAnalysisSummaryRequest, result); + return result; + } + }); + } + + /** + *

+ * List all version of an adapter that meet the specified filtration + * criteria. + *

+ * + * @param listAdapterVersionsRequest + * @return A Java Future object containing the response from the + * ListAdapterVersions service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future listAdapterVersionsAsync( + final ListAdapterVersionsRequest listAdapterVersionsRequest) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public ListAdapterVersionsResult call() throws Exception { + return listAdapterVersions(listAdapterVersionsRequest); + } + }); + } + + /** + *

+ * List all version of an adapter that meet the specified filtration + * criteria. + *

+ * + * @param listAdapterVersionsRequest + * @return A Java Future object containing the response from the + * ListAdapterVersions service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future listAdapterVersionsAsync( + final ListAdapterVersionsRequest listAdapterVersionsRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public ListAdapterVersionsResult call() throws Exception { + ListAdapterVersionsResult result = null; + try { + result = listAdapterVersions(listAdapterVersionsRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(listAdapterVersionsRequest, result); + return result; + } + }); + } + + /** + *

+ * Lists all adapters that match the specified filtration criteria. + *

+ * + * @param listAdaptersRequest + * @return A Java Future object containing the response from the + * ListAdapters service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future listAdaptersAsync( + final ListAdaptersRequest listAdaptersRequest) throws AmazonServiceException, + AmazonClientException { + return executorService.submit(new Callable() { + public ListAdaptersResult call() throws Exception { + return listAdapters(listAdaptersRequest); + } + }); + } + + /** + *

+ * Lists all adapters that match the specified filtration criteria. *

* - * @param getLendingAnalysisRequest + * @param listAdaptersRequest * @return A Java Future object containing the response from the - * GetLendingAnalysis service method, as returned by Amazon - * Textract. + * ListAdapters service method, as returned by Amazon Textract. * @throws InvalidParameterException * @throws AccessDeniedException * @throws ProvisionedThroughputExceededException - * @throws InvalidJobIdException * @throws InternalServerErrorException * @throws ThrottlingException - * @throws InvalidS3ObjectException - * @throws InvalidKMSKeyException + * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1456,20 +2235,20 @@ public GetLendingAnalysisResult call() throws Exception { * Textract indicating either a problem with the data in the * request, or a server side issue. */ - public Future getLendingAnalysisAsync( - final GetLendingAnalysisRequest getLendingAnalysisRequest, - final AsyncHandler asyncHandler) + public Future listAdaptersAsync( + final ListAdaptersRequest listAdaptersRequest, + final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { - return executorService.submit(new Callable() { - public GetLendingAnalysisResult call() throws Exception { - GetLendingAnalysisResult result = null; + return executorService.submit(new Callable() { + public ListAdaptersResult call() throws Exception { + ListAdaptersResult result = null; try { - result = getLendingAnalysis(getLendingAnalysisRequest); + result = listAdapters(listAdaptersRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } - asyncHandler.onSuccess(getLendingAnalysisRequest, result); + asyncHandler.onSuccess(listAdaptersRequest, result); return result; } }); @@ -1477,41 +2256,20 @@ public GetLendingAnalysisResult call() throws Exception { /** *

- * Gets summarized results for the StartLendingAnalysis - * operation, which analyzes text in a lending document. The returned - * summary consists of information about documents grouped together by a - * common document type. Information like detected signatures, page numbers, - * and split documents is returned with respect to the type of grouped - * document. - *

- *

- * You start asynchronous text analysis by calling - * StartLendingAnalysis, which returns a job identifier ( - * JobId). When the text analysis operation finishes, Amazon - * Textract publishes a completion status to the Amazon Simple Notification - * Service (Amazon SNS) topic that's registered in the initial call to - * StartLendingAnalysis. - *

- *

- * To get the results of the text analysis operation, first check that the - * status value published to the Amazon SNS topic is SUCCEEDED. If so, call - * GetLendingAnalysisSummary, and pass the job identifier ( - * JobId) from the initial call to - * StartLendingAnalysis. + * Lists all tags for an Amazon Textract resource. *

* - * @param getLendingAnalysisSummaryRequest + * @param listTagsForResourceRequest * @return A Java Future object containing the response from the - * GetLendingAnalysisSummary service method, as returned by Amazon + * ListTagsForResource service method, as returned by Amazon * Textract. + * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws AccessDeniedException * @throws ProvisionedThroughputExceededException - * @throws InvalidJobIdException * @throws InternalServerErrorException * @throws ThrottlingException - * @throws InvalidS3ObjectException - * @throws InvalidKMSKeyException + * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1520,53 +2278,32 @@ public GetLendingAnalysisResult call() throws Exception { * Textract indicating either a problem with the data in the * request, or a server side issue. */ - public Future getLendingAnalysisSummaryAsync( - final GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest) + public Future listTagsForResourceAsync( + final ListTagsForResourceRequest listTagsForResourceRequest) throws AmazonServiceException, AmazonClientException { - return executorService.submit(new Callable() { - public GetLendingAnalysisSummaryResult call() throws Exception { - return getLendingAnalysisSummary(getLendingAnalysisSummaryRequest); + return executorService.submit(new Callable() { + public ListTagsForResourceResult call() throws Exception { + return listTagsForResource(listTagsForResourceRequest); } }); } /** *

- * Gets summarized results for the StartLendingAnalysis - * operation, which analyzes text in a lending document. The returned - * summary consists of information about documents grouped together by a - * common document type. Information like detected signatures, page numbers, - * and split documents is returned with respect to the type of grouped - * document. - *

- *

- * You start asynchronous text analysis by calling - * StartLendingAnalysis, which returns a job identifier ( - * JobId). When the text analysis operation finishes, Amazon - * Textract publishes a completion status to the Amazon Simple Notification - * Service (Amazon SNS) topic that's registered in the initial call to - * StartLendingAnalysis. - *

- *

- * To get the results of the text analysis operation, first check that the - * status value published to the Amazon SNS topic is SUCCEEDED. If so, call - * GetLendingAnalysisSummary, and pass the job identifier ( - * JobId) from the initial call to - * StartLendingAnalysis. + * Lists all tags for an Amazon Textract resource. *

* - * @param getLendingAnalysisSummaryRequest + * @param listTagsForResourceRequest * @return A Java Future object containing the response from the - * GetLendingAnalysisSummary service method, as returned by Amazon + * ListTagsForResource service method, as returned by Amazon * Textract. + * @throws ResourceNotFoundException * @throws InvalidParameterException * @throws AccessDeniedException * @throws ProvisionedThroughputExceededException - * @throws InvalidJobIdException * @throws InternalServerErrorException * @throws ThrottlingException - * @throws InvalidS3ObjectException - * @throws InvalidKMSKeyException + * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is @@ -1575,20 +2312,20 @@ public GetLendingAnalysisSummaryResult call() throws Exception { * Textract indicating either a problem with the data in the * request, or a server side issue. */ - public Future getLendingAnalysisSummaryAsync( - final GetLendingAnalysisSummaryRequest getLendingAnalysisSummaryRequest, - final AsyncHandler asyncHandler) + public Future listTagsForResourceAsync( + final ListTagsForResourceRequest listTagsForResourceRequest, + final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { - return executorService.submit(new Callable() { - public GetLendingAnalysisSummaryResult call() throws Exception { - GetLendingAnalysisSummaryResult result = null; + return executorService.submit(new Callable() { + public ListTagsForResourceResult call() throws Exception { + ListTagsForResourceResult result = null; try { - result = getLendingAnalysisSummary(getLendingAnalysisSummaryRequest); + result = listTagsForResource(listTagsForResourceRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } - asyncHandler.onSuccess(getLendingAnalysisSummaryRequest, result); + asyncHandler.onSuccess(listTagsForResourceRequest, result); return result; } }); @@ -2180,4 +2917,235 @@ public StartLendingAnalysisResult call() throws Exception { }); } + /** + *

+ * Adds one or more tags to the specified resource. + *

+ * + * @param tagResourceRequest + * @return A Java Future object containing the response from the TagResource + * service method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws ServiceQuotaExceededException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future tagResourceAsync(final TagResourceRequest tagResourceRequest) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public TagResourceResult call() throws Exception { + return tagResource(tagResourceRequest); + } + }); + } + + /** + *

+ * Adds one or more tags to the specified resource. + *

+ * + * @param tagResourceRequest + * @return A Java Future object containing the response from the TagResource + * service method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws ServiceQuotaExceededException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future tagResourceAsync(final TagResourceRequest tagResourceRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public TagResourceResult call() throws Exception { + TagResourceResult result = null; + try { + result = tagResource(tagResourceRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(tagResourceRequest, result); + return result; + } + }); + } + + /** + *

+ * Removes any tags with the specified keys from the specified resource. + *

+ * + * @param untagResourceRequest + * @return A Java Future object containing the response from the + * UntagResource service method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future untagResourceAsync( + final UntagResourceRequest untagResourceRequest) throws AmazonServiceException, + AmazonClientException { + return executorService.submit(new Callable() { + public UntagResourceResult call() throws Exception { + return untagResource(untagResourceRequest); + } + }); + } + + /** + *

+ * Removes any tags with the specified keys from the specified resource. + *

+ * + * @param untagResourceRequest + * @return A Java Future object containing the response from the + * UntagResource service method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future untagResourceAsync( + final UntagResourceRequest untagResourceRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public UntagResourceResult call() throws Exception { + UntagResourceResult result = null; + try { + result = untagResource(untagResourceRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(untagResourceRequest, result); + return result; + } + }); + } + + /** + *

+ * Update the configuration for an adapter. FeatureTypes configurations + * cannot be updated. At least one new parameter must be specified as an + * argument. + *

+ * + * @param updateAdapterRequest + * @return A Java Future object containing the response from the + * UpdateAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future updateAdapterAsync( + final UpdateAdapterRequest updateAdapterRequest) throws AmazonServiceException, + AmazonClientException { + return executorService.submit(new Callable() { + public UpdateAdapterResult call() throws Exception { + return updateAdapter(updateAdapterRequest); + } + }); + } + + /** + *

+ * Update the configuration for an adapter. FeatureTypes configurations + * cannot be updated. At least one new parameter must be specified as an + * argument. + *

+ * + * @param updateAdapterRequest + * @return A Java Future object containing the response from the + * UpdateAdapter service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future updateAdapterAsync( + final UpdateAdapterRequest updateAdapterRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public UpdateAdapterResult call() throws Exception { + UpdateAdapterResult result = null; + try { + result = updateAdapter(updateAdapterRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(updateAdapterRequest, result); + return result; + } + }); + } + } diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractClient.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractClient.java index 4cffc550258..dcd0e7ea64c 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractClient.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractClient.java @@ -327,6 +327,7 @@ private void init() { jsonErrorUnmarshallers = new ArrayList(); jsonErrorUnmarshallers.add(new AccessDeniedExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new BadDocumentExceptionUnmarshaller()); + jsonErrorUnmarshallers.add(new ConflictExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new DocumentTooLargeExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new HumanLoopQuotaExceededExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new IdempotentParameterMismatchExceptionUnmarshaller()); @@ -337,8 +338,11 @@ private void init() { jsonErrorUnmarshallers.add(new InvalidS3ObjectExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new LimitExceededExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ProvisionedThroughputExceededExceptionUnmarshaller()); + jsonErrorUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller()); + jsonErrorUnmarshallers.add(new ServiceQuotaExceededExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ThrottlingExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new UnsupportedDocumentExceptionUnmarshaller()); + jsonErrorUnmarshallers.add(new ValidationExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new JsonErrorUnmarshaller()); // calling this.setEndPoint(...) will also modify the signer accordingly @@ -617,6 +621,243 @@ public AnalyzeIDResult analyzeID(AnalyzeIDRequest analyzeIDRequest) } } + /** + *

+ * Creates an adapter, which can be fine-tuned for enhanced performance on + * user provided documents. Takes an AdapterName and FeatureType. Currently + * the only supported feature type is QUERIES. You can also + * provide a Description, Tags, and a ClientRequestToken. You can choose + * whether or not the adapter should be AutoUpdated with the AutoUpdate + * argument. By default, AutoUpdate is set to DISABLED. + *

+ * + * @param createAdapterRequest + * @return createAdapterResult The response from the CreateAdapter service + * method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public CreateAdapterResult createAdapter(CreateAdapterRequest createAdapterRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(createAdapterRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new CreateAdapterRequestMarshaller().marshall(createAdapterRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new CreateAdapterResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Creates a new version of an adapter. Operates on a provided AdapterId and + * a specified dataset provided via the DatasetConfig argument. Requires + * that you specify an Amazon S3 bucket with the OutputConfig argument. You + * can provide an optional KMSKeyId, an optional ClientRequestToken, and + * optional tags. + *

+ * + * @param createAdapterVersionRequest + * @return createAdapterVersionResult The response from the + * CreateAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws InvalidS3ObjectException + * @throws InvalidKMSKeyException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws IdempotentParameterMismatchException + * @throws ThrottlingException + * @throws LimitExceededException + * @throws ValidationException + * @throws ServiceQuotaExceededException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public CreateAdapterVersionResult createAdapterVersion( + CreateAdapterVersionRequest createAdapterVersionRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(createAdapterVersionRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new CreateAdapterVersionRequestMarshaller() + .marshall(createAdapterVersionRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new CreateAdapterVersionResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Deletes an Amazon Textract adapter. Takes an AdapterId and deletes the + * adapter specified by the ID. + *

+ * + * @param deleteAdapterRequest + * @return deleteAdapterResult The response from the DeleteAdapter service + * method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public DeleteAdapterResult deleteAdapter(DeleteAdapterRequest deleteAdapterRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(deleteAdapterRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DeleteAdapterRequestMarshaller().marshall(deleteAdapterRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DeleteAdapterResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Deletes an Amazon Textract adapter version. Requires that you specify + * both an AdapterId and a AdapterVersion. Deletes the adapter version + * specified by the AdapterId and the AdapterVersion. + *

+ * + * @param deleteAdapterVersionRequest + * @return deleteAdapterVersionResult The response from the + * DeleteAdapterVersion service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public DeleteAdapterVersionResult deleteAdapterVersion( + DeleteAdapterVersionRequest deleteAdapterVersionRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(deleteAdapterVersionRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DeleteAdapterVersionRequestMarshaller() + .marshall(deleteAdapterVersionRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DeleteAdapterVersionResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

* Detects text in the input document. Amazon Textract can detect lines of @@ -694,6 +935,117 @@ public DetectDocumentTextResult detectDocumentText( } } + /** + *

+ * Gets configuration information for an adapter specified by an AdapterId, + * returning information on AdapterName, Description, CreationTime, + * AutoUpdate status, and FeatureTypes. + *

+ * + * @param getAdapterRequest + * @return getAdapterResult The response from the GetAdapter service method, + * as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public GetAdapterResult getAdapter(GetAdapterRequest getAdapterRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(getAdapterRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new GetAdapterRequestMarshaller().marshall(getAdapterRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new GetAdapterResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Gets configuration information for the specified adapter version, + * including: AdapterId, AdapterVersion, FeatureTypes, Status, + * StatusMessage, DatasetConfig, KMSKeyId, OutputConfig, Tags and + * EvaluationMetrics. + *

+ * + * @param getAdapterVersionRequest + * @return getAdapterVersionResult The response from the GetAdapterVersion + * service method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public GetAdapterVersionResult getAdapterVersion( + GetAdapterVersionRequest getAdapterVersionRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(getAdapterVersionRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new GetAdapterVersionRequestMarshaller() + .marshall(getAdapterVersionRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new GetAdapterVersionResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

* Gets the results for an Amazon Textract asynchronous operation that @@ -1167,6 +1519,168 @@ public GetLendingAnalysisSummaryResult getLendingAnalysisSummary( } } + /** + *

+ * List all version of an adapter that meet the specified filtration + * criteria. + *

+ * + * @param listAdapterVersionsRequest + * @return listAdapterVersionsResult The response from the + * ListAdapterVersions service method, as returned by Amazon + * Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public ListAdapterVersionsResult listAdapterVersions( + ListAdapterVersionsRequest listAdapterVersionsRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(listAdapterVersionsRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new ListAdapterVersionsRequestMarshaller() + .marshall(listAdapterVersionsRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new ListAdapterVersionsResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Lists all adapters that match the specified filtration criteria. + *

+ * + * @param listAdaptersRequest + * @return listAdaptersResult The response from the ListAdapters service + * method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public ListAdaptersResult listAdapters(ListAdaptersRequest listAdaptersRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(listAdaptersRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new ListAdaptersRequestMarshaller().marshall(listAdaptersRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new ListAdaptersResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Lists all tags for an Amazon Textract resource. + *

+ * + * @param listTagsForResourceRequest + * @return listTagsForResourceResult The response from the + * ListTagsForResource service method, as returned by Amazon + * Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public ListTagsForResourceResult listTagsForResource( + ListTagsForResourceRequest listTagsForResourceRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new ListTagsForResourceRequestMarshaller() + .marshall(listTagsForResourceRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new ListTagsForResourceResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

* Starts the asynchronous analysis of an input document for relationships @@ -1526,6 +2040,166 @@ public StartLendingAnalysisResult startLendingAnalysis( } } + /** + *

+ * Adds one or more tags to the specified resource. + *

+ * + * @param tagResourceRequest + * @return tagResourceResult The response from the TagResource service + * method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws ServiceQuotaExceededException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public TagResourceResult tagResource(TagResourceRequest tagResourceRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(tagResourceRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new TagResourceRequestMarshaller().marshall(tagResourceRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new TagResourceResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Removes any tags with the specified keys from the specified resource. + *

+ * + * @param untagResourceRequest + * @return untagResourceResult The response from the UntagResource service + * method, as returned by Amazon Textract. + * @throws ResourceNotFoundException + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(untagResourceRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new UntagResourceRequestMarshaller().marshall(untagResourceRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new UntagResourceResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

+ * Update the configuration for an adapter. FeatureTypes configurations + * cannot be updated. At least one new parameter must be specified as an + * argument. + *

+ * + * @param updateAdapterRequest + * @return updateAdapterResult The response from the UpdateAdapter service + * method, as returned by Amazon Textract. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws ConflictException + * @throws ProvisionedThroughputExceededException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ValidationException + * @throws ResourceNotFoundException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Textract indicating either a problem with the data in the + * request, or a server side issue. + */ + public UpdateAdapterResult updateAdapter(UpdateAdapterRequest updateAdapterRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(updateAdapterRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new UpdateAdapterRequestMarshaller().marshall(updateAdapterRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new UpdateAdapterResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** * Returns additional metadata for a previously executed successful, * request, typically used for debugging issues where a service isn't acting diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/Adapter.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/Adapter.java new file mode 100644 index 00000000000..9e80332a05d --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/Adapter.java @@ -0,0 +1,598 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +/** + *

+ * An adapter selected for use when analyzing documents. Contains an adapter ID + * and a version number. Contains information on pages selected for analysis + * when analyzing documents asychronously. + *

+ */ +public class Adapter implements Serializable { + /** + *

+ * A unique identifier for the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ */ + private String adapterId; + + /** + *

+ * Pages is a parameter that the user inputs to specify which pages to apply + * an adapter to. The following is a list of rules for using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's string: + * 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only element in the + * list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as ["1-3", "1-1", "4-*"]. + * Where * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal to the + * number of pages in the document. + *

    + *
  • + *
+ */ + private java.util.List pages; + + /** + *

+ * A string that identifies the version of the adapter. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ */ + private String version; + + /** + *

+ * A unique identifier for the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @return

+ * A unique identifier for the adapter resource. + *

+ */ + public String getAdapterId() { + return adapterId; + } + + /** + *

+ * A unique identifier for the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @param adapterId

+ * A unique identifier for the adapter resource. + *

+ */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

+ * A unique identifier for the adapter resource. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @param adapterId

+ * A unique identifier for the adapter resource. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public Adapter withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

+ * Pages is a parameter that the user inputs to specify which pages to apply + * an adapter to. The following is a list of rules for using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's string: + * 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only element in the + * list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as ["1-3", "1-1", "4-*"]. + * Where * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal to the + * number of pages in the document. + *

    + *
  • + *
+ * + * @return

+ * Pages is a parameter that the user inputs to specify which pages + * to apply an adapter to. The following is a list of rules for + * using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by + * default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's string: + * 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only element + * in the list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as + * ["1-3", "1-1", "4-*"]. Where * + * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal to + * the number of pages in the document. + *

    + *
  • + *
+ */ + public java.util.List getPages() { + return pages; + } + + /** + *

+ * Pages is a parameter that the user inputs to specify which pages to apply + * an adapter to. The following is a list of rules for using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's string: + * 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only element in the + * list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as ["1-3", "1-1", "4-*"]. + * Where * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal to the + * number of pages in the document. + *

    + *
  • + *
+ * + * @param pages

+ * Pages is a parameter that the user inputs to specify which + * pages to apply an adapter to. The following is a list of rules + * for using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by + * default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's + * string: 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is + * allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only + * element in the list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as + * ["1-3", "1-1", "4-*"]. Where * + * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal + * to the number of pages in the document. + *

    + *
  • + *
+ */ + public void setPages(java.util.Collection pages) { + if (pages == null) { + this.pages = null; + return; + } + + this.pages = new java.util.ArrayList(pages); + } + + /** + *

+ * Pages is a parameter that the user inputs to specify which pages to apply + * an adapter to. The following is a list of rules for using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's string: + * 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only element in the + * list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as ["1-3", "1-1", "4-*"]. + * Where * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal to the + * number of pages in the document. + *

    + *
  • + *
+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param pages

+ * Pages is a parameter that the user inputs to specify which + * pages to apply an adapter to. The following is a list of rules + * for using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by + * default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's + * string: 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is + * allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only + * element in the list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as + * ["1-3", "1-1", "4-*"]. Where * + * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal + * to the number of pages in the document. + *

    + *
  • + *
+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public Adapter withPages(String... pages) { + if (getPages() == null) { + this.pages = new java.util.ArrayList(pages.length); + } + for (String value : pages) { + this.pages.add(value); + } + return this; + } + + /** + *

+ * Pages is a parameter that the user inputs to specify which pages to apply + * an adapter to. The following is a list of rules for using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's string: + * 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only element in the + * list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as ["1-3", "1-1", "4-*"]. + * Where * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal to the + * number of pages in the document. + *

    + *
  • + *
+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param pages

+ * Pages is a parameter that the user inputs to specify which + * pages to apply an adapter to. The following is a list of rules + * for using this parameter. + *

+ *
    + *
  • + *

    + * If a page is not specified, it is set to ["1"] by + * default. + *

    + *
  • + *
  • + *

    + * The following characters are allowed in the parameter's + * string: 0 1 2 3 4 5 6 7 8 9 - *. No whitespace is + * allowed. + *

    + *
  • + *
  • + *

    + * When using * to indicate all pages, it must be the only + * element in the list. + *

    + *
  • + *
  • + *

    + * You can use page intervals, such as + * ["1-3", "1-1", "4-*"]. Where * + * indicates last page of document. + *

    + *
  • + *
  • + *

    + * Specified pages must be greater than 0 and less than or equal + * to the number of pages in the document. + *

    + *
  • + *
+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public Adapter withPages(java.util.Collection pages) { + setPages(pages); + return this; + } + + /** + *

+ * A string that identifies the version of the adapter. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * + * @return

+ * A string that identifies the version of the adapter. + *

+ */ + public String getVersion() { + return version; + } + + /** + *

+ * A string that identifies the version of the adapter. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * + * @param version

+ * A string that identifies the version of the adapter. + *

+ */ + public void setVersion(String version) { + this.version = version; + } + + /** + *

+ * A string that identifies the version of the adapter. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * + * @param version

+ * A string that identifies the version of the adapter. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public Adapter withVersion(String version) { + this.version = version; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getPages() != null) + sb.append("Pages: " + getPages() + ","); + if (getVersion() != null) + sb.append("Version: " + getVersion()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + ((getPages() == null) ? 0 : getPages().hashCode()); + hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof Adapter == false) + return false; + Adapter other = (Adapter) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getPages() == null ^ this.getPages() == null) + return false; + if (other.getPages() != null && other.getPages().equals(this.getPages()) == false) + return false; + if (other.getVersion() == null ^ this.getVersion() == null) + return false; + if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterOverview.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterOverview.java new file mode 100644 index 00000000000..d97a2e9ef5e --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterOverview.java @@ -0,0 +1,363 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +/** + *

+ * Contains information on the adapter, including the adapter ID, Name, Creation + * time, and feature types. + *

+ */ +public class AdapterOverview implements Serializable { + /** + *

+ * A unique identifier for the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ */ + private String adapterId; + + /** + *

+ * A string naming the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9-_]+
+ */ + private String adapterName; + + /** + *

+ * The date and time that the adapter was created. + *

+ */ + private java.util.Date creationTime; + + /** + *

+ * The feature types that the adapter is operating on. + *

+ */ + private java.util.List featureTypes; + + /** + *

+ * A unique identifier for the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @return

+ * A unique identifier for the adapter resource. + *

+ */ + public String getAdapterId() { + return adapterId; + } + + /** + *

+ * A unique identifier for the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @param adapterId

+ * A unique identifier for the adapter resource. + *

+ */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

+ * A unique identifier for the adapter resource. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @param adapterId

+ * A unique identifier for the adapter resource. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterOverview withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

+ * A string naming the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9-_]+
+ * + * @return

+ * A string naming the adapter resource. + *

+ */ + public String getAdapterName() { + return adapterName; + } + + /** + *

+ * A string naming the adapter resource. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9-_]+
+ * + * @param adapterName

+ * A string naming the adapter resource. + *

+ */ + public void setAdapterName(String adapterName) { + this.adapterName = adapterName; + } + + /** + *

+ * A string naming the adapter resource. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * Pattern: [a-zA-Z0-9-_]+
+ * + * @param adapterName

+ * A string naming the adapter resource. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterOverview withAdapterName(String adapterName) { + this.adapterName = adapterName; + return this; + } + + /** + *

+ * The date and time that the adapter was created. + *

+ * + * @return

+ * The date and time that the adapter was created. + *

+ */ + public java.util.Date getCreationTime() { + return creationTime; + } + + /** + *

+ * The date and time that the adapter was created. + *

+ * + * @param creationTime

+ * The date and time that the adapter was created. + *

+ */ + public void setCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + } + + /** + *

+ * The date and time that the adapter was created. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param creationTime

+ * The date and time that the adapter was created. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterOverview withCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + *

+ * The feature types that the adapter is operating on. + *

+ * + * @return

+ * The feature types that the adapter is operating on. + *

+ */ + public java.util.List getFeatureTypes() { + return featureTypes; + } + + /** + *

+ * The feature types that the adapter is operating on. + *

+ * + * @param featureTypes

+ * The feature types that the adapter is operating on. + *

+ */ + public void setFeatureTypes(java.util.Collection featureTypes) { + if (featureTypes == null) { + this.featureTypes = null; + return; + } + + this.featureTypes = new java.util.ArrayList(featureTypes); + } + + /** + *

+ * The feature types that the adapter is operating on. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

+ * The feature types that the adapter is operating on. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterOverview withFeatureTypes(String... featureTypes) { + if (getFeatureTypes() == null) { + this.featureTypes = new java.util.ArrayList(featureTypes.length); + } + for (String value : featureTypes) { + this.featureTypes.add(value); + } + return this; + } + + /** + *

+ * The feature types that the adapter is operating on. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

+ * The feature types that the adapter is operating on. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterOverview withFeatureTypes(java.util.Collection featureTypes) { + setFeatureTypes(featureTypes); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAdapterName() != null) + sb.append("AdapterName: " + getAdapterName() + ","); + if (getCreationTime() != null) + sb.append("CreationTime: " + getCreationTime() + ","); + if (getFeatureTypes() != null) + sb.append("FeatureTypes: " + getFeatureTypes()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAdapterName() == null) ? 0 : getAdapterName().hashCode()); + hashCode = prime * hashCode + + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); + hashCode = prime * hashCode + + ((getFeatureTypes() == null) ? 0 : getFeatureTypes().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof AdapterOverview == false) + return false; + AdapterOverview other = (AdapterOverview) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAdapterName() == null ^ this.getAdapterName() == null) + return false; + if (other.getAdapterName() != null + && other.getAdapterName().equals(this.getAdapterName()) == false) + return false; + if (other.getCreationTime() == null ^ this.getCreationTime() == null) + return false; + if (other.getCreationTime() != null + && other.getCreationTime().equals(this.getCreationTime()) == false) + return false; + if (other.getFeatureTypes() == null ^ this.getFeatureTypes() == null) + return false; + if (other.getFeatureTypes() != null + && other.getFeatureTypes().equals(this.getFeatureTypes()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionDatasetConfig.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionDatasetConfig.java new file mode 100644 index 00000000000..a6ca321686e --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionDatasetConfig.java @@ -0,0 +1,182 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +/** + *

+ * The dataset configuration options for a given version of an adapter. Can + * include an Amazon S3 bucket if specified. + *

+ */ +public class AdapterVersionDatasetConfig implements Serializable { + /** + *

+ * The S3 bucket name and file name that identifies the document. + *

+ *

+ * The AWS Region for the S3 bucket that contains the document must match + * the Region that you use for Amazon Textract operations. + *

+ *

+ * For Amazon Textract to process a file in an S3 bucket, the user must have + * permission to access the S3 bucket and file. + *

+ */ + private S3Object manifestS3Object; + + /** + *

+ * The S3 bucket name and file name that identifies the document. + *

+ *

+ * The AWS Region for the S3 bucket that contains the document must match + * the Region that you use for Amazon Textract operations. + *

+ *

+ * For Amazon Textract to process a file in an S3 bucket, the user must have + * permission to access the S3 bucket and file. + *

+ * + * @return

+ * The S3 bucket name and file name that identifies the document. + *

+ *

+ * The AWS Region for the S3 bucket that contains the document must + * match the Region that you use for Amazon Textract operations. + *

+ *

+ * For Amazon Textract to process a file in an S3 bucket, the user + * must have permission to access the S3 bucket and file. + *

+ */ + public S3Object getManifestS3Object() { + return manifestS3Object; + } + + /** + *

+ * The S3 bucket name and file name that identifies the document. + *

+ *

+ * The AWS Region for the S3 bucket that contains the document must match + * the Region that you use for Amazon Textract operations. + *

+ *

+ * For Amazon Textract to process a file in an S3 bucket, the user must have + * permission to access the S3 bucket and file. + *

+ * + * @param manifestS3Object

+ * The S3 bucket name and file name that identifies the document. + *

+ *

+ * The AWS Region for the S3 bucket that contains the document + * must match the Region that you use for Amazon Textract + * operations. + *

+ *

+ * For Amazon Textract to process a file in an S3 bucket, the + * user must have permission to access the S3 bucket and file. + *

+ */ + public void setManifestS3Object(S3Object manifestS3Object) { + this.manifestS3Object = manifestS3Object; + } + + /** + *

+ * The S3 bucket name and file name that identifies the document. + *

+ *

+ * The AWS Region for the S3 bucket that contains the document must match + * the Region that you use for Amazon Textract operations. + *

+ *

+ * For Amazon Textract to process a file in an S3 bucket, the user must have + * permission to access the S3 bucket and file. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param manifestS3Object

+ * The S3 bucket name and file name that identifies the document. + *

+ *

+ * The AWS Region for the S3 bucket that contains the document + * must match the Region that you use for Amazon Textract + * operations. + *

+ *

+ * For Amazon Textract to process a file in an S3 bucket, the + * user must have permission to access the S3 bucket and file. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionDatasetConfig withManifestS3Object(S3Object manifestS3Object) { + this.manifestS3Object = manifestS3Object; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getManifestS3Object() != null) + sb.append("ManifestS3Object: " + getManifestS3Object()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getManifestS3Object() == null) ? 0 : getManifestS3Object().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof AdapterVersionDatasetConfig == false) + return false; + AdapterVersionDatasetConfig other = (AdapterVersionDatasetConfig) obj; + + if (other.getManifestS3Object() == null ^ this.getManifestS3Object() == null) + return false; + if (other.getManifestS3Object() != null + && other.getManifestS3Object().equals(this.getManifestS3Object()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionEvaluationMetric.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionEvaluationMetric.java new file mode 100644 index 00000000000..4bc4dc2a9a0 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionEvaluationMetric.java @@ -0,0 +1,311 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +/** + *

+ * Contains information on the metrics used to evalute the peformance of a given + * adapter version. Includes data for baseline model performance and individual + * adapter version perfromance. + *

+ */ +public class AdapterVersionEvaluationMetric implements Serializable { + /** + *

+ * The F1 score, precision, and recall metrics for the baseline model. + *

+ */ + private EvaluationMetric baseline; + + /** + *

+ * The F1 score, precision, and recall metrics for the baseline model. + *

+ */ + private EvaluationMetric adapterVersion; + + /** + *

+ * Indicates the feature type being analyzed by a given adapter version. + *

+ *

+ * Constraints:
+ * Allowed Values: TABLES, FORMS, QUERIES, SIGNATURES, LAYOUT + */ + private String featureType; + + /** + *

+ * The F1 score, precision, and recall metrics for the baseline model. + *

+ * + * @return

+ * The F1 score, precision, and recall metrics for the baseline + * model. + *

+ */ + public EvaluationMetric getBaseline() { + return baseline; + } + + /** + *

+ * The F1 score, precision, and recall metrics for the baseline model. + *

+ * + * @param baseline

+ * The F1 score, precision, and recall metrics for the baseline + * model. + *

+ */ + public void setBaseline(EvaluationMetric baseline) { + this.baseline = baseline; + } + + /** + *

+ * The F1 score, precision, and recall metrics for the baseline model. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param baseline

+ * The F1 score, precision, and recall metrics for the baseline + * model. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionEvaluationMetric withBaseline(EvaluationMetric baseline) { + this.baseline = baseline; + return this; + } + + /** + *

+ * The F1 score, precision, and recall metrics for the baseline model. + *

+ * + * @return

+ * The F1 score, precision, and recall metrics for the baseline + * model. + *

+ */ + public EvaluationMetric getAdapterVersion() { + return adapterVersion; + } + + /** + *

+ * The F1 score, precision, and recall metrics for the baseline model. + *

+ * + * @param adapterVersion

+ * The F1 score, precision, and recall metrics for the baseline + * model. + *

+ */ + public void setAdapterVersion(EvaluationMetric adapterVersion) { + this.adapterVersion = adapterVersion; + } + + /** + *

+ * The F1 score, precision, and recall metrics for the baseline model. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adapterVersion

+ * The F1 score, precision, and recall metrics for the baseline + * model. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionEvaluationMetric withAdapterVersion(EvaluationMetric adapterVersion) { + this.adapterVersion = adapterVersion; + return this; + } + + /** + *

+ * Indicates the feature type being analyzed by a given adapter version. + *

+ *

+ * Constraints:
+ * Allowed Values: TABLES, FORMS, QUERIES, SIGNATURES, LAYOUT + * + * @return

+ * Indicates the feature type being analyzed by a given adapter + * version. + *

+ * @see FeatureType + */ + public String getFeatureType() { + return featureType; + } + + /** + *

+ * Indicates the feature type being analyzed by a given adapter version. + *

+ *

+ * Constraints:
+ * Allowed Values: TABLES, FORMS, QUERIES, SIGNATURES, LAYOUT + * + * @param featureType

+ * Indicates the feature type being analyzed by a given adapter + * version. + *

+ * @see FeatureType + */ + public void setFeatureType(String featureType) { + this.featureType = featureType; + } + + /** + *

+ * Indicates the feature type being analyzed by a given adapter version. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: TABLES, FORMS, QUERIES, SIGNATURES, LAYOUT + * + * @param featureType

+ * Indicates the feature type being analyzed by a given adapter + * version. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see FeatureType + */ + public AdapterVersionEvaluationMetric withFeatureType(String featureType) { + this.featureType = featureType; + return this; + } + + /** + *

+ * Indicates the feature type being analyzed by a given adapter version. + *

+ *

+ * Constraints:
+ * Allowed Values: TABLES, FORMS, QUERIES, SIGNATURES, LAYOUT + * + * @param featureType

+ * Indicates the feature type being analyzed by a given adapter + * version. + *

+ * @see FeatureType + */ + public void setFeatureType(FeatureType featureType) { + this.featureType = featureType.toString(); + } + + /** + *

+ * Indicates the feature type being analyzed by a given adapter version. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: TABLES, FORMS, QUERIES, SIGNATURES, LAYOUT + * + * @param featureType

+ * Indicates the feature type being analyzed by a given adapter + * version. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see FeatureType + */ + public AdapterVersionEvaluationMetric withFeatureType(FeatureType featureType) { + this.featureType = featureType.toString(); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getBaseline() != null) + sb.append("Baseline: " + getBaseline() + ","); + if (getAdapterVersion() != null) + sb.append("AdapterVersion: " + getAdapterVersion() + ","); + if (getFeatureType() != null) + sb.append("FeatureType: " + getFeatureType()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getBaseline() == null) ? 0 : getBaseline().hashCode()); + hashCode = prime * hashCode + + ((getAdapterVersion() == null) ? 0 : getAdapterVersion().hashCode()); + hashCode = prime * hashCode + + ((getFeatureType() == null) ? 0 : getFeatureType().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof AdapterVersionEvaluationMetric == false) + return false; + AdapterVersionEvaluationMetric other = (AdapterVersionEvaluationMetric) obj; + + if (other.getBaseline() == null ^ this.getBaseline() == null) + return false; + if (other.getBaseline() != null && other.getBaseline().equals(this.getBaseline()) == false) + return false; + if (other.getAdapterVersion() == null ^ this.getAdapterVersion() == null) + return false; + if (other.getAdapterVersion() != null + && other.getAdapterVersion().equals(this.getAdapterVersion()) == false) + return false; + if (other.getFeatureType() == null ^ this.getFeatureType() == null) + return false; + if (other.getFeatureType() != null + && other.getFeatureType().equals(this.getFeatureType()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionOverview.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionOverview.java new file mode 100644 index 00000000000..369f2fa85df --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionOverview.java @@ -0,0 +1,571 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +/** + *

+ * Summary info for an adapter version. Contains information on the AdapterId, + * AdapterVersion, CreationTime, FeatureTypes, and Status. + *

+ */ +public class AdapterVersionOverview implements Serializable { + /** + *

+ * A unique identifier for the adapter associated with a given adapter + * version. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ */ + private String adapterId; + + /** + *

+ * An identified for a given adapter version. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ */ + private String adapterVersion; + + /** + *

+ * The date and time that a given adapter version was created. + *

+ */ + private java.util.Date creationTime; + + /** + *

+ * The feature types that the adapter version is operating on. + *

+ */ + private java.util.List featureTypes; + + /** + *

+ * Contains information on the status of a given adapter version. + *

+ *

+ * Constraints:
+ * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + */ + private String status; + + /** + *

+ * A message explaining the status of a given adapter vesion. + *

+ *

+ * Constraints:
+ * Length: 1 - 256
+ * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
+ */ + private String statusMessage; + + /** + *

+ * A unique identifier for the adapter associated with a given adapter + * version. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @return

+ * A unique identifier for the adapter associated with a given + * adapter version. + *

+ */ + public String getAdapterId() { + return adapterId; + } + + /** + *

+ * A unique identifier for the adapter associated with a given adapter + * version. + *

+ *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @param adapterId

+ * A unique identifier for the adapter associated with a given + * adapter version. + *

+ */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

+ * A unique identifier for the adapter associated with a given adapter + * version. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 12 - 1011
+ * + * @param adapterId

+ * A unique identifier for the adapter associated with a given + * adapter version. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionOverview withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

+ * An identified for a given adapter version. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * + * @return

+ * An identified for a given adapter version. + *

+ */ + public String getAdapterVersion() { + return adapterVersion; + } + + /** + *

+ * An identified for a given adapter version. + *

+ *

+ * Constraints:
+ * Length: 1 - 128
+ * + * @param adapterVersion

+ * An identified for a given adapter version. + *

+ */ + public void setAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + } + + /** + *

+ * An identified for a given adapter version. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 128
+ * + * @param adapterVersion

+ * An identified for a given adapter version. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionOverview withAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + return this; + } + + /** + *

+ * The date and time that a given adapter version was created. + *

+ * + * @return

+ * The date and time that a given adapter version was created. + *

+ */ + public java.util.Date getCreationTime() { + return creationTime; + } + + /** + *

+ * The date and time that a given adapter version was created. + *

+ * + * @param creationTime

+ * The date and time that a given adapter version was created. + *

+ */ + public void setCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + } + + /** + *

+ * The date and time that a given adapter version was created. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param creationTime

+ * The date and time that a given adapter version was created. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionOverview withCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + *

+ * The feature types that the adapter version is operating on. + *

+ * + * @return

+ * The feature types that the adapter version is operating on. + *

+ */ + public java.util.List getFeatureTypes() { + return featureTypes; + } + + /** + *

+ * The feature types that the adapter version is operating on. + *

+ * + * @param featureTypes

+ * The feature types that the adapter version is operating on. + *

+ */ + public void setFeatureTypes(java.util.Collection featureTypes) { + if (featureTypes == null) { + this.featureTypes = null; + return; + } + + this.featureTypes = new java.util.ArrayList(featureTypes); + } + + /** + *

+ * The feature types that the adapter version is operating on. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

+ * The feature types that the adapter version is operating on. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionOverview withFeatureTypes(String... featureTypes) { + if (getFeatureTypes() == null) { + this.featureTypes = new java.util.ArrayList(featureTypes.length); + } + for (String value : featureTypes) { + this.featureTypes.add(value); + } + return this; + } + + /** + *

+ * The feature types that the adapter version is operating on. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

+ * The feature types that the adapter version is operating on. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionOverview withFeatureTypes(java.util.Collection featureTypes) { + setFeatureTypes(featureTypes); + return this; + } + + /** + *

+ * Contains information on the status of a given adapter version. + *

+ *

+ * Constraints:
+ * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @return

+ * Contains information on the status of a given adapter version. + *

+ * @see AdapterVersionStatus + */ + public String getStatus() { + return status; + } + + /** + *

+ * Contains information on the status of a given adapter version. + *

+ *

+ * Constraints:
+ * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @param status

+ * Contains information on the status of a given adapter version. + *

+ * @see AdapterVersionStatus + */ + public void setStatus(String status) { + this.status = status; + } + + /** + *

+ * Contains information on the status of a given adapter version. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @param status

+ * Contains information on the status of a given adapter version. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see AdapterVersionStatus + */ + public AdapterVersionOverview withStatus(String status) { + this.status = status; + return this; + } + + /** + *

+ * Contains information on the status of a given adapter version. + *

+ *

+ * Constraints:
+ * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @param status

+ * Contains information on the status of a given adapter version. + *

+ * @see AdapterVersionStatus + */ + public void setStatus(AdapterVersionStatus status) { + this.status = status.toString(); + } + + /** + *

+ * Contains information on the status of a given adapter version. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @param status

+ * Contains information on the status of a given adapter version. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see AdapterVersionStatus + */ + public AdapterVersionOverview withStatus(AdapterVersionStatus status) { + this.status = status.toString(); + return this; + } + + /** + *

+ * A message explaining the status of a given adapter vesion. + *

+ *

+ * Constraints:
+ * Length: 1 - 256
+ * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
+ * + * @return

+ * A message explaining the status of a given adapter vesion. + *

+ */ + public String getStatusMessage() { + return statusMessage; + } + + /** + *

+ * A message explaining the status of a given adapter vesion. + *

+ *

+ * Constraints:
+ * Length: 1 - 256
+ * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
+ * + * @param statusMessage

+ * A message explaining the status of a given adapter vesion. + *

+ */ + public void setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + } + + /** + *

+ * A message explaining the status of a given adapter vesion. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 1 - 256
+ * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
+ * + * @param statusMessage

+ * A message explaining the status of a given adapter vesion. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdapterVersionOverview withStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAdapterVersion() != null) + sb.append("AdapterVersion: " + getAdapterVersion() + ","); + if (getCreationTime() != null) + sb.append("CreationTime: " + getCreationTime() + ","); + if (getFeatureTypes() != null) + sb.append("FeatureTypes: " + getFeatureTypes() + ","); + if (getStatus() != null) + sb.append("Status: " + getStatus() + ","); + if (getStatusMessage() != null) + sb.append("StatusMessage: " + getStatusMessage()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAdapterVersion() == null) ? 0 : getAdapterVersion().hashCode()); + hashCode = prime * hashCode + + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); + hashCode = prime * hashCode + + ((getFeatureTypes() == null) ? 0 : getFeatureTypes().hashCode()); + hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); + hashCode = prime * hashCode + + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof AdapterVersionOverview == false) + return false; + AdapterVersionOverview other = (AdapterVersionOverview) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAdapterVersion() == null ^ this.getAdapterVersion() == null) + return false; + if (other.getAdapterVersion() != null + && other.getAdapterVersion().equals(this.getAdapterVersion()) == false) + return false; + if (other.getCreationTime() == null ^ this.getCreationTime() == null) + return false; + if (other.getCreationTime() != null + && other.getCreationTime().equals(this.getCreationTime()) == false) + return false; + if (other.getFeatureTypes() == null ^ this.getFeatureTypes() == null) + return false; + if (other.getFeatureTypes() != null + && other.getFeatureTypes().equals(this.getFeatureTypes()) == false) + return false; + if (other.getStatus() == null ^ this.getStatus() == null) + return false; + if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) + return false; + if (other.getStatusMessage() == null ^ this.getStatusMessage() == null) + return false; + if (other.getStatusMessage() != null + && other.getStatusMessage().equals(this.getStatusMessage()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionStatus.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionStatus.java new file mode 100644 index 00000000000..32ef042dadd --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdapterVersionStatus.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Adapter Version Status + */ +public enum AdapterVersionStatus { + + ACTIVE("ACTIVE"), + AT_RISK("AT_RISK"), + DEPRECATED("DEPRECATED"), + CREATION_ERROR("CREATION_ERROR"), + CREATION_IN_PROGRESS("CREATION_IN_PROGRESS"); + + private String value; + + private AdapterVersionStatus(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("ACTIVE", ACTIVE); + enumMap.put("AT_RISK", AT_RISK); + enumMap.put("DEPRECATED", DEPRECATED); + enumMap.put("CREATION_ERROR", CREATION_ERROR); + enumMap.put("CREATION_IN_PROGRESS", CREATION_IN_PROGRESS); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return AdapterVersionStatus corresponding to the value + */ + public static AdapterVersionStatus fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdaptersConfig.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdaptersConfig.java new file mode 100644 index 00000000000..3e725b33478 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AdaptersConfig.java @@ -0,0 +1,155 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +/** + *

+ * Contains information about adapters used when analyzing a document, with each + * adapter specified using an AdapterId and version + *

+ */ +public class AdaptersConfig implements Serializable { + /** + *

+ * A list of adapters to be used when analyzing the specified document. + *

+ */ + private java.util.List adapters; + + /** + *

+ * A list of adapters to be used when analyzing the specified document. + *

+ * + * @return

+ * A list of adapters to be used when analyzing the specified + * document. + *

+ */ + public java.util.List getAdapters() { + return adapters; + } + + /** + *

+ * A list of adapters to be used when analyzing the specified document. + *

+ * + * @param adapters

+ * A list of adapters to be used when analyzing the specified + * document. + *

+ */ + public void setAdapters(java.util.Collection adapters) { + if (adapters == null) { + this.adapters = null; + return; + } + + this.adapters = new java.util.ArrayList(adapters); + } + + /** + *

+ * A list of adapters to be used when analyzing the specified document. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adapters

+ * A list of adapters to be used when analyzing the specified + * document. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdaptersConfig withAdapters(Adapter... adapters) { + if (getAdapters() == null) { + this.adapters = new java.util.ArrayList(adapters.length); + } + for (Adapter value : adapters) { + this.adapters.add(value); + } + return this; + } + + /** + *

+ * A list of adapters to be used when analyzing the specified document. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adapters

+ * A list of adapters to be used when analyzing the specified + * document. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AdaptersConfig withAdapters(java.util.Collection adapters) { + setAdapters(adapters); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapters() != null) + sb.append("Adapters: " + getAdapters()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapters() == null) ? 0 : getAdapters().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof AdaptersConfig == false) + return false; + AdaptersConfig other = (AdaptersConfig) obj; + + if (other.getAdapters() == null ^ this.getAdapters() == null) + return false; + if (other.getAdapters() != null && other.getAdapters().equals(this.getAdapters()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AnalyzeDocumentRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AnalyzeDocumentRequest.java index c662e83c406..12869903a04 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AnalyzeDocumentRequest.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AnalyzeDocumentRequest.java @@ -116,12 +116,10 @@ public class AnalyzeDocumentRequest extends AmazonWebServiceRequest implements S * A list of the types of analysis to perform. Add TABLES to the list to * return information about the tables that are detected in the input * document. Add FORMS to return detected form data. Add SIGNATURES to - * return the locations of detected signatures. To perform both forms and - * table analysis, add TABLES and FORMS to FeatureTypes. To - * detect signatures within form data and table data, add SIGNATURES to - * either TABLES or FORMS. All lines and words detected in the document are - * included in the response (including text that isn't related to the value - * of FeatureTypes). + * return the locations of detected signatures. Add LAYOUT to the list to + * return information about the layout of the document. All lines and words + * detected in the document are included in the response (including text + * that isn't related to the value of FeatureTypes). *

*/ private java.util.List featureTypes; @@ -142,6 +140,13 @@ public class AnalyzeDocumentRequest extends AmazonWebServiceRequest implements S */ private QueriesConfig queriesConfig; + /** + *

+ * Specifies the adapter to be used when analyzing a document. + *

+ */ + private AdaptersConfig adaptersConfig; + /** *

* The input document as base64-encoded bytes or an Amazon S3 object. If you @@ -237,25 +242,21 @@ public AnalyzeDocumentRequest withDocument(Document document) { * A list of the types of analysis to perform. Add TABLES to the list to * return information about the tables that are detected in the input * document. Add FORMS to return detected form data. Add SIGNATURES to - * return the locations of detected signatures. To perform both forms and - * table analysis, add TABLES and FORMS to FeatureTypes. To - * detect signatures within form data and table data, add SIGNATURES to - * either TABLES or FORMS. All lines and words detected in the document are - * included in the response (including text that isn't related to the value - * of FeatureTypes). + * return the locations of detected signatures. Add LAYOUT to the list to + * return information about the layout of the document. All lines and words + * detected in the document are included in the response (including text + * that isn't related to the value of FeatureTypes). *

* * @return

* A list of the types of analysis to perform. Add TABLES to the * list to return information about the tables that are detected in * the input document. Add FORMS to return detected form data. Add - * SIGNATURES to return the locations of detected signatures. To - * perform both forms and table analysis, add TABLES and FORMS to - * FeatureTypes. To detect signatures within form data - * and table data, add SIGNATURES to either TABLES or FORMS. All - * lines and words detected in the document are included in the - * response (including text that isn't related to the value of - * FeatureTypes). + * SIGNATURES to return the locations of detected signatures. Add + * LAYOUT to the list to return information about the layout of the + * document. All lines and words detected in the document are + * included in the response (including text that isn't related to + * the value of FeatureTypes). *

*/ public java.util.List getFeatureTypes() { @@ -267,12 +268,10 @@ public java.util.List getFeatureTypes() { * A list of the types of analysis to perform. Add TABLES to the list to * return information about the tables that are detected in the input * document. Add FORMS to return detected form data. Add SIGNATURES to - * return the locations of detected signatures. To perform both forms and - * table analysis, add TABLES and FORMS to FeatureTypes. To - * detect signatures within form data and table data, add SIGNATURES to - * either TABLES or FORMS. All lines and words detected in the document are - * included in the response (including text that isn't related to the value - * of FeatureTypes). + * return the locations of detected signatures. Add LAYOUT to the list to + * return information about the layout of the document. All lines and words + * detected in the document are included in the response (including text + * that isn't related to the value of FeatureTypes). *

* * @param featureTypes

@@ -280,12 +279,10 @@ public java.util.List getFeatureTypes() { * list to return information about the tables that are detected * in the input document. Add FORMS to return detected form data. * Add SIGNATURES to return the locations of detected signatures. - * To perform both forms and table analysis, add TABLES and FORMS - * to FeatureTypes. To detect signatures within form - * data and table data, add SIGNATURES to either TABLES or FORMS. - * All lines and words detected in the document are included in - * the response (including text that isn't related to the value - * of FeatureTypes). + * Add LAYOUT to the list to return information about the layout + * of the document. All lines and words detected in the document + * are included in the response (including text that isn't + * related to the value of FeatureTypes). *

*/ public void setFeatureTypes(java.util.Collection featureTypes) { @@ -302,12 +299,10 @@ public void setFeatureTypes(java.util.Collection featureTypes) { * A list of the types of analysis to perform. Add TABLES to the list to * return information about the tables that are detected in the input * document. Add FORMS to return detected form data. Add SIGNATURES to - * return the locations of detected signatures. To perform both forms and - * table analysis, add TABLES and FORMS to FeatureTypes. To - * detect signatures within form data and table data, add SIGNATURES to - * either TABLES or FORMS. All lines and words detected in the document are - * included in the response (including text that isn't related to the value - * of FeatureTypes). + * return the locations of detected signatures. Add LAYOUT to the list to + * return information about the layout of the document. All lines and words + * detected in the document are included in the response (including text + * that isn't related to the value of FeatureTypes). *

*

* Returns a reference to this object so that method calls can be chained @@ -318,12 +313,10 @@ public void setFeatureTypes(java.util.Collection featureTypes) { * list to return information about the tables that are detected * in the input document. Add FORMS to return detected form data. * Add SIGNATURES to return the locations of detected signatures. - * To perform both forms and table analysis, add TABLES and FORMS - * to FeatureTypes. To detect signatures within form - * data and table data, add SIGNATURES to either TABLES or FORMS. - * All lines and words detected in the document are included in - * the response (including text that isn't related to the value - * of FeatureTypes). + * Add LAYOUT to the list to return information about the layout + * of the document. All lines and words detected in the document + * are included in the response (including text that isn't + * related to the value of FeatureTypes). *

* @return A reference to this updated object so that method calls can be * chained together. @@ -343,12 +336,10 @@ public AnalyzeDocumentRequest withFeatureTypes(String... featureTypes) { * A list of the types of analysis to perform. Add TABLES to the list to * return information about the tables that are detected in the input * document. Add FORMS to return detected form data. Add SIGNATURES to - * return the locations of detected signatures. To perform both forms and - * table analysis, add TABLES and FORMS to FeatureTypes. To - * detect signatures within form data and table data, add SIGNATURES to - * either TABLES or FORMS. All lines and words detected in the document are - * included in the response (including text that isn't related to the value - * of FeatureTypes). + * return the locations of detected signatures. Add LAYOUT to the list to + * return information about the layout of the document. All lines and words + * detected in the document are included in the response (including text + * that isn't related to the value of FeatureTypes). *

*

* Returns a reference to this object so that method calls can be chained @@ -359,12 +350,10 @@ public AnalyzeDocumentRequest withFeatureTypes(String... featureTypes) { * list to return information about the tables that are detected * in the input document. Add FORMS to return detected form data. * Add SIGNATURES to return the locations of detected signatures. - * To perform both forms and table analysis, add TABLES and FORMS - * to FeatureTypes. To detect signatures within form - * data and table data, add SIGNATURES to either TABLES or FORMS. - * All lines and words detected in the document are included in - * the response (including text that isn't related to the value - * of FeatureTypes). + * Add LAYOUT to the list to return information about the layout + * of the document. All lines and words detected in the document + * are included in the response (including text that isn't + * related to the value of FeatureTypes). *

* @return A reference to this updated object so that method calls can be * chained together. @@ -476,6 +465,51 @@ public AnalyzeDocumentRequest withQueriesConfig(QueriesConfig queriesConfig) { return this; } + /** + *

+ * Specifies the adapter to be used when analyzing a document. + *

+ * + * @return

+ * Specifies the adapter to be used when analyzing a document. + *

+ */ + public AdaptersConfig getAdaptersConfig() { + return adaptersConfig; + } + + /** + *

+ * Specifies the adapter to be used when analyzing a document. + *

+ * + * @param adaptersConfig

+ * Specifies the adapter to be used when analyzing a document. + *

+ */ + public void setAdaptersConfig(AdaptersConfig adaptersConfig) { + this.adaptersConfig = adaptersConfig; + } + + /** + *

+ * Specifies the adapter to be used when analyzing a document. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adaptersConfig

+ * Specifies the adapter to be used when analyzing a document. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AnalyzeDocumentRequest withAdaptersConfig(AdaptersConfig adaptersConfig) { + this.adaptersConfig = adaptersConfig; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -494,7 +528,9 @@ public String toString() { if (getHumanLoopConfig() != null) sb.append("HumanLoopConfig: " + getHumanLoopConfig() + ","); if (getQueriesConfig() != null) - sb.append("QueriesConfig: " + getQueriesConfig()); + sb.append("QueriesConfig: " + getQueriesConfig() + ","); + if (getAdaptersConfig() != null) + sb.append("AdaptersConfig: " + getAdaptersConfig()); sb.append("}"); return sb.toString(); } @@ -511,6 +547,8 @@ public int hashCode() { + ((getHumanLoopConfig() == null) ? 0 : getHumanLoopConfig().hashCode()); hashCode = prime * hashCode + ((getQueriesConfig() == null) ? 0 : getQueriesConfig().hashCode()); + hashCode = prime * hashCode + + ((getAdaptersConfig() == null) ? 0 : getAdaptersConfig().hashCode()); return hashCode; } @@ -544,6 +582,11 @@ public boolean equals(Object obj) { if (other.getQueriesConfig() != null && other.getQueriesConfig().equals(this.getQueriesConfig()) == false) return false; + if (other.getAdaptersConfig() == null ^ this.getAdaptersConfig() == null) + return false; + if (other.getAdaptersConfig() != null + && other.getAdaptersConfig().equals(this.getAdaptersConfig()) == false) + return false; return true; } } diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AutoUpdate.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AutoUpdate.java new file mode 100644 index 00000000000..f57b97e016c --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/AutoUpdate.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Auto Update + */ +public enum AutoUpdate { + + ENABLED("ENABLED"), + DISABLED("DISABLED"); + + private String value; + + private AutoUpdate(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("ENABLED", ENABLED); + enumMap.put("DISABLED", DISABLED); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return AutoUpdate corresponding to the value + */ + public static AutoUpdate fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/Block.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/Block.java index d3add547625..ded0aa2ad78 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/Block.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/Block.java @@ -139,7 +139,7 @@ public class Block implements Serializable { * *
  • *

    - * SIGNATURE - The location and confidene score of a signature + * SIGNATURE - The location and confidence score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *

    @@ -159,10 +159,74 @@ public class Block implements Serializable { *
  • * *

    + * The following BlockTypes are only returned for Amazon Textract Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections within a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an image in a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table in the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form key-values + * in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a part of + * paragraphs in documents. + *

      + *
    • + *
    + *

    * Constraints:
    * Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, - * TABLE_TITLE, TABLE_FOOTER + * TABLE_TITLE, TABLE_FOOTER, LAYOUT_TEXT, LAYOUT_TITLE, LAYOUT_HEADER, + * LAYOUT_FOOTER, LAYOUT_SECTION_HEADER, LAYOUT_PAGE_NUMBER, LAYOUT_LIST, + * LAYOUT_FIGURE, LAYOUT_TABLE, LAYOUT_KEY_VALUE */ private String blockType; @@ -367,9 +431,7 @@ public class Block implements Serializable { * scanned image (JPEG/PNG) provided to an asynchronous operation, even if * it contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of - * Page is always 1. Synchronous operations will also return a - * Page value of 1 because every input document is considered - * to be a single-page document. + * Page is always 1. *

    *

    * Constraints:
    @@ -480,7 +542,7 @@ public class Block implements Serializable { * *

  • *

    - * SIGNATURE - The location and confidene score of a signature + * SIGNATURE - The location and confidence score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *

    @@ -500,10 +562,74 @@ public class Block implements Serializable { *
  • * *

    + * The following BlockTypes are only returned for Amazon Textract Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections within a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an image in a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table in the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form key-values + * in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a part of + * paragraphs in documents. + *

      + *
    • + *
    + *

    * Constraints:
    * Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, - * TABLE_TITLE, TABLE_FOOTER + * TABLE_TITLE, TABLE_FOOTER, LAYOUT_TEXT, LAYOUT_TITLE, LAYOUT_HEADER, + * LAYOUT_FOOTER, LAYOUT_SECTION_HEADER, LAYOUT_PAGE_NUMBER, LAYOUT_LIST, + * LAYOUT_FIGURE, LAYOUT_TABLE, LAYOUT_KEY_VALUE * * @return

    * The type of text item that's recognized. In operations for text @@ -606,7 +732,7 @@ public class Block implements Serializable { * *

  • *

    - * SIGNATURE - The location and confidene score of a + * SIGNATURE - The location and confidence score of a * signature detected on a document page. Can be returned as part of * a Key-Value pair or a detected cell. *

    @@ -627,6 +753,71 @@ public class Block implements Serializable { *

    *
  • * + *

    + * The following BlockTypes are only returned for Amazon Textract + * Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of + * the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin of + * the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections + * within a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the + * documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in + * list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an image + * in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table in + * the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form + * key-values in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a + * part of paragraphs in documents. + *

      + *
    • + *
    * @see BlockType */ public String getBlockType() { @@ -731,7 +922,7 @@ public String getBlockType() { * *
  • *

    - * SIGNATURE - The location and confidene score of a signature + * SIGNATURE - The location and confidence score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *

    @@ -751,10 +942,74 @@ public String getBlockType() { *
  • * *

    + * The following BlockTypes are only returned for Amazon Textract Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections within a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an image in a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table in the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form key-values + * in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a part of + * paragraphs in documents. + *

      + *
    • + *
    + *

    * Constraints:
    * Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, - * TABLE_TITLE, TABLE_FOOTER + * TABLE_TITLE, TABLE_FOOTER, LAYOUT_TEXT, LAYOUT_TITLE, LAYOUT_HEADER, + * LAYOUT_FOOTER, LAYOUT_SECTION_HEADER, LAYOUT_PAGE_NUMBER, LAYOUT_LIST, + * LAYOUT_FIGURE, LAYOUT_TABLE, LAYOUT_KEY_VALUE * * @param blockType

    * The type of text item that's recognized. In operations for @@ -858,7 +1113,7 @@ public String getBlockType() { * *

  • *

    - * SIGNATURE - The location and confidene score of a + * SIGNATURE - The location and confidence score of a * signature detected on a document page. Can be returned as part * of a Key-Value pair or a detected cell. *

    @@ -879,6 +1134,71 @@ public String getBlockType() { *

    *
  • * + *

    + * The following BlockTypes are only returned for Amazon Textract + * Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of + * the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin + * of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections + * within a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the + * documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in + * list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an + * image in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table + * in the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form + * key-values in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a + * part of paragraphs in documents. + *

      + *
    • + *
    * @see BlockType */ public void setBlockType(String blockType) { @@ -983,7 +1303,7 @@ public void setBlockType(String blockType) { * *
  • *

    - * SIGNATURE - The location and confidene score of a signature + * SIGNATURE - The location and confidence score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *

    @@ -1003,13 +1323,77 @@ public void setBlockType(String blockType) { *
  • * *

    + * The following BlockTypes are only returned for Amazon Textract Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections within a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an image in a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table in the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form key-values + * in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a part of + * paragraphs in documents. + *

      + *
    • + *
    + *

    * Returns a reference to this object so that method calls can be chained * together. *

    * Constraints:
    * Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, - * TABLE_TITLE, TABLE_FOOTER + * TABLE_TITLE, TABLE_FOOTER, LAYOUT_TEXT, LAYOUT_TITLE, LAYOUT_HEADER, + * LAYOUT_FOOTER, LAYOUT_SECTION_HEADER, LAYOUT_PAGE_NUMBER, LAYOUT_LIST, + * LAYOUT_FIGURE, LAYOUT_TABLE, LAYOUT_KEY_VALUE * * @param blockType

    * The type of text item that's recognized. In operations for @@ -1113,7 +1497,7 @@ public void setBlockType(String blockType) { * *

  • *

    - * SIGNATURE - The location and confidene score of a + * SIGNATURE - The location and confidence score of a * signature detected on a document page. Can be returned as part * of a Key-Value pair or a detected cell. *

    @@ -1134,6 +1518,71 @@ public void setBlockType(String blockType) { *

    *
  • * + *

    + * The following BlockTypes are only returned for Amazon Textract + * Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of + * the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin + * of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections + * within a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the + * documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in + * list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an + * image in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table + * in the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form + * key-values in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a + * part of paragraphs in documents. + *

      + *
    • + *
    * @return A reference to this updated object so that method calls can be * chained together. * @see BlockType @@ -1241,7 +1690,7 @@ public Block withBlockType(String blockType) { * *
  • *

    - * SIGNATURE - The location and confidene score of a signature + * SIGNATURE - The location and confidence score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *

    @@ -1261,10 +1710,74 @@ public Block withBlockType(String blockType) { *
  • * *

    + * The following BlockTypes are only returned for Amazon Textract Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections within a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an image in a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table in the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form key-values + * in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a part of + * paragraphs in documents. + *

      + *
    • + *
    + *

    * Constraints:
    * Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, - * TABLE_TITLE, TABLE_FOOTER + * TABLE_TITLE, TABLE_FOOTER, LAYOUT_TEXT, LAYOUT_TITLE, LAYOUT_HEADER, + * LAYOUT_FOOTER, LAYOUT_SECTION_HEADER, LAYOUT_PAGE_NUMBER, LAYOUT_LIST, + * LAYOUT_FIGURE, LAYOUT_TABLE, LAYOUT_KEY_VALUE * * @param blockType

    * The type of text item that's recognized. In operations for @@ -1368,7 +1881,7 @@ public Block withBlockType(String blockType) { * *

  • *

    - * SIGNATURE - The location and confidene score of a + * SIGNATURE - The location and confidence score of a * signature detected on a document page. Can be returned as part * of a Key-Value pair or a detected cell. *

    @@ -1389,6 +1902,71 @@ public Block withBlockType(String blockType) { *

    *
  • * + *

    + * The following BlockTypes are only returned for Amazon Textract + * Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of + * the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin + * of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections + * within a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the + * documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in + * list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an + * image in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table + * in the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form + * key-values in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a + * part of paragraphs in documents. + *

      + *
    • + *
    * @see BlockType */ public void setBlockType(BlockType blockType) { @@ -1493,7 +2071,7 @@ public void setBlockType(BlockType blockType) { * *
  • *

    - * SIGNATURE - The location and confidene score of a signature + * SIGNATURE - The location and confidence score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *

    @@ -1513,13 +2091,77 @@ public void setBlockType(BlockType blockType) { *
  • * *

    + * The following BlockTypes are only returned for Amazon Textract Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin of the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections within a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an image in a + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table in the + * document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form key-values + * in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a part of + * paragraphs in documents. + *

      + *
    • + *
    + *

    * Returns a reference to this object so that method calls can be chained * together. *

    * Constraints:
    * Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, - * TABLE_TITLE, TABLE_FOOTER + * TABLE_TITLE, TABLE_FOOTER, LAYOUT_TEXT, LAYOUT_TITLE, LAYOUT_HEADER, + * LAYOUT_FOOTER, LAYOUT_SECTION_HEADER, LAYOUT_PAGE_NUMBER, LAYOUT_LIST, + * LAYOUT_FIGURE, LAYOUT_TABLE, LAYOUT_KEY_VALUE * * @param blockType

    * The type of text item that's recognized. In operations for @@ -1623,7 +2265,7 @@ public void setBlockType(BlockType blockType) { * *

  • *

    - * SIGNATURE - The location and confidene score of a + * SIGNATURE - The location and confidence score of a * signature detected on a document page. Can be returned as part * of a Key-Value pair or a detected cell. *

    @@ -1644,6 +2286,71 @@ public void setBlockType(BlockType blockType) { *

    *
  • * + *

    + * The following BlockTypes are only returned for Amazon Textract + * Layout. + *

    + *
      + *
    • + *

      + * LAYOUT_TITLE - The main title of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_HEADER - Text located in the top margin of + * the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_FOOTER - Text located in the bottom margin + * of the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_SECTION_HEADER - The titles of sections + * within a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_PAGE_NUMBER - The page number of the + * documents. + *

      + *
    • + *
    • + *

      + * LAYOUT_LIST - Any information grouped together in + * list form. + *

      + *
    • + *
    • + *

      + * LAYOUT_FIGURE - Indicates the location of an + * image in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TABLE - Indicates the location of a table + * in the document. + *

      + *
    • + *
    • + *

      + * LAYOUT_KEY_VALUE - Indicates the location of form + * key-values in a document. + *

      + *
    • + *
    • + *

      + * LAYOUT_TEXT - Text that is present typically as a + * part of paragraphs in documents. + *

      + *
    • + *
    * @return A reference to this updated object so that method calls can be * chained together. * @see BlockType @@ -3105,9 +3812,7 @@ public Block withSelectionStatus(SelectionStatus selectionStatus) { * scanned image (JPEG/PNG) provided to an asynchronous operation, even if * it contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of - * Page is always 1. Synchronous operations will also return a - * Page value of 1 because every input document is considered - * to be a single-page document. + * Page is always 1. *

    *

    * Constraints:
    @@ -3121,9 +3826,6 @@ public Block withSelectionStatus(SelectionStatus selectionStatus) { * asynchronous operation, even if it contains multiple document * pages, is considered a single-page document. This means that for * scanned images the value of Page is always 1. - * Synchronous operations will also return a Page value - * of 1 because every input document is considered to be a - * single-page document. *

    */ public Integer getPage() { @@ -3138,9 +3840,7 @@ public Integer getPage() { * scanned image (JPEG/PNG) provided to an asynchronous operation, even if * it contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of - * Page is always 1. Synchronous operations will also return a - * Page value of 1 because every input document is considered - * to be a single-page document. + * Page is always 1. *

    *

    * Constraints:
    @@ -3154,9 +3854,7 @@ public Integer getPage() { * (JPEG/PNG) provided to an asynchronous operation, even if it * contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of - * Page is always 1. Synchronous operations will - * also return a Page value of 1 because every input - * document is considered to be a single-page document. + * Page is always 1. *

    */ public void setPage(Integer page) { @@ -3171,9 +3869,7 @@ public void setPage(Integer page) { * scanned image (JPEG/PNG) provided to an asynchronous operation, even if * it contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of - * Page is always 1. Synchronous operations will also return a - * Page value of 1 because every input document is considered - * to be a single-page document. + * Page is always 1. *

    *

    * Returns a reference to this object so that method calls can be chained @@ -3190,9 +3886,7 @@ public void setPage(Integer page) { * (JPEG/PNG) provided to an asynchronous operation, even if it * contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of - * Page is always 1. Synchronous operations will - * also return a Page value of 1 because every input - * document is considered to be a single-page document. + * Page is always 1. *

    * @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/BlockType.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/BlockType.java index c4acf1ffb69..f723e2b39f8 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/BlockType.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/BlockType.java @@ -36,7 +36,17 @@ public enum BlockType { QUERY_RESULT("QUERY_RESULT"), SIGNATURE("SIGNATURE"), TABLE_TITLE("TABLE_TITLE"), - TABLE_FOOTER("TABLE_FOOTER"); + TABLE_FOOTER("TABLE_FOOTER"), + LAYOUT_TEXT("LAYOUT_TEXT"), + LAYOUT_TITLE("LAYOUT_TITLE"), + LAYOUT_HEADER("LAYOUT_HEADER"), + LAYOUT_FOOTER("LAYOUT_FOOTER"), + LAYOUT_SECTION_HEADER("LAYOUT_SECTION_HEADER"), + LAYOUT_PAGE_NUMBER("LAYOUT_PAGE_NUMBER"), + LAYOUT_LIST("LAYOUT_LIST"), + LAYOUT_FIGURE("LAYOUT_FIGURE"), + LAYOUT_TABLE("LAYOUT_TABLE"), + LAYOUT_KEY_VALUE("LAYOUT_KEY_VALUE"); private String value; @@ -66,6 +76,16 @@ public String toString() { enumMap.put("SIGNATURE", SIGNATURE); enumMap.put("TABLE_TITLE", TABLE_TITLE); enumMap.put("TABLE_FOOTER", TABLE_FOOTER); + enumMap.put("LAYOUT_TEXT", LAYOUT_TEXT); + enumMap.put("LAYOUT_TITLE", LAYOUT_TITLE); + enumMap.put("LAYOUT_HEADER", LAYOUT_HEADER); + enumMap.put("LAYOUT_FOOTER", LAYOUT_FOOTER); + enumMap.put("LAYOUT_SECTION_HEADER", LAYOUT_SECTION_HEADER); + enumMap.put("LAYOUT_PAGE_NUMBER", LAYOUT_PAGE_NUMBER); + enumMap.put("LAYOUT_LIST", LAYOUT_LIST); + enumMap.put("LAYOUT_FIGURE", LAYOUT_FIGURE); + enumMap.put("LAYOUT_TABLE", LAYOUT_TABLE); + enumMap.put("LAYOUT_KEY_VALUE", LAYOUT_KEY_VALUE); } /** diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ConflictException.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ConflictException.java new file mode 100644 index 00000000000..ff1c09f8f18 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ConflictException.java @@ -0,0 +1,36 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import com.amazonaws.AmazonServiceException; + +/** + *

    + * Updating or deleting a resource can cause an inconsistent state. + *

    + */ +public class ConflictException extends AmazonServiceException { + private static final long serialVersionUID = 1L; + + /** + * Constructs a new ConflictException with the specified error message. + * + * @param message Describes the error encountered. + */ + public ConflictException(String message) { + super(message); + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterRequest.java new file mode 100644 index 00000000000..b9a2f3bd8b0 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterRequest.java @@ -0,0 +1,641 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Creates an adapter, which can be fine-tuned for enhanced performance on user + * provided documents. Takes an AdapterName and FeatureType. Currently the only + * supported feature type is QUERIES. You can also provide a + * Description, Tags, and a ClientRequestToken. You can choose whether or not + * the adapter should be AutoUpdated with the AutoUpdate argument. By default, + * AutoUpdate is set to DISABLED. + *

    + */ +public class CreateAdapterRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The name to be assigned to the adapter being created. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + */ + private String adapterName; + + /** + *

    + * Idempotent token is used to recognize the request. If the same token is + * used with multiple CreateAdapter requests, the same session is returned. + * This token is employed to avoid unintentionally creating the same session + * multiple times. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + */ + private String clientRequestToken; + + /** + *

    + * The description to be assigned to the adapter being created. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + */ + private String description; + + /** + *

    + * The type of feature that the adapter is being trained on. Currrenly, + * supported feature types are: QUERIES + *

    + */ + private java.util.List featureTypes; + + /** + *

    + * Controls whether or not the adapter should automatically update. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + */ + private String autoUpdate; + + /** + *

    + * A list of tags to be added to the adapter. + *

    + */ + private java.util.Map tags; + + /** + *

    + * The name to be assigned to the adapter being created. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @return

    + * The name to be assigned to the adapter being created. + *

    + */ + public String getAdapterName() { + return adapterName; + } + + /** + *

    + * The name to be assigned to the adapter being created. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @param adapterName

    + * The name to be assigned to the adapter being created. + *

    + */ + public void setAdapterName(String adapterName) { + this.adapterName = adapterName; + } + + /** + *

    + * The name to be assigned to the adapter being created. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @param adapterName

    + * The name to be assigned to the adapter being created. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterRequest withAdapterName(String adapterName) { + this.adapterName = adapterName; + return this; + } + + /** + *

    + * Idempotent token is used to recognize the request. If the same token is + * used with multiple CreateAdapter requests, the same session is returned. + * This token is employed to avoid unintentionally creating the same session + * multiple times. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @return

    + * Idempotent token is used to recognize the request. If the same + * token is used with multiple CreateAdapter requests, the same + * session is returned. This token is employed to avoid + * unintentionally creating the same session multiple times. + *

    + */ + public String getClientRequestToken() { + return clientRequestToken; + } + + /** + *

    + * Idempotent token is used to recognize the request. If the same token is + * used with multiple CreateAdapter requests, the same session is returned. + * This token is employed to avoid unintentionally creating the same session + * multiple times. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token is used to recognize the request. If the same + * token is used with multiple CreateAdapter requests, the same + * session is returned. This token is employed to avoid + * unintentionally creating the same session multiple times. + *

    + */ + public void setClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + } + + /** + *

    + * Idempotent token is used to recognize the request. If the same token is + * used with multiple CreateAdapter requests, the same session is returned. + * This token is employed to avoid unintentionally creating the same session + * multiple times. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token is used to recognize the request. If the same + * token is used with multiple CreateAdapter requests, the same + * session is returned. This token is employed to avoid + * unintentionally creating the same session multiple times. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterRequest withClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + return this; + } + + /** + *

    + * The description to be assigned to the adapter being created. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @return

    + * The description to be assigned to the adapter being created. + *

    + */ + public String getDescription() { + return description; + } + + /** + *

    + * The description to be assigned to the adapter being created. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param description

    + * The description to be assigned to the adapter being created. + *

    + */ + public void setDescription(String description) { + this.description = description; + } + + /** + *

    + * The description to be assigned to the adapter being created. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param description

    + * The description to be assigned to the adapter being created. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterRequest withDescription(String description) { + this.description = description; + return this; + } + + /** + *

    + * The type of feature that the adapter is being trained on. Currrenly, + * supported feature types are: QUERIES + *

    + * + * @return

    + * The type of feature that the adapter is being trained on. + * Currrenly, supported feature types are: QUERIES + *

    + */ + public java.util.List getFeatureTypes() { + return featureTypes; + } + + /** + *

    + * The type of feature that the adapter is being trained on. Currrenly, + * supported feature types are: QUERIES + *

    + * + * @param featureTypes

    + * The type of feature that the adapter is being trained on. + * Currrenly, supported feature types are: QUERIES + *

    + */ + public void setFeatureTypes(java.util.Collection featureTypes) { + if (featureTypes == null) { + this.featureTypes = null; + return; + } + + this.featureTypes = new java.util.ArrayList(featureTypes); + } + + /** + *

    + * The type of feature that the adapter is being trained on. Currrenly, + * supported feature types are: QUERIES + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

    + * The type of feature that the adapter is being trained on. + * Currrenly, supported feature types are: QUERIES + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterRequest withFeatureTypes(String... featureTypes) { + if (getFeatureTypes() == null) { + this.featureTypes = new java.util.ArrayList(featureTypes.length); + } + for (String value : featureTypes) { + this.featureTypes.add(value); + } + return this; + } + + /** + *

    + * The type of feature that the adapter is being trained on. Currrenly, + * supported feature types are: QUERIES + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

    + * The type of feature that the adapter is being trained on. + * Currrenly, supported feature types are: QUERIES + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterRequest withFeatureTypes(java.util.Collection featureTypes) { + setFeatureTypes(featureTypes); + return this; + } + + /** + *

    + * Controls whether or not the adapter should automatically update. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @return

    + * Controls whether or not the adapter should automatically update. + *

    + * @see AutoUpdate + */ + public String getAutoUpdate() { + return autoUpdate; + } + + /** + *

    + * Controls whether or not the adapter should automatically update. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * Controls whether or not the adapter should automatically + * update. + *

    + * @see AutoUpdate + */ + public void setAutoUpdate(String autoUpdate) { + this.autoUpdate = autoUpdate; + } + + /** + *

    + * Controls whether or not the adapter should automatically update. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * Controls whether or not the adapter should automatically + * update. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoUpdate + */ + public CreateAdapterRequest withAutoUpdate(String autoUpdate) { + this.autoUpdate = autoUpdate; + return this; + } + + /** + *

    + * Controls whether or not the adapter should automatically update. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * Controls whether or not the adapter should automatically + * update. + *

    + * @see AutoUpdate + */ + public void setAutoUpdate(AutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate.toString(); + } + + /** + *

    + * Controls whether or not the adapter should automatically update. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * Controls whether or not the adapter should automatically + * update. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoUpdate + */ + public CreateAdapterRequest withAutoUpdate(AutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate.toString(); + return this; + } + + /** + *

    + * A list of tags to be added to the adapter. + *

    + * + * @return

    + * A list of tags to be added to the adapter. + *

    + */ + public java.util.Map getTags() { + return tags; + } + + /** + *

    + * A list of tags to be added to the adapter. + *

    + * + * @param tags

    + * A list of tags to be added to the adapter. + *

    + */ + public void setTags(java.util.Map tags) { + this.tags = tags; + } + + /** + *

    + * A list of tags to be added to the adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tags

    + * A list of tags to be added to the adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterRequest withTags(java.util.Map tags) { + this.tags = tags; + return this; + } + + /** + *

    + * A list of tags to be added to the adapter. + *

    + *

    + * The method adds a new key-value pair into Tags parameter, and returns a + * reference to this object so that method calls can be chained together. + * + * @param key The key of the entry to be added into Tags. + * @param value The corresponding value of the entry to be added into Tags. + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterRequest addTagsEntry(String key, String value) { + if (null == this.tags) { + this.tags = new java.util.HashMap(); + } + if (this.tags.containsKey(key)) + throw new IllegalArgumentException("Duplicated keys (" + key.toString() + + ") are provided."); + this.tags.put(key, value); + return this; + } + + /** + * Removes all the entries added into Tags. + *

    + * Returns a reference to this object so that method calls can be chained + * together. + */ + public CreateAdapterRequest clearTagsEntries() { + this.tags = null; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterName() != null) + sb.append("AdapterName: " + getAdapterName() + ","); + if (getClientRequestToken() != null) + sb.append("ClientRequestToken: " + getClientRequestToken() + ","); + if (getDescription() != null) + sb.append("Description: " + getDescription() + ","); + if (getFeatureTypes() != null) + sb.append("FeatureTypes: " + getFeatureTypes() + ","); + if (getAutoUpdate() != null) + sb.append("AutoUpdate: " + getAutoUpdate() + ","); + if (getTags() != null) + sb.append("Tags: " + getTags()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getAdapterName() == null) ? 0 : getAdapterName().hashCode()); + hashCode = prime * hashCode + + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); + hashCode = prime * hashCode + + ((getDescription() == null) ? 0 : getDescription().hashCode()); + hashCode = prime * hashCode + + ((getFeatureTypes() == null) ? 0 : getFeatureTypes().hashCode()); + hashCode = prime * hashCode + ((getAutoUpdate() == null) ? 0 : getAutoUpdate().hashCode()); + hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CreateAdapterRequest == false) + return false; + CreateAdapterRequest other = (CreateAdapterRequest) obj; + + if (other.getAdapterName() == null ^ this.getAdapterName() == null) + return false; + if (other.getAdapterName() != null + && other.getAdapterName().equals(this.getAdapterName()) == false) + return false; + if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) + return false; + if (other.getClientRequestToken() != null + && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) + return false; + if (other.getDescription() == null ^ this.getDescription() == null) + return false; + if (other.getDescription() != null + && other.getDescription().equals(this.getDescription()) == false) + return false; + if (other.getFeatureTypes() == null ^ this.getFeatureTypes() == null) + return false; + if (other.getFeatureTypes() != null + && other.getFeatureTypes().equals(this.getFeatureTypes()) == false) + return false; + if (other.getAutoUpdate() == null ^ this.getAutoUpdate() == null) + return false; + if (other.getAutoUpdate() != null + && other.getAutoUpdate().equals(this.getAutoUpdate()) == false) + return false; + if (other.getTags() == null ^ this.getTags() == null) + return false; + if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterResult.java new file mode 100644 index 00000000000..e1440a65af9 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterResult.java @@ -0,0 +1,132 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class CreateAdapterResult implements Serializable { + /** + *

    + * A string containing the unique ID for the adapter that has been created. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * A string containing the unique ID for the adapter that has been created. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing the unique ID for the adapter that has been + * created. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing the unique ID for the adapter that has been created. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing the unique ID for the adapter that has + * been created. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing the unique ID for the adapter that has been created. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing the unique ID for the adapter that has + * been created. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterResult withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CreateAdapterResult == false) + return false; + CreateAdapterResult other = (CreateAdapterResult) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterVersionRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterVersionRequest.java new file mode 100644 index 00000000000..0c7a0cb6c3a --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterVersionRequest.java @@ -0,0 +1,758 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Creates a new version of an adapter. Operates on a provided AdapterId and a + * specified dataset provided via the DatasetConfig argument. Requires that you + * specify an Amazon S3 bucket with the OutputConfig argument. You can provide + * an optional KMSKeyId, an optional ClientRequestToken, and optional tags. + *

    + */ +public class CreateAdapterVersionRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * A string containing a unique ID for the adapter that will receive a new + * version. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * Idempotent token is used to recognize the request. If the same token is + * used with multiple CreateAdapterVersion requests, the same session is + * returned. This token is employed to avoid unintentionally creating the + * same session multiple times. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + */ + private String clientRequestToken; + + /** + *

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Object as the value. + *

    + */ + private AdapterVersionDatasetConfig datasetConfig; + + /** + *

    + * The identifier for your AWS Key Management Service key (AWS KMS key). + * Used to encrypt your documents. + *

    + *

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + */ + private String kMSKeyId; + + /** + *

    + * Sets whether or not your output will go to a user created bucket. Used to + * set the name of the bucket, and the prefix on the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets you adjust + * where your output will be placed. By default, Amazon Textract will store + * the results internally and can only be accessed by the Get API + * operations. With OutputConfig enabled, you can set the name + * of the bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set the + * KMSKeyID parameter to a customer master key (CMK) to encrypt + * your output. Without this parameter set Amazon Textract will encrypt + * server-side using the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under an AI + * services opt out policy then all unencrypted Customer Content is + * immediately and permanently deleted after the Customer Content has been + * processed by the service. No copy of of the output is retained by Amazon + * Textract. For information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy + * FAQ. + *

    + */ + private OutputConfig outputConfig; + + /** + *

    + * A set of tags (key-value pairs) that you want to attach to the adapter + * version. + *

    + */ + private java.util.Map tags; + + /** + *

    + * A string containing a unique ID for the adapter that will receive a new + * version. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing a unique ID for the adapter that will receive + * a new version. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter that will receive a new + * version. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter that will + * receive a new version. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter that will receive a new + * version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter that will + * receive a new version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionRequest withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * Idempotent token is used to recognize the request. If the same token is + * used with multiple CreateAdapterVersion requests, the same session is + * returned. This token is employed to avoid unintentionally creating the + * same session multiple times. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @return

    + * Idempotent token is used to recognize the request. If the same + * token is used with multiple CreateAdapterVersion requests, the + * same session is returned. This token is employed to avoid + * unintentionally creating the same session multiple times. + *

    + */ + public String getClientRequestToken() { + return clientRequestToken; + } + + /** + *

    + * Idempotent token is used to recognize the request. If the same token is + * used with multiple CreateAdapterVersion requests, the same session is + * returned. This token is employed to avoid unintentionally creating the + * same session multiple times. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token is used to recognize the request. If the same + * token is used with multiple CreateAdapterVersion requests, the + * same session is returned. This token is employed to avoid + * unintentionally creating the same session multiple times. + *

    + */ + public void setClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + } + + /** + *

    + * Idempotent token is used to recognize the request. If the same token is + * used with multiple CreateAdapterVersion requests, the same session is + * returned. This token is employed to avoid unintentionally creating the + * same session multiple times. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token is used to recognize the request. If the same + * token is used with multiple CreateAdapterVersion requests, the + * same session is returned. This token is employed to avoid + * unintentionally creating the same session multiple times. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionRequest withClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + return this; + } + + /** + *

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Object as the value. + *

    + * + * @return

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Object as the value. + *

    + */ + public AdapterVersionDatasetConfig getDatasetConfig() { + return datasetConfig; + } + + /** + *

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Object as the value. + *

    + * + * @param datasetConfig

    + * Specifies a dataset used to train a new adapter version. Takes + * a ManifestS3Object as the value. + *

    + */ + public void setDatasetConfig(AdapterVersionDatasetConfig datasetConfig) { + this.datasetConfig = datasetConfig; + } + + /** + *

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Object as the value. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param datasetConfig

    + * Specifies a dataset used to train a new adapter version. Takes + * a ManifestS3Object as the value. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionRequest withDatasetConfig(AdapterVersionDatasetConfig datasetConfig) { + this.datasetConfig = datasetConfig; + return this; + } + + /** + *

    + * The identifier for your AWS Key Management Service key (AWS KMS key). + * Used to encrypt your documents. + *

    + *

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + * + * @return

    + * The identifier for your AWS Key Management Service key (AWS KMS + * key). Used to encrypt your documents. + *

    + */ + public String getKMSKeyId() { + return kMSKeyId; + } + + /** + *

    + * The identifier for your AWS Key Management Service key (AWS KMS key). + * Used to encrypt your documents. + *

    + *

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + * + * @param kMSKeyId

    + * The identifier for your AWS Key Management Service key (AWS + * KMS key). Used to encrypt your documents. + *

    + */ + public void setKMSKeyId(String kMSKeyId) { + this.kMSKeyId = kMSKeyId; + } + + /** + *

    + * The identifier for your AWS Key Management Service key (AWS KMS key). + * Used to encrypt your documents. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + * + * @param kMSKeyId

    + * The identifier for your AWS Key Management Service key (AWS + * KMS key). Used to encrypt your documents. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionRequest withKMSKeyId(String kMSKeyId) { + this.kMSKeyId = kMSKeyId; + return this; + } + + /** + *

    + * Sets whether or not your output will go to a user created bucket. Used to + * set the name of the bucket, and the prefix on the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets you adjust + * where your output will be placed. By default, Amazon Textract will store + * the results internally and can only be accessed by the Get API + * operations. With OutputConfig enabled, you can set the name + * of the bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set the + * KMSKeyID parameter to a customer master key (CMK) to encrypt + * your output. Without this parameter set Amazon Textract will encrypt + * server-side using the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under an AI + * services opt out policy then all unencrypted Customer Content is + * immediately and permanently deleted after the Customer Content has been + * processed by the service. No copy of of the output is retained by Amazon + * Textract. For information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy + * FAQ. + *

    + * + * @return

    + * Sets whether or not your output will go to a user created bucket. + * Used to set the name of the bucket, and the prefix on the output + * file. + *

    + *

    + * OutputConfig is an optional parameter which lets you + * adjust where your output will be placed. By default, Amazon + * Textract will store the results internally and can only be + * accessed by the Get API operations. With + * OutputConfig enabled, you can set the name of the + * bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set + * the KMSKeyID parameter to a customer master key + * (CMK) to encrypt your output. Without this parameter set Amazon + * Textract will encrypt server-side using the AWS managed CMK for + * Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under + * an AI services opt out policy then all unencrypted Customer + * Content is immediately and permanently deleted after the Customer + * Content has been processed by the service. No copy of of the + * output is retained by Amazon Textract. For information about how + * to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data + * Privacy FAQ. + *

    + */ + public OutputConfig getOutputConfig() { + return outputConfig; + } + + /** + *

    + * Sets whether or not your output will go to a user created bucket. Used to + * set the name of the bucket, and the prefix on the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets you adjust + * where your output will be placed. By default, Amazon Textract will store + * the results internally and can only be accessed by the Get API + * operations. With OutputConfig enabled, you can set the name + * of the bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set the + * KMSKeyID parameter to a customer master key (CMK) to encrypt + * your output. Without this parameter set Amazon Textract will encrypt + * server-side using the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under an AI + * services opt out policy then all unencrypted Customer Content is + * immediately and permanently deleted after the Customer Content has been + * processed by the service. No copy of of the output is retained by Amazon + * Textract. For information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy + * FAQ. + *

    + * + * @param outputConfig

    + * Sets whether or not your output will go to a user created + * bucket. Used to set the name of the bucket, and the prefix on + * the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets + * you adjust where your output will be placed. By default, + * Amazon Textract will store the results internally and can only + * be accessed by the Get API operations. With + * OutputConfig enabled, you can set the name of the + * bucket the output will be sent to the file prefix of the + * results where you can download your results. Additionally, you + * can set the KMSKeyID parameter to a customer + * master key (CMK) to encrypt your output. Without this + * parameter set Amazon Textract will encrypt server-side using + * the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of + * the documents by Amazon Textract. If your account is opted out + * under an AI services opt out policy then all unencrypted + * Customer Content is immediately and permanently deleted after + * the Customer Content has been processed by the service. No + * copy of of the output is retained by Amazon Textract. For + * information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy FAQ. + *

    + */ + public void setOutputConfig(OutputConfig outputConfig) { + this.outputConfig = outputConfig; + } + + /** + *

    + * Sets whether or not your output will go to a user created bucket. Used to + * set the name of the bucket, and the prefix on the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets you adjust + * where your output will be placed. By default, Amazon Textract will store + * the results internally and can only be accessed by the Get API + * operations. With OutputConfig enabled, you can set the name + * of the bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set the + * KMSKeyID parameter to a customer master key (CMK) to encrypt + * your output. Without this parameter set Amazon Textract will encrypt + * server-side using the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under an AI + * services opt out policy then all unencrypted Customer Content is + * immediately and permanently deleted after the Customer Content has been + * processed by the service. No copy of of the output is retained by Amazon + * Textract. For information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy + * FAQ. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param outputConfig

    + * Sets whether or not your output will go to a user created + * bucket. Used to set the name of the bucket, and the prefix on + * the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets + * you adjust where your output will be placed. By default, + * Amazon Textract will store the results internally and can only + * be accessed by the Get API operations. With + * OutputConfig enabled, you can set the name of the + * bucket the output will be sent to the file prefix of the + * results where you can download your results. Additionally, you + * can set the KMSKeyID parameter to a customer + * master key (CMK) to encrypt your output. Without this + * parameter set Amazon Textract will encrypt server-side using + * the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of + * the documents by Amazon Textract. If your account is opted out + * under an AI services opt out policy then all unencrypted + * Customer Content is immediately and permanently deleted after + * the Customer Content has been processed by the service. No + * copy of of the output is retained by Amazon Textract. For + * information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy FAQ. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionRequest withOutputConfig(OutputConfig outputConfig) { + this.outputConfig = outputConfig; + return this; + } + + /** + *

    + * A set of tags (key-value pairs) that you want to attach to the adapter + * version. + *

    + * + * @return

    + * A set of tags (key-value pairs) that you want to attach to the + * adapter version. + *

    + */ + public java.util.Map getTags() { + return tags; + } + + /** + *

    + * A set of tags (key-value pairs) that you want to attach to the adapter + * version. + *

    + * + * @param tags

    + * A set of tags (key-value pairs) that you want to attach to the + * adapter version. + *

    + */ + public void setTags(java.util.Map tags) { + this.tags = tags; + } + + /** + *

    + * A set of tags (key-value pairs) that you want to attach to the adapter + * version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tags

    + * A set of tags (key-value pairs) that you want to attach to the + * adapter version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionRequest withTags(java.util.Map tags) { + this.tags = tags; + return this; + } + + /** + *

    + * A set of tags (key-value pairs) that you want to attach to the adapter + * version. + *

    + *

    + * The method adds a new key-value pair into Tags parameter, and returns a + * reference to this object so that method calls can be chained together. + * + * @param key The key of the entry to be added into Tags. + * @param value The corresponding value of the entry to be added into Tags. + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionRequest addTagsEntry(String key, String value) { + if (null == this.tags) { + this.tags = new java.util.HashMap(); + } + if (this.tags.containsKey(key)) + throw new IllegalArgumentException("Duplicated keys (" + key.toString() + + ") are provided."); + this.tags.put(key, value); + return this; + } + + /** + * Removes all the entries added into Tags. + *

    + * Returns a reference to this object so that method calls can be chained + * together. + */ + public CreateAdapterVersionRequest clearTagsEntries() { + this.tags = null; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getClientRequestToken() != null) + sb.append("ClientRequestToken: " + getClientRequestToken() + ","); + if (getDatasetConfig() != null) + sb.append("DatasetConfig: " + getDatasetConfig() + ","); + if (getKMSKeyId() != null) + sb.append("KMSKeyId: " + getKMSKeyId() + ","); + if (getOutputConfig() != null) + sb.append("OutputConfig: " + getOutputConfig() + ","); + if (getTags() != null) + sb.append("Tags: " + getTags()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); + hashCode = prime * hashCode + + ((getDatasetConfig() == null) ? 0 : getDatasetConfig().hashCode()); + hashCode = prime * hashCode + ((getKMSKeyId() == null) ? 0 : getKMSKeyId().hashCode()); + hashCode = prime * hashCode + + ((getOutputConfig() == null) ? 0 : getOutputConfig().hashCode()); + hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CreateAdapterVersionRequest == false) + return false; + CreateAdapterVersionRequest other = (CreateAdapterVersionRequest) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) + return false; + if (other.getClientRequestToken() != null + && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) + return false; + if (other.getDatasetConfig() == null ^ this.getDatasetConfig() == null) + return false; + if (other.getDatasetConfig() != null + && other.getDatasetConfig().equals(this.getDatasetConfig()) == false) + return false; + if (other.getKMSKeyId() == null ^ this.getKMSKeyId() == null) + return false; + if (other.getKMSKeyId() != null && other.getKMSKeyId().equals(this.getKMSKeyId()) == false) + return false; + if (other.getOutputConfig() == null ^ this.getOutputConfig() == null) + return false; + if (other.getOutputConfig() != null + && other.getOutputConfig().equals(this.getOutputConfig()) == false) + return false; + if (other.getTags() == null ^ this.getTags() == null) + return false; + if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterVersionResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterVersionResult.java new file mode 100644 index 00000000000..ac9aee21296 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/CreateAdapterVersionResult.java @@ -0,0 +1,209 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class CreateAdapterVersionResult implements Serializable { + /** + *

    + * A string containing the unique ID for the adapter that has received a new + * version. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * A string describing the new version of the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + */ + private String adapterVersion; + + /** + *

    + * A string containing the unique ID for the adapter that has received a new + * version. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing the unique ID for the adapter that has + * received a new version. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing the unique ID for the adapter that has received a new + * version. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing the unique ID for the adapter that has + * received a new version. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing the unique ID for the adapter that has received a new + * version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing the unique ID for the adapter that has + * received a new version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionResult withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * A string describing the new version of the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @return

    + * A string describing the new version of the adapter. + *

    + */ + public String getAdapterVersion() { + return adapterVersion; + } + + /** + *

    + * A string describing the new version of the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @param adapterVersion

    + * A string describing the new version of the adapter. + *

    + */ + public void setAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + } + + /** + *

    + * A string describing the new version of the adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @param adapterVersion

    + * A string describing the new version of the adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateAdapterVersionResult withAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAdapterVersion() != null) + sb.append("AdapterVersion: " + getAdapterVersion()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAdapterVersion() == null) ? 0 : getAdapterVersion().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CreateAdapterVersionResult == false) + return false; + CreateAdapterVersionResult other = (CreateAdapterVersionResult) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAdapterVersion() == null ^ this.getAdapterVersion() == null) + return false; + if (other.getAdapterVersion() != null + && other.getAdapterVersion().equals(this.getAdapterVersion()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterRequest.java new file mode 100644 index 00000000000..79a814d4bee --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterRequest.java @@ -0,0 +1,137 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Deletes an Amazon Textract adapter. Takes an AdapterId and deletes the + * adapter specified by the ID. + *

    + */ +public class DeleteAdapterRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * A string containing a unique ID for the adapter to be deleted. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * A string containing a unique ID for the adapter to be deleted. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing a unique ID for the adapter to be deleted. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter to be deleted. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter to be deleted. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter to be deleted. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter to be deleted. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteAdapterRequest withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteAdapterRequest == false) + return false; + DeleteAdapterRequest other = (DeleteAdapterRequest) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterResult.java new file mode 100644 index 00000000000..75e8bb19f9b --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterResult.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class DeleteAdapterResult implements Serializable { + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteAdapterResult == false) + return false; + DeleteAdapterResult other = (DeleteAdapterResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterVersionRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterVersionRequest.java new file mode 100644 index 00000000000..1c4a988bc0f --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterVersionRequest.java @@ -0,0 +1,218 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Deletes an Amazon Textract adapter version. Requires that you specify both an + * AdapterId and a AdapterVersion. Deletes the adapter version specified by the + * AdapterId and the AdapterVersion. + *

    + */ +public class DeleteAdapterVersionRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * A string containing a unique ID for the adapter version that will be + * deleted. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * Specifies the adapter version to be deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + */ + private String adapterVersion; + + /** + *

    + * A string containing a unique ID for the adapter version that will be + * deleted. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing a unique ID for the adapter version that will + * be deleted. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter version that will be + * deleted. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter version that + * will be deleted. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter version that will be + * deleted. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter version that + * will be deleted. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteAdapterVersionRequest withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * Specifies the adapter version to be deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @return

    + * Specifies the adapter version to be deleted. + *

    + */ + public String getAdapterVersion() { + return adapterVersion; + } + + /** + *

    + * Specifies the adapter version to be deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @param adapterVersion

    + * Specifies the adapter version to be deleted. + *

    + */ + public void setAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + } + + /** + *

    + * Specifies the adapter version to be deleted. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @param adapterVersion

    + * Specifies the adapter version to be deleted. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteAdapterVersionRequest withAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAdapterVersion() != null) + sb.append("AdapterVersion: " + getAdapterVersion()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAdapterVersion() == null) ? 0 : getAdapterVersion().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteAdapterVersionRequest == false) + return false; + DeleteAdapterVersionRequest other = (DeleteAdapterVersionRequest) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAdapterVersion() == null ^ this.getAdapterVersion() == null) + return false; + if (other.getAdapterVersion() != null + && other.getAdapterVersion().equals(this.getAdapterVersion()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterVersionResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterVersionResult.java new file mode 100644 index 00000000000..ed84cae7f55 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/DeleteAdapterVersionResult.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class DeleteAdapterVersionResult implements Serializable { + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteAdapterVersionResult == false) + return false; + DeleteAdapterVersionResult other = (DeleteAdapterVersionResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/EvaluationMetric.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/EvaluationMetric.java new file mode 100644 index 00000000000..5c8ca262857 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/EvaluationMetric.java @@ -0,0 +1,241 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +/** + *

    + * The evaluation metrics (F1 score, Precision, and Recall) for an adapter + * version. + *

    + */ +public class EvaluationMetric implements Serializable { + /** + *

    + * The F1 score for an adapter version. + *

    + */ + private Float f1Score; + + /** + *

    + * The Precision score for an adapter version. + *

    + */ + private Float precision; + + /** + *

    + * The Recall score for an adapter version. + *

    + */ + private Float recall; + + /** + *

    + * The F1 score for an adapter version. + *

    + * + * @return

    + * The F1 score for an adapter version. + *

    + */ + public Float getF1Score() { + return f1Score; + } + + /** + *

    + * The F1 score for an adapter version. + *

    + * + * @param f1Score

    + * The F1 score for an adapter version. + *

    + */ + public void setF1Score(Float f1Score) { + this.f1Score = f1Score; + } + + /** + *

    + * The F1 score for an adapter version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param f1Score

    + * The F1 score for an adapter version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public EvaluationMetric withF1Score(Float f1Score) { + this.f1Score = f1Score; + return this; + } + + /** + *

    + * The Precision score for an adapter version. + *

    + * + * @return

    + * The Precision score for an adapter version. + *

    + */ + public Float getPrecision() { + return precision; + } + + /** + *

    + * The Precision score for an adapter version. + *

    + * + * @param precision

    + * The Precision score for an adapter version. + *

    + */ + public void setPrecision(Float precision) { + this.precision = precision; + } + + /** + *

    + * The Precision score for an adapter version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param precision

    + * The Precision score for an adapter version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public EvaluationMetric withPrecision(Float precision) { + this.precision = precision; + return this; + } + + /** + *

    + * The Recall score for an adapter version. + *

    + * + * @return

    + * The Recall score for an adapter version. + *

    + */ + public Float getRecall() { + return recall; + } + + /** + *

    + * The Recall score for an adapter version. + *

    + * + * @param recall

    + * The Recall score for an adapter version. + *

    + */ + public void setRecall(Float recall) { + this.recall = recall; + } + + /** + *

    + * The Recall score for an adapter version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param recall

    + * The Recall score for an adapter version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public EvaluationMetric withRecall(Float recall) { + this.recall = recall; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getF1Score() != null) + sb.append("F1Score: " + getF1Score() + ","); + if (getPrecision() != null) + sb.append("Precision: " + getPrecision() + ","); + if (getRecall() != null) + sb.append("Recall: " + getRecall()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getF1Score() == null) ? 0 : getF1Score().hashCode()); + hashCode = prime * hashCode + ((getPrecision() == null) ? 0 : getPrecision().hashCode()); + hashCode = prime * hashCode + ((getRecall() == null) ? 0 : getRecall().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof EvaluationMetric == false) + return false; + EvaluationMetric other = (EvaluationMetric) obj; + + if (other.getF1Score() == null ^ this.getF1Score() == null) + return false; + if (other.getF1Score() != null && other.getF1Score().equals(this.getF1Score()) == false) + return false; + if (other.getPrecision() == null ^ this.getPrecision() == null) + return false; + if (other.getPrecision() != null + && other.getPrecision().equals(this.getPrecision()) == false) + return false; + if (other.getRecall() == null ^ this.getRecall() == null) + return false; + if (other.getRecall() != null && other.getRecall().equals(this.getRecall()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/FeatureType.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/FeatureType.java index 8bf849111c4..35932761082 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/FeatureType.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/FeatureType.java @@ -26,7 +26,8 @@ public enum FeatureType { TABLES("TABLES"), FORMS("FORMS"), QUERIES("QUERIES"), - SIGNATURES("SIGNATURES"); + SIGNATURES("SIGNATURES"), + LAYOUT("LAYOUT"); private String value; @@ -46,6 +47,7 @@ public String toString() { enumMap.put("FORMS", FORMS); enumMap.put("QUERIES", QUERIES); enumMap.put("SIGNATURES", SIGNATURES); + enumMap.put("LAYOUT", LAYOUT); } /** diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterRequest.java new file mode 100644 index 00000000000..3304ab151c0 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterRequest.java @@ -0,0 +1,138 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Gets configuration information for an adapter specified by an AdapterId, + * returning information on AdapterName, Description, CreationTime, AutoUpdate + * status, and FeatureTypes. + *

    + */ +public class GetAdapterRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * A string containing a unique ID for the adapter. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * A string containing a unique ID for the adapter. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing a unique ID for the adapter. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterRequest withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof GetAdapterRequest == false) + return false; + GetAdapterRequest other = (GetAdapterRequest) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterResult.java new file mode 100644 index 00000000000..baaefd8e345 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterResult.java @@ -0,0 +1,673 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class GetAdapterResult implements Serializable { + /** + *

    + * A string identifying the adapter that information has been retrieved for. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * The name of the requested adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + */ + private String adapterName; + + /** + *

    + * The date and time the requested adapter was created at. + *

    + */ + private java.util.Date creationTime; + + /** + *

    + * The description for the requested adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + */ + private String description; + + /** + *

    + * List of the targeted feature types for the requested adapter. + *

    + */ + private java.util.List featureTypes; + + /** + *

    + * Binary value indicating if the adapter is being automatically updated or + * not. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + */ + private String autoUpdate; + + /** + *

    + * A set of tags (key-value pairs) associated with the adapter that has been + * retrieved. + *

    + */ + private java.util.Map tags; + + /** + *

    + * A string identifying the adapter that information has been retrieved for. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string identifying the adapter that information has been + * retrieved for. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string identifying the adapter that information has been retrieved for. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string identifying the adapter that information has been + * retrieved for. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string identifying the adapter that information has been retrieved for. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string identifying the adapter that information has been + * retrieved for. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterResult withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * The name of the requested adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @return

    + * The name of the requested adapter. + *

    + */ + public String getAdapterName() { + return adapterName; + } + + /** + *

    + * The name of the requested adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @param adapterName

    + * The name of the requested adapter. + *

    + */ + public void setAdapterName(String adapterName) { + this.adapterName = adapterName; + } + + /** + *

    + * The name of the requested adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @param adapterName

    + * The name of the requested adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterResult withAdapterName(String adapterName) { + this.adapterName = adapterName; + return this; + } + + /** + *

    + * The date and time the requested adapter was created at. + *

    + * + * @return

    + * The date and time the requested adapter was created at. + *

    + */ + public java.util.Date getCreationTime() { + return creationTime; + } + + /** + *

    + * The date and time the requested adapter was created at. + *

    + * + * @param creationTime

    + * The date and time the requested adapter was created at. + *

    + */ + public void setCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + } + + /** + *

    + * The date and time the requested adapter was created at. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param creationTime

    + * The date and time the requested adapter was created at. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterResult withCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + *

    + * The description for the requested adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @return

    + * The description for the requested adapter. + *

    + */ + public String getDescription() { + return description; + } + + /** + *

    + * The description for the requested adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param description

    + * The description for the requested adapter. + *

    + */ + public void setDescription(String description) { + this.description = description; + } + + /** + *

    + * The description for the requested adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param description

    + * The description for the requested adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterResult withDescription(String description) { + this.description = description; + return this; + } + + /** + *

    + * List of the targeted feature types for the requested adapter. + *

    + * + * @return

    + * List of the targeted feature types for the requested adapter. + *

    + */ + public java.util.List getFeatureTypes() { + return featureTypes; + } + + /** + *

    + * List of the targeted feature types for the requested adapter. + *

    + * + * @param featureTypes

    + * List of the targeted feature types for the requested adapter. + *

    + */ + public void setFeatureTypes(java.util.Collection featureTypes) { + if (featureTypes == null) { + this.featureTypes = null; + return; + } + + this.featureTypes = new java.util.ArrayList(featureTypes); + } + + /** + *

    + * List of the targeted feature types for the requested adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

    + * List of the targeted feature types for the requested adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterResult withFeatureTypes(String... featureTypes) { + if (getFeatureTypes() == null) { + this.featureTypes = new java.util.ArrayList(featureTypes.length); + } + for (String value : featureTypes) { + this.featureTypes.add(value); + } + return this; + } + + /** + *

    + * List of the targeted feature types for the requested adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

    + * List of the targeted feature types for the requested adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterResult withFeatureTypes(java.util.Collection featureTypes) { + setFeatureTypes(featureTypes); + return this; + } + + /** + *

    + * Binary value indicating if the adapter is being automatically updated or + * not. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @return

    + * Binary value indicating if the adapter is being automatically + * updated or not. + *

    + * @see AutoUpdate + */ + public String getAutoUpdate() { + return autoUpdate; + } + + /** + *

    + * Binary value indicating if the adapter is being automatically updated or + * not. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * Binary value indicating if the adapter is being automatically + * updated or not. + *

    + * @see AutoUpdate + */ + public void setAutoUpdate(String autoUpdate) { + this.autoUpdate = autoUpdate; + } + + /** + *

    + * Binary value indicating if the adapter is being automatically updated or + * not. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * Binary value indicating if the adapter is being automatically + * updated or not. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoUpdate + */ + public GetAdapterResult withAutoUpdate(String autoUpdate) { + this.autoUpdate = autoUpdate; + return this; + } + + /** + *

    + * Binary value indicating if the adapter is being automatically updated or + * not. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * Binary value indicating if the adapter is being automatically + * updated or not. + *

    + * @see AutoUpdate + */ + public void setAutoUpdate(AutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate.toString(); + } + + /** + *

    + * Binary value indicating if the adapter is being automatically updated or + * not. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * Binary value indicating if the adapter is being automatically + * updated or not. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoUpdate + */ + public GetAdapterResult withAutoUpdate(AutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate.toString(); + return this; + } + + /** + *

    + * A set of tags (key-value pairs) associated with the adapter that has been + * retrieved. + *

    + * + * @return

    + * A set of tags (key-value pairs) associated with the adapter that + * has been retrieved. + *

    + */ + public java.util.Map getTags() { + return tags; + } + + /** + *

    + * A set of tags (key-value pairs) associated with the adapter that has been + * retrieved. + *

    + * + * @param tags

    + * A set of tags (key-value pairs) associated with the adapter + * that has been retrieved. + *

    + */ + public void setTags(java.util.Map tags) { + this.tags = tags; + } + + /** + *

    + * A set of tags (key-value pairs) associated with the adapter that has been + * retrieved. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tags

    + * A set of tags (key-value pairs) associated with the adapter + * that has been retrieved. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterResult withTags(java.util.Map tags) { + this.tags = tags; + return this; + } + + /** + *

    + * A set of tags (key-value pairs) associated with the adapter that has been + * retrieved. + *

    + *

    + * The method adds a new key-value pair into Tags parameter, and returns a + * reference to this object so that method calls can be chained together. + * + * @param key The key of the entry to be added into Tags. + * @param value The corresponding value of the entry to be added into Tags. + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterResult addTagsEntry(String key, String value) { + if (null == this.tags) { + this.tags = new java.util.HashMap(); + } + if (this.tags.containsKey(key)) + throw new IllegalArgumentException("Duplicated keys (" + key.toString() + + ") are provided."); + this.tags.put(key, value); + return this; + } + + /** + * Removes all the entries added into Tags. + *

    + * Returns a reference to this object so that method calls can be chained + * together. + */ + public GetAdapterResult clearTagsEntries() { + this.tags = null; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAdapterName() != null) + sb.append("AdapterName: " + getAdapterName() + ","); + if (getCreationTime() != null) + sb.append("CreationTime: " + getCreationTime() + ","); + if (getDescription() != null) + sb.append("Description: " + getDescription() + ","); + if (getFeatureTypes() != null) + sb.append("FeatureTypes: " + getFeatureTypes() + ","); + if (getAutoUpdate() != null) + sb.append("AutoUpdate: " + getAutoUpdate() + ","); + if (getTags() != null) + sb.append("Tags: " + getTags()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAdapterName() == null) ? 0 : getAdapterName().hashCode()); + hashCode = prime * hashCode + + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); + hashCode = prime * hashCode + + ((getDescription() == null) ? 0 : getDescription().hashCode()); + hashCode = prime * hashCode + + ((getFeatureTypes() == null) ? 0 : getFeatureTypes().hashCode()); + hashCode = prime * hashCode + ((getAutoUpdate() == null) ? 0 : getAutoUpdate().hashCode()); + hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof GetAdapterResult == false) + return false; + GetAdapterResult other = (GetAdapterResult) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAdapterName() == null ^ this.getAdapterName() == null) + return false; + if (other.getAdapterName() != null + && other.getAdapterName().equals(this.getAdapterName()) == false) + return false; + if (other.getCreationTime() == null ^ this.getCreationTime() == null) + return false; + if (other.getCreationTime() != null + && other.getCreationTime().equals(this.getCreationTime()) == false) + return false; + if (other.getDescription() == null ^ this.getDescription() == null) + return false; + if (other.getDescription() != null + && other.getDescription().equals(this.getDescription()) == false) + return false; + if (other.getFeatureTypes() == null ^ this.getFeatureTypes() == null) + return false; + if (other.getFeatureTypes() != null + && other.getFeatureTypes().equals(this.getFeatureTypes()) == false) + return false; + if (other.getAutoUpdate() == null ^ this.getAutoUpdate() == null) + return false; + if (other.getAutoUpdate() != null + && other.getAutoUpdate().equals(this.getAutoUpdate()) == false) + return false; + if (other.getTags() == null ^ this.getTags() == null) + return false; + if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterVersionRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterVersionRequest.java new file mode 100644 index 00000000000..db48add7435 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterVersionRequest.java @@ -0,0 +1,225 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Gets configuration information for the specified adapter version, including: + * AdapterId, AdapterVersion, FeatureTypes, Status, StatusMessage, + * DatasetConfig, KMSKeyId, OutputConfig, Tags and EvaluationMetrics. + *

    + */ +public class GetAdapterVersionRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * A string specifying a unique ID for the adapter version you want to + * retrieve information for. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * A string specifying the adapter version you want to retrieve information + * for. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + */ + private String adapterVersion; + + /** + *

    + * A string specifying a unique ID for the adapter version you want to + * retrieve information for. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string specifying a unique ID for the adapter version you want + * to retrieve information for. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string specifying a unique ID for the adapter version you want to + * retrieve information for. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string specifying a unique ID for the adapter version you + * want to retrieve information for. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string specifying a unique ID for the adapter version you want to + * retrieve information for. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string specifying a unique ID for the adapter version you + * want to retrieve information for. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionRequest withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * A string specifying the adapter version you want to retrieve information + * for. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @return

    + * A string specifying the adapter version you want to retrieve + * information for. + *

    + */ + public String getAdapterVersion() { + return adapterVersion; + } + + /** + *

    + * A string specifying the adapter version you want to retrieve information + * for. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @param adapterVersion

    + * A string specifying the adapter version you want to retrieve + * information for. + *

    + */ + public void setAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + } + + /** + *

    + * A string specifying the adapter version you want to retrieve information + * for. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @param adapterVersion

    + * A string specifying the adapter version you want to retrieve + * information for. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionRequest withAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAdapterVersion() != null) + sb.append("AdapterVersion: " + getAdapterVersion()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAdapterVersion() == null) ? 0 : getAdapterVersion().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof GetAdapterVersionRequest == false) + return false; + GetAdapterVersionRequest other = (GetAdapterVersionRequest) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAdapterVersion() == null ^ this.getAdapterVersion() == null) + return false; + if (other.getAdapterVersion() != null + && other.getAdapterVersion().equals(this.getAdapterVersion()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterVersionResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterVersionResult.java new file mode 100644 index 00000000000..123178c55c4 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetAdapterVersionResult.java @@ -0,0 +1,1192 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class GetAdapterVersionResult implements Serializable { + /** + *

    + * A string containing a unique ID for the adapter version being retrieved. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * A string containing the adapter version that has been retrieved. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + */ + private String adapterVersion; + + /** + *

    + * The time that the adapter version was created. + *

    + */ + private java.util.Date creationTime; + + /** + *

    + * List of the targeted feature types for the requested adapter version. + *

    + */ + private java.util.List featureTypes; + + /** + *

    + * The status of the adapter version that has been requested. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + */ + private String status; + + /** + *

    + * A message that describes the status of the requested adapter version. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + */ + private String statusMessage; + + /** + *

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Objec as the value. + *

    + */ + private AdapterVersionDatasetConfig datasetConfig; + + /** + *

    + * The identifier for your AWS Key Management Service key (AWS KMS key). + * Used to encrypt your documents. + *

    + *

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + */ + private String kMSKeyId; + + /** + *

    + * Sets whether or not your output will go to a user created bucket. Used to + * set the name of the bucket, and the prefix on the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets you adjust + * where your output will be placed. By default, Amazon Textract will store + * the results internally and can only be accessed by the Get API + * operations. With OutputConfig enabled, you can set the name + * of the bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set the + * KMSKeyID parameter to a customer master key (CMK) to encrypt + * your output. Without this parameter set Amazon Textract will encrypt + * server-side using the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under an AI + * services opt out policy then all unencrypted Customer Content is + * immediately and permanently deleted after the Customer Content has been + * processed by the service. No copy of of the output is retained by Amazon + * Textract. For information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy + * FAQ. + *

    + */ + private OutputConfig outputConfig; + + /** + *

    + * The evaluation metrics (F1 score, Precision, and Recall) for the + * requested version, grouped by baseline metrics and adapter version. + *

    + */ + private java.util.List evaluationMetrics; + + /** + *

    + * A set of tags (key-value pairs) that are associated with the adapter + * version. + *

    + */ + private java.util.Map tags; + + /** + *

    + * A string containing a unique ID for the adapter version being retrieved. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing a unique ID for the adapter version being + * retrieved. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter version being retrieved. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter version being + * retrieved. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter version being retrieved. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter version being + * retrieved. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * A string containing the adapter version that has been retrieved. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @return

    + * A string containing the adapter version that has been retrieved. + *

    + */ + public String getAdapterVersion() { + return adapterVersion; + } + + /** + *

    + * A string containing the adapter version that has been retrieved. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @param adapterVersion

    + * A string containing the adapter version that has been + * retrieved. + *

    + */ + public void setAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + } + + /** + *

    + * A string containing the adapter version that has been retrieved. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * + * @param adapterVersion

    + * A string containing the adapter version that has been + * retrieved. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withAdapterVersion(String adapterVersion) { + this.adapterVersion = adapterVersion; + return this; + } + + /** + *

    + * The time that the adapter version was created. + *

    + * + * @return

    + * The time that the adapter version was created. + *

    + */ + public java.util.Date getCreationTime() { + return creationTime; + } + + /** + *

    + * The time that the adapter version was created. + *

    + * + * @param creationTime

    + * The time that the adapter version was created. + *

    + */ + public void setCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + } + + /** + *

    + * The time that the adapter version was created. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param creationTime

    + * The time that the adapter version was created. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + *

    + * List of the targeted feature types for the requested adapter version. + *

    + * + * @return

    + * List of the targeted feature types for the requested adapter + * version. + *

    + */ + public java.util.List getFeatureTypes() { + return featureTypes; + } + + /** + *

    + * List of the targeted feature types for the requested adapter version. + *

    + * + * @param featureTypes

    + * List of the targeted feature types for the requested adapter + * version. + *

    + */ + public void setFeatureTypes(java.util.Collection featureTypes) { + if (featureTypes == null) { + this.featureTypes = null; + return; + } + + this.featureTypes = new java.util.ArrayList(featureTypes); + } + + /** + *

    + * List of the targeted feature types for the requested adapter version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

    + * List of the targeted feature types for the requested adapter + * version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withFeatureTypes(String... featureTypes) { + if (getFeatureTypes() == null) { + this.featureTypes = new java.util.ArrayList(featureTypes.length); + } + for (String value : featureTypes) { + this.featureTypes.add(value); + } + return this; + } + + /** + *

    + * List of the targeted feature types for the requested adapter version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

    + * List of the targeted feature types for the requested adapter + * version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withFeatureTypes(java.util.Collection featureTypes) { + setFeatureTypes(featureTypes); + return this; + } + + /** + *

    + * The status of the adapter version that has been requested. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @return

    + * The status of the adapter version that has been requested. + *

    + * @see AdapterVersionStatus + */ + public String getStatus() { + return status; + } + + /** + *

    + * The status of the adapter version that has been requested. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @param status

    + * The status of the adapter version that has been requested. + *

    + * @see AdapterVersionStatus + */ + public void setStatus(String status) { + this.status = status; + } + + /** + *

    + * The status of the adapter version that has been requested. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @param status

    + * The status of the adapter version that has been requested. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AdapterVersionStatus + */ + public GetAdapterVersionResult withStatus(String status) { + this.status = status; + return this; + } + + /** + *

    + * The status of the adapter version that has been requested. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @param status

    + * The status of the adapter version that has been requested. + *

    + * @see AdapterVersionStatus + */ + public void setStatus(AdapterVersionStatus status) { + this.status = status.toString(); + } + + /** + *

    + * The status of the adapter version that has been requested. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, AT_RISK, DEPRECATED, CREATION_ERROR, + * CREATION_IN_PROGRESS + * + * @param status

    + * The status of the adapter version that has been requested. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AdapterVersionStatus + */ + public GetAdapterVersionResult withStatus(AdapterVersionStatus status) { + this.status = status.toString(); + return this; + } + + /** + *

    + * A message that describes the status of the requested adapter version. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @return

    + * A message that describes the status of the requested adapter + * version. + *

    + */ + public String getStatusMessage() { + return statusMessage; + } + + /** + *

    + * A message that describes the status of the requested adapter version. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param statusMessage

    + * A message that describes the status of the requested adapter + * version. + *

    + */ + public void setStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + } + + /** + *

    + * A message that describes the status of the requested adapter version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param statusMessage

    + * A message that describes the status of the requested adapter + * version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withStatusMessage(String statusMessage) { + this.statusMessage = statusMessage; + return this; + } + + /** + *

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Objec as the value. + *

    + * + * @return

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Objec as the value. + *

    + */ + public AdapterVersionDatasetConfig getDatasetConfig() { + return datasetConfig; + } + + /** + *

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Objec as the value. + *

    + * + * @param datasetConfig

    + * Specifies a dataset used to train a new adapter version. Takes + * a ManifestS3Objec as the value. + *

    + */ + public void setDatasetConfig(AdapterVersionDatasetConfig datasetConfig) { + this.datasetConfig = datasetConfig; + } + + /** + *

    + * Specifies a dataset used to train a new adapter version. Takes a + * ManifestS3Objec as the value. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param datasetConfig

    + * Specifies a dataset used to train a new adapter version. Takes + * a ManifestS3Objec as the value. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withDatasetConfig(AdapterVersionDatasetConfig datasetConfig) { + this.datasetConfig = datasetConfig; + return this; + } + + /** + *

    + * The identifier for your AWS Key Management Service key (AWS KMS key). + * Used to encrypt your documents. + *

    + *

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + * + * @return

    + * The identifier for your AWS Key Management Service key (AWS KMS + * key). Used to encrypt your documents. + *

    + */ + public String getKMSKeyId() { + return kMSKeyId; + } + + /** + *

    + * The identifier for your AWS Key Management Service key (AWS KMS key). + * Used to encrypt your documents. + *

    + *

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + * + * @param kMSKeyId

    + * The identifier for your AWS Key Management Service key (AWS + * KMS key). Used to encrypt your documents. + *

    + */ + public void setKMSKeyId(String kMSKeyId) { + this.kMSKeyId = kMSKeyId; + } + + /** + *

    + * The identifier for your AWS Key Management Service key (AWS KMS key). + * Used to encrypt your documents. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 2048
    + * Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
    + * + * @param kMSKeyId

    + * The identifier for your AWS Key Management Service key (AWS + * KMS key). Used to encrypt your documents. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withKMSKeyId(String kMSKeyId) { + this.kMSKeyId = kMSKeyId; + return this; + } + + /** + *

    + * Sets whether or not your output will go to a user created bucket. Used to + * set the name of the bucket, and the prefix on the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets you adjust + * where your output will be placed. By default, Amazon Textract will store + * the results internally and can only be accessed by the Get API + * operations. With OutputConfig enabled, you can set the name + * of the bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set the + * KMSKeyID parameter to a customer master key (CMK) to encrypt + * your output. Without this parameter set Amazon Textract will encrypt + * server-side using the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under an AI + * services opt out policy then all unencrypted Customer Content is + * immediately and permanently deleted after the Customer Content has been + * processed by the service. No copy of of the output is retained by Amazon + * Textract. For information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy + * FAQ. + *

    + * + * @return

    + * Sets whether or not your output will go to a user created bucket. + * Used to set the name of the bucket, and the prefix on the output + * file. + *

    + *

    + * OutputConfig is an optional parameter which lets you + * adjust where your output will be placed. By default, Amazon + * Textract will store the results internally and can only be + * accessed by the Get API operations. With + * OutputConfig enabled, you can set the name of the + * bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set + * the KMSKeyID parameter to a customer master key + * (CMK) to encrypt your output. Without this parameter set Amazon + * Textract will encrypt server-side using the AWS managed CMK for + * Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under + * an AI services opt out policy then all unencrypted Customer + * Content is immediately and permanently deleted after the Customer + * Content has been processed by the service. No copy of of the + * output is retained by Amazon Textract. For information about how + * to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data + * Privacy FAQ. + *

    + */ + public OutputConfig getOutputConfig() { + return outputConfig; + } + + /** + *

    + * Sets whether or not your output will go to a user created bucket. Used to + * set the name of the bucket, and the prefix on the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets you adjust + * where your output will be placed. By default, Amazon Textract will store + * the results internally and can only be accessed by the Get API + * operations. With OutputConfig enabled, you can set the name + * of the bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set the + * KMSKeyID parameter to a customer master key (CMK) to encrypt + * your output. Without this parameter set Amazon Textract will encrypt + * server-side using the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under an AI + * services opt out policy then all unencrypted Customer Content is + * immediately and permanently deleted after the Customer Content has been + * processed by the service. No copy of of the output is retained by Amazon + * Textract. For information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy + * FAQ. + *

    + * + * @param outputConfig

    + * Sets whether or not your output will go to a user created + * bucket. Used to set the name of the bucket, and the prefix on + * the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets + * you adjust where your output will be placed. By default, + * Amazon Textract will store the results internally and can only + * be accessed by the Get API operations. With + * OutputConfig enabled, you can set the name of the + * bucket the output will be sent to the file prefix of the + * results where you can download your results. Additionally, you + * can set the KMSKeyID parameter to a customer + * master key (CMK) to encrypt your output. Without this + * parameter set Amazon Textract will encrypt server-side using + * the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of + * the documents by Amazon Textract. If your account is opted out + * under an AI services opt out policy then all unencrypted + * Customer Content is immediately and permanently deleted after + * the Customer Content has been processed by the service. No + * copy of of the output is retained by Amazon Textract. For + * information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy FAQ. + *

    + */ + public void setOutputConfig(OutputConfig outputConfig) { + this.outputConfig = outputConfig; + } + + /** + *

    + * Sets whether or not your output will go to a user created bucket. Used to + * set the name of the bucket, and the prefix on the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets you adjust + * where your output will be placed. By default, Amazon Textract will store + * the results internally and can only be accessed by the Get API + * operations. With OutputConfig enabled, you can set the name + * of the bucket the output will be sent to the file prefix of the results + * where you can download your results. Additionally, you can set the + * KMSKeyID parameter to a customer master key (CMK) to encrypt + * your output. Without this parameter set Amazon Textract will encrypt + * server-side using the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of the + * documents by Amazon Textract. If your account is opted out under an AI + * services opt out policy then all unencrypted Customer Content is + * immediately and permanently deleted after the Customer Content has been + * processed by the service. No copy of of the output is retained by Amazon + * Textract. For information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy + * FAQ. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param outputConfig

    + * Sets whether or not your output will go to a user created + * bucket. Used to set the name of the bucket, and the prefix on + * the output file. + *

    + *

    + * OutputConfig is an optional parameter which lets + * you adjust where your output will be placed. By default, + * Amazon Textract will store the results internally and can only + * be accessed by the Get API operations. With + * OutputConfig enabled, you can set the name of the + * bucket the output will be sent to the file prefix of the + * results where you can download your results. Additionally, you + * can set the KMSKeyID parameter to a customer + * master key (CMK) to encrypt your output. Without this + * parameter set Amazon Textract will encrypt server-side using + * the AWS managed CMK for Amazon S3. + *

    + *

    + * Decryption of Customer Content is necessary for processing of + * the documents by Amazon Textract. If your account is opted out + * under an AI services opt out policy then all unencrypted + * Customer Content is immediately and permanently deleted after + * the Customer Content has been processed by the service. No + * copy of of the output is retained by Amazon Textract. For + * information about how to opt out, see Managing AI services opt-out policy. + *

    + *

    + * For more information on data privacy, see the Data Privacy FAQ. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withOutputConfig(OutputConfig outputConfig) { + this.outputConfig = outputConfig; + return this; + } + + /** + *

    + * The evaluation metrics (F1 score, Precision, and Recall) for the + * requested version, grouped by baseline metrics and adapter version. + *

    + * + * @return

    + * The evaluation metrics (F1 score, Precision, and Recall) for the + * requested version, grouped by baseline metrics and adapter + * version. + *

    + */ + public java.util.List getEvaluationMetrics() { + return evaluationMetrics; + } + + /** + *

    + * The evaluation metrics (F1 score, Precision, and Recall) for the + * requested version, grouped by baseline metrics and adapter version. + *

    + * + * @param evaluationMetrics

    + * The evaluation metrics (F1 score, Precision, and Recall) for + * the requested version, grouped by baseline metrics and adapter + * version. + *

    + */ + public void setEvaluationMetrics( + java.util.Collection evaluationMetrics) { + if (evaluationMetrics == null) { + this.evaluationMetrics = null; + return; + } + + this.evaluationMetrics = new java.util.ArrayList( + evaluationMetrics); + } + + /** + *

    + * The evaluation metrics (F1 score, Precision, and Recall) for the + * requested version, grouped by baseline metrics and adapter version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param evaluationMetrics

    + * The evaluation metrics (F1 score, Precision, and Recall) for + * the requested version, grouped by baseline metrics and adapter + * version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withEvaluationMetrics( + AdapterVersionEvaluationMetric... evaluationMetrics) { + if (getEvaluationMetrics() == null) { + this.evaluationMetrics = new java.util.ArrayList( + evaluationMetrics.length); + } + for (AdapterVersionEvaluationMetric value : evaluationMetrics) { + this.evaluationMetrics.add(value); + } + return this; + } + + /** + *

    + * The evaluation metrics (F1 score, Precision, and Recall) for the + * requested version, grouped by baseline metrics and adapter version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param evaluationMetrics

    + * The evaluation metrics (F1 score, Precision, and Recall) for + * the requested version, grouped by baseline metrics and adapter + * version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withEvaluationMetrics( + java.util.Collection evaluationMetrics) { + setEvaluationMetrics(evaluationMetrics); + return this; + } + + /** + *

    + * A set of tags (key-value pairs) that are associated with the adapter + * version. + *

    + * + * @return

    + * A set of tags (key-value pairs) that are associated with the + * adapter version. + *

    + */ + public java.util.Map getTags() { + return tags; + } + + /** + *

    + * A set of tags (key-value pairs) that are associated with the adapter + * version. + *

    + * + * @param tags

    + * A set of tags (key-value pairs) that are associated with the + * adapter version. + *

    + */ + public void setTags(java.util.Map tags) { + this.tags = tags; + } + + /** + *

    + * A set of tags (key-value pairs) that are associated with the adapter + * version. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tags

    + * A set of tags (key-value pairs) that are associated with the + * adapter version. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult withTags(java.util.Map tags) { + this.tags = tags; + return this; + } + + /** + *

    + * A set of tags (key-value pairs) that are associated with the adapter + * version. + *

    + *

    + * The method adds a new key-value pair into Tags parameter, and returns a + * reference to this object so that method calls can be chained together. + * + * @param key The key of the entry to be added into Tags. + * @param value The corresponding value of the entry to be added into Tags. + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public GetAdapterVersionResult addTagsEntry(String key, String value) { + if (null == this.tags) { + this.tags = new java.util.HashMap(); + } + if (this.tags.containsKey(key)) + throw new IllegalArgumentException("Duplicated keys (" + key.toString() + + ") are provided."); + this.tags.put(key, value); + return this; + } + + /** + * Removes all the entries added into Tags. + *

    + * Returns a reference to this object so that method calls can be chained + * together. + */ + public GetAdapterVersionResult clearTagsEntries() { + this.tags = null; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAdapterVersion() != null) + sb.append("AdapterVersion: " + getAdapterVersion() + ","); + if (getCreationTime() != null) + sb.append("CreationTime: " + getCreationTime() + ","); + if (getFeatureTypes() != null) + sb.append("FeatureTypes: " + getFeatureTypes() + ","); + if (getStatus() != null) + sb.append("Status: " + getStatus() + ","); + if (getStatusMessage() != null) + sb.append("StatusMessage: " + getStatusMessage() + ","); + if (getDatasetConfig() != null) + sb.append("DatasetConfig: " + getDatasetConfig() + ","); + if (getKMSKeyId() != null) + sb.append("KMSKeyId: " + getKMSKeyId() + ","); + if (getOutputConfig() != null) + sb.append("OutputConfig: " + getOutputConfig() + ","); + if (getEvaluationMetrics() != null) + sb.append("EvaluationMetrics: " + getEvaluationMetrics() + ","); + if (getTags() != null) + sb.append("Tags: " + getTags()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAdapterVersion() == null) ? 0 : getAdapterVersion().hashCode()); + hashCode = prime * hashCode + + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); + hashCode = prime * hashCode + + ((getFeatureTypes() == null) ? 0 : getFeatureTypes().hashCode()); + hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); + hashCode = prime * hashCode + + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); + hashCode = prime * hashCode + + ((getDatasetConfig() == null) ? 0 : getDatasetConfig().hashCode()); + hashCode = prime * hashCode + ((getKMSKeyId() == null) ? 0 : getKMSKeyId().hashCode()); + hashCode = prime * hashCode + + ((getOutputConfig() == null) ? 0 : getOutputConfig().hashCode()); + hashCode = prime * hashCode + + ((getEvaluationMetrics() == null) ? 0 : getEvaluationMetrics().hashCode()); + hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof GetAdapterVersionResult == false) + return false; + GetAdapterVersionResult other = (GetAdapterVersionResult) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAdapterVersion() == null ^ this.getAdapterVersion() == null) + return false; + if (other.getAdapterVersion() != null + && other.getAdapterVersion().equals(this.getAdapterVersion()) == false) + return false; + if (other.getCreationTime() == null ^ this.getCreationTime() == null) + return false; + if (other.getCreationTime() != null + && other.getCreationTime().equals(this.getCreationTime()) == false) + return false; + if (other.getFeatureTypes() == null ^ this.getFeatureTypes() == null) + return false; + if (other.getFeatureTypes() != null + && other.getFeatureTypes().equals(this.getFeatureTypes()) == false) + return false; + if (other.getStatus() == null ^ this.getStatus() == null) + return false; + if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) + return false; + if (other.getStatusMessage() == null ^ this.getStatusMessage() == null) + return false; + if (other.getStatusMessage() != null + && other.getStatusMessage().equals(this.getStatusMessage()) == false) + return false; + if (other.getDatasetConfig() == null ^ this.getDatasetConfig() == null) + return false; + if (other.getDatasetConfig() != null + && other.getDatasetConfig().equals(this.getDatasetConfig()) == false) + return false; + if (other.getKMSKeyId() == null ^ this.getKMSKeyId() == null) + return false; + if (other.getKMSKeyId() != null && other.getKMSKeyId().equals(this.getKMSKeyId()) == false) + return false; + if (other.getOutputConfig() == null ^ this.getOutputConfig() == null) + return false; + if (other.getOutputConfig() != null + && other.getOutputConfig().equals(this.getOutputConfig()) == false) + return false; + if (other.getEvaluationMetrics() == null ^ this.getEvaluationMetrics() == null) + return false; + if (other.getEvaluationMetrics() != null + && other.getEvaluationMetrics().equals(this.getEvaluationMetrics()) == false) + return false; + if (other.getTags() == null ^ this.getTags() == null) + return false; + if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentAnalysisRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentAnalysisRequest.java index b20f4575482..9a25f32ba2f 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentAnalysisRequest.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentAnalysisRequest.java @@ -144,7 +144,7 @@ public class GetDocumentAnalysisRequest extends AmazonWebServiceRequest implemen *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    */ private String nextToken; @@ -301,7 +301,7 @@ public GetDocumentAnalysisRequest withMaxResults(Integer maxResults) { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @return

    @@ -323,7 +323,7 @@ public String getNextToken() { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    @@ -348,7 +348,7 @@ public void setNextToken(String nextToken) { * together. *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentAnalysisResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentAnalysisResult.java index 8d26b11ee06..d0d5a894a32 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentAnalysisResult.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentAnalysisResult.java @@ -45,7 +45,7 @@ public class GetDocumentAnalysisResult implements Serializable { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    */ private String nextToken; @@ -239,7 +239,7 @@ public GetDocumentAnalysisResult withJobStatus(JobStatus jobStatus) { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @return

    @@ -260,7 +260,7 @@ public String getNextToken() { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    @@ -284,7 +284,7 @@ public void setNextToken(String nextToken) { * together. *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentTextDetectionRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentTextDetectionRequest.java index c86facb7de4..1576da8c41a 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentTextDetectionRequest.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentTextDetectionRequest.java @@ -100,7 +100,7 @@ public class GetDocumentTextDetectionRequest extends AmazonWebServiceRequest imp *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    */ private String nextToken; @@ -257,7 +257,7 @@ public GetDocumentTextDetectionRequest withMaxResults(Integer maxResults) { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @return

    @@ -279,7 +279,7 @@ public String getNextToken() { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    @@ -304,7 +304,7 @@ public void setNextToken(String nextToken) { * together. *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentTextDetectionResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentTextDetectionResult.java index f93a7792814..8017ff94916 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentTextDetectionResult.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetDocumentTextDetectionResult.java @@ -45,7 +45,7 @@ public class GetDocumentTextDetectionResult implements Serializable { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    */ private String nextToken; @@ -240,7 +240,7 @@ public GetDocumentTextDetectionResult withJobStatus(JobStatus jobStatus) { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @return

    @@ -261,7 +261,7 @@ public String getNextToken() { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    @@ -285,7 +285,7 @@ public void setNextToken(String nextToken) { * together. *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetExpenseAnalysisRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetExpenseAnalysisRequest.java index 1c5cb38a060..b087f600a78 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetExpenseAnalysisRequest.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetExpenseAnalysisRequest.java @@ -87,7 +87,7 @@ public class GetExpenseAnalysisRequest extends AmazonWebServiceRequest implement *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    */ private String nextToken; @@ -241,7 +241,7 @@ public GetExpenseAnalysisRequest withMaxResults(Integer maxResults) { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @return

    @@ -263,7 +263,7 @@ public String getNextToken() { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    @@ -288,7 +288,7 @@ public void setNextToken(String nextToken) { * together. *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetExpenseAnalysisResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetExpenseAnalysisResult.java index ca34c846024..673815c661a 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetExpenseAnalysisResult.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetExpenseAnalysisResult.java @@ -45,7 +45,7 @@ public class GetExpenseAnalysisResult implements Serializable { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    */ private String nextToken; @@ -242,7 +242,7 @@ public GetExpenseAnalysisResult withJobStatus(JobStatus jobStatus) { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @return

    @@ -263,7 +263,7 @@ public String getNextToken() { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    @@ -287,7 +287,7 @@ public void setNextToken(String nextToken) { * together. *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetLendingAnalysisRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetLendingAnalysisRequest.java index fa63f4e60b2..3b01a3f1eed 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetLendingAnalysisRequest.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetLendingAnalysisRequest.java @@ -73,7 +73,7 @@ public class GetLendingAnalysisRequest extends AmazonWebServiceRequest implement *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    */ private String nextToken; @@ -227,7 +227,7 @@ public GetLendingAnalysisRequest withMaxResults(Integer maxResults) { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @return

    @@ -248,7 +248,7 @@ public String getNextToken() { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    @@ -272,7 +272,7 @@ public void setNextToken(String nextToken) { * together. *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetLendingAnalysisResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetLendingAnalysisResult.java index 698240479dc..d474a6f05eb 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetLendingAnalysisResult.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/GetLendingAnalysisResult.java @@ -43,7 +43,7 @@ public class GetLendingAnalysisResult implements Serializable { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    */ private String nextToken; @@ -228,7 +228,7 @@ public GetLendingAnalysisResult withJobStatus(JobStatus jobStatus) { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @return

    @@ -249,7 +249,7 @@ public String getNextToken() { *

    *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    @@ -273,7 +273,7 @@ public void setNextToken(String nextToken) { * together. *

    * Constraints:
    - * Length: 1 - 255
    + * Length: 1 - 1024
    * Pattern: .*\S.*
    * * @param nextToken

    diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdapterVersionsRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdapterVersionsRequest.java new file mode 100644 index 00000000000..424fbbab08e --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdapterVersionsRequest.java @@ -0,0 +1,451 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * List all version of an adapter that meet the specified filtration criteria. + *

    + */ +public class ListAdapterVersionsRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * A string containing a unique ID for the adapter to match for when listing + * adapter versions. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * Specifies the lower bound for the ListAdapterVersions operation. Ensures + * ListAdapterVersions returns only adapter versions created after the + * specified creation time. + *

    + */ + private java.util.Date afterCreationTime; + + /** + *

    + * Specifies the upper bound for the ListAdapterVersions operation. Ensures + * ListAdapterVersions returns only adapter versions created after the + * specified creation time. + *

    + */ + private java.util.Date beforeCreationTime; + + /** + *

    + * The maximum number of results to return when listing adapter versions. + *

    + *

    + * Constraints:
    + * Range: 1 -
    + */ + private Integer maxResults; + + /** + *

    + * Identifies the next page of results to return when listing adapter + * versions. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + */ + private String nextToken; + + /** + *

    + * A string containing a unique ID for the adapter to match for when listing + * adapter versions. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing a unique ID for the adapter to match for when + * listing adapter versions. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter to match for when listing + * adapter versions. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter to match for + * when listing adapter versions. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter to match for when listing + * adapter versions. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter to match for + * when listing adapter versions. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdapterVersionsRequest withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * Specifies the lower bound for the ListAdapterVersions operation. Ensures + * ListAdapterVersions returns only adapter versions created after the + * specified creation time. + *

    + * + * @return

    + * Specifies the lower bound for the ListAdapterVersions operation. + * Ensures ListAdapterVersions returns only adapter versions created + * after the specified creation time. + *

    + */ + public java.util.Date getAfterCreationTime() { + return afterCreationTime; + } + + /** + *

    + * Specifies the lower bound for the ListAdapterVersions operation. Ensures + * ListAdapterVersions returns only adapter versions created after the + * specified creation time. + *

    + * + * @param afterCreationTime

    + * Specifies the lower bound for the ListAdapterVersions + * operation. Ensures ListAdapterVersions returns only adapter + * versions created after the specified creation time. + *

    + */ + public void setAfterCreationTime(java.util.Date afterCreationTime) { + this.afterCreationTime = afterCreationTime; + } + + /** + *

    + * Specifies the lower bound for the ListAdapterVersions operation. Ensures + * ListAdapterVersions returns only adapter versions created after the + * specified creation time. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param afterCreationTime

    + * Specifies the lower bound for the ListAdapterVersions + * operation. Ensures ListAdapterVersions returns only adapter + * versions created after the specified creation time. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdapterVersionsRequest withAfterCreationTime(java.util.Date afterCreationTime) { + this.afterCreationTime = afterCreationTime; + return this; + } + + /** + *

    + * Specifies the upper bound for the ListAdapterVersions operation. Ensures + * ListAdapterVersions returns only adapter versions created after the + * specified creation time. + *

    + * + * @return

    + * Specifies the upper bound for the ListAdapterVersions operation. + * Ensures ListAdapterVersions returns only adapter versions created + * after the specified creation time. + *

    + */ + public java.util.Date getBeforeCreationTime() { + return beforeCreationTime; + } + + /** + *

    + * Specifies the upper bound for the ListAdapterVersions operation. Ensures + * ListAdapterVersions returns only adapter versions created after the + * specified creation time. + *

    + * + * @param beforeCreationTime

    + * Specifies the upper bound for the ListAdapterVersions + * operation. Ensures ListAdapterVersions returns only adapter + * versions created after the specified creation time. + *

    + */ + public void setBeforeCreationTime(java.util.Date beforeCreationTime) { + this.beforeCreationTime = beforeCreationTime; + } + + /** + *

    + * Specifies the upper bound for the ListAdapterVersions operation. Ensures + * ListAdapterVersions returns only adapter versions created after the + * specified creation time. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param beforeCreationTime

    + * Specifies the upper bound for the ListAdapterVersions + * operation. Ensures ListAdapterVersions returns only adapter + * versions created after the specified creation time. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdapterVersionsRequest withBeforeCreationTime(java.util.Date beforeCreationTime) { + this.beforeCreationTime = beforeCreationTime; + return this; + } + + /** + *

    + * The maximum number of results to return when listing adapter versions. + *

    + *

    + * Constraints:
    + * Range: 1 -
    + * + * @return

    + * The maximum number of results to return when listing adapter + * versions. + *

    + */ + public Integer getMaxResults() { + return maxResults; + } + + /** + *

    + * The maximum number of results to return when listing adapter versions. + *

    + *

    + * Constraints:
    + * Range: 1 -
    + * + * @param maxResults

    + * The maximum number of results to return when listing adapter + * versions. + *

    + */ + public void setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + } + + /** + *

    + * The maximum number of results to return when listing adapter versions. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Range: 1 -
    + * + * @param maxResults

    + * The maximum number of results to return when listing adapter + * versions. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdapterVersionsRequest withMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + /** + *

    + * Identifies the next page of results to return when listing adapter + * versions. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @return

    + * Identifies the next page of results to return when listing + * adapter versions. + *

    + */ + public String getNextToken() { + return nextToken; + } + + /** + *

    + * Identifies the next page of results to return when listing adapter + * versions. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @param nextToken

    + * Identifies the next page of results to return when listing + * adapter versions. + *

    + */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

    + * Identifies the next page of results to return when listing adapter + * versions. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @param nextToken

    + * Identifies the next page of results to return when listing + * adapter versions. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdapterVersionsRequest withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAfterCreationTime() != null) + sb.append("AfterCreationTime: " + getAfterCreationTime() + ","); + if (getBeforeCreationTime() != null) + sb.append("BeforeCreationTime: " + getBeforeCreationTime() + ","); + if (getMaxResults() != null) + sb.append("MaxResults: " + getMaxResults() + ","); + if (getNextToken() != null) + sb.append("NextToken: " + getNextToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAfterCreationTime() == null) ? 0 : getAfterCreationTime().hashCode()); + hashCode = prime * hashCode + + ((getBeforeCreationTime() == null) ? 0 : getBeforeCreationTime().hashCode()); + hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListAdapterVersionsRequest == false) + return false; + ListAdapterVersionsRequest other = (ListAdapterVersionsRequest) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAfterCreationTime() == null ^ this.getAfterCreationTime() == null) + return false; + if (other.getAfterCreationTime() != null + && other.getAfterCreationTime().equals(this.getAfterCreationTime()) == false) + return false; + if (other.getBeforeCreationTime() == null ^ this.getBeforeCreationTime() == null) + return false; + if (other.getBeforeCreationTime() != null + && other.getBeforeCreationTime().equals(this.getBeforeCreationTime()) == false) + return false; + if (other.getMaxResults() == null ^ this.getMaxResults() == null) + return false; + if (other.getMaxResults() != null + && other.getMaxResults().equals(this.getMaxResults()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdapterVersionsResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdapterVersionsResult.java new file mode 100644 index 00000000000..3480e793868 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdapterVersionsResult.java @@ -0,0 +1,241 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class ListAdapterVersionsResult implements Serializable { + /** + *

    + * Adapter versions that match the filtering criteria specified when calling + * ListAdapters. + *

    + */ + private java.util.List adapterVersions; + + /** + *

    + * Identifies the next page of results to return when listing adapter + * versions. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + */ + private String nextToken; + + /** + *

    + * Adapter versions that match the filtering criteria specified when calling + * ListAdapters. + *

    + * + * @return

    + * Adapter versions that match the filtering criteria specified when + * calling ListAdapters. + *

    + */ + public java.util.List getAdapterVersions() { + return adapterVersions; + } + + /** + *

    + * Adapter versions that match the filtering criteria specified when calling + * ListAdapters. + *

    + * + * @param adapterVersions

    + * Adapter versions that match the filtering criteria specified + * when calling ListAdapters. + *

    + */ + public void setAdapterVersions(java.util.Collection adapterVersions) { + if (adapterVersions == null) { + this.adapterVersions = null; + return; + } + + this.adapterVersions = new java.util.ArrayList(adapterVersions); + } + + /** + *

    + * Adapter versions that match the filtering criteria specified when calling + * ListAdapters. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adapterVersions

    + * Adapter versions that match the filtering criteria specified + * when calling ListAdapters. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdapterVersionsResult withAdapterVersions(AdapterVersionOverview... adapterVersions) { + if (getAdapterVersions() == null) { + this.adapterVersions = new java.util.ArrayList( + adapterVersions.length); + } + for (AdapterVersionOverview value : adapterVersions) { + this.adapterVersions.add(value); + } + return this; + } + + /** + *

    + * Adapter versions that match the filtering criteria specified when calling + * ListAdapters. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adapterVersions

    + * Adapter versions that match the filtering criteria specified + * when calling ListAdapters. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdapterVersionsResult withAdapterVersions( + java.util.Collection adapterVersions) { + setAdapterVersions(adapterVersions); + return this; + } + + /** + *

    + * Identifies the next page of results to return when listing adapter + * versions. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @return

    + * Identifies the next page of results to return when listing + * adapter versions. + *

    + */ + public String getNextToken() { + return nextToken; + } + + /** + *

    + * Identifies the next page of results to return when listing adapter + * versions. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @param nextToken

    + * Identifies the next page of results to return when listing + * adapter versions. + *

    + */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

    + * Identifies the next page of results to return when listing adapter + * versions. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @param nextToken

    + * Identifies the next page of results to return when listing + * adapter versions. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdapterVersionsResult withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterVersions() != null) + sb.append("AdapterVersions: " + getAdapterVersions() + ","); + if (getNextToken() != null) + sb.append("NextToken: " + getNextToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getAdapterVersions() == null) ? 0 : getAdapterVersions().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListAdapterVersionsResult == false) + return false; + ListAdapterVersionsResult other = (ListAdapterVersionsResult) obj; + + if (other.getAdapterVersions() == null ^ this.getAdapterVersions() == null) + return false; + if (other.getAdapterVersions() != null + && other.getAdapterVersions().equals(this.getAdapterVersions()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdaptersRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdaptersRequest.java new file mode 100644 index 00000000000..4e77294313d --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdaptersRequest.java @@ -0,0 +1,365 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Lists all adapters that match the specified filtration criteria. + *

    + */ +public class ListAdaptersRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * Specifies the lower bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created after the specified creation + * time. + *

    + */ + private java.util.Date afterCreationTime; + + /** + *

    + * Specifies the upper bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created before the specified creation + * time. + *

    + */ + private java.util.Date beforeCreationTime; + + /** + *

    + * The maximum number of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Range: 1 -
    + */ + private Integer maxResults; + + /** + *

    + * Identifies the next page of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + */ + private String nextToken; + + /** + *

    + * Specifies the lower bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created after the specified creation + * time. + *

    + * + * @return

    + * Specifies the lower bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created after the specified + * creation time. + *

    + */ + public java.util.Date getAfterCreationTime() { + return afterCreationTime; + } + + /** + *

    + * Specifies the lower bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created after the specified creation + * time. + *

    + * + * @param afterCreationTime

    + * Specifies the lower bound for the ListAdapters operation. + * Ensures ListAdapters returns only adapters created after the + * specified creation time. + *

    + */ + public void setAfterCreationTime(java.util.Date afterCreationTime) { + this.afterCreationTime = afterCreationTime; + } + + /** + *

    + * Specifies the lower bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created after the specified creation + * time. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param afterCreationTime

    + * Specifies the lower bound for the ListAdapters operation. + * Ensures ListAdapters returns only adapters created after the + * specified creation time. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdaptersRequest withAfterCreationTime(java.util.Date afterCreationTime) { + this.afterCreationTime = afterCreationTime; + return this; + } + + /** + *

    + * Specifies the upper bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created before the specified creation + * time. + *

    + * + * @return

    + * Specifies the upper bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created before the specified + * creation time. + *

    + */ + public java.util.Date getBeforeCreationTime() { + return beforeCreationTime; + } + + /** + *

    + * Specifies the upper bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created before the specified creation + * time. + *

    + * + * @param beforeCreationTime

    + * Specifies the upper bound for the ListAdapters operation. + * Ensures ListAdapters returns only adapters created before the + * specified creation time. + *

    + */ + public void setBeforeCreationTime(java.util.Date beforeCreationTime) { + this.beforeCreationTime = beforeCreationTime; + } + + /** + *

    + * Specifies the upper bound for the ListAdapters operation. Ensures + * ListAdapters returns only adapters created before the specified creation + * time. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param beforeCreationTime

    + * Specifies the upper bound for the ListAdapters operation. + * Ensures ListAdapters returns only adapters created before the + * specified creation time. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdaptersRequest withBeforeCreationTime(java.util.Date beforeCreationTime) { + this.beforeCreationTime = beforeCreationTime; + return this; + } + + /** + *

    + * The maximum number of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Range: 1 -
    + * + * @return

    + * The maximum number of results to return when listing adapters. + *

    + */ + public Integer getMaxResults() { + return maxResults; + } + + /** + *

    + * The maximum number of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Range: 1 -
    + * + * @param maxResults

    + * The maximum number of results to return when listing adapters. + *

    + */ + public void setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + } + + /** + *

    + * The maximum number of results to return when listing adapters. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Range: 1 -
    + * + * @param maxResults

    + * The maximum number of results to return when listing adapters. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdaptersRequest withMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + /** + *

    + * Identifies the next page of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @return

    + * Identifies the next page of results to return when listing + * adapters. + *

    + */ + public String getNextToken() { + return nextToken; + } + + /** + *

    + * Identifies the next page of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @param nextToken

    + * Identifies the next page of results to return when listing + * adapters. + *

    + */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

    + * Identifies the next page of results to return when listing adapters. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @param nextToken

    + * Identifies the next page of results to return when listing + * adapters. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdaptersRequest withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAfterCreationTime() != null) + sb.append("AfterCreationTime: " + getAfterCreationTime() + ","); + if (getBeforeCreationTime() != null) + sb.append("BeforeCreationTime: " + getBeforeCreationTime() + ","); + if (getMaxResults() != null) + sb.append("MaxResults: " + getMaxResults() + ","); + if (getNextToken() != null) + sb.append("NextToken: " + getNextToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getAfterCreationTime() == null) ? 0 : getAfterCreationTime().hashCode()); + hashCode = prime * hashCode + + ((getBeforeCreationTime() == null) ? 0 : getBeforeCreationTime().hashCode()); + hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListAdaptersRequest == false) + return false; + ListAdaptersRequest other = (ListAdaptersRequest) obj; + + if (other.getAfterCreationTime() == null ^ this.getAfterCreationTime() == null) + return false; + if (other.getAfterCreationTime() != null + && other.getAfterCreationTime().equals(this.getAfterCreationTime()) == false) + return false; + if (other.getBeforeCreationTime() == null ^ this.getBeforeCreationTime() == null) + return false; + if (other.getBeforeCreationTime() != null + && other.getBeforeCreationTime().equals(this.getBeforeCreationTime()) == false) + return false; + if (other.getMaxResults() == null ^ this.getMaxResults() == null) + return false; + if (other.getMaxResults() != null + && other.getMaxResults().equals(this.getMaxResults()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdaptersResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdaptersResult.java new file mode 100644 index 00000000000..882a45c2982 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListAdaptersResult.java @@ -0,0 +1,233 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class ListAdaptersResult implements Serializable { + /** + *

    + * A list of adapters that matches the filtering criteria specified when + * calling ListAdapters. + *

    + */ + private java.util.List adapters; + + /** + *

    + * Identifies the next page of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + */ + private String nextToken; + + /** + *

    + * A list of adapters that matches the filtering criteria specified when + * calling ListAdapters. + *

    + * + * @return

    + * A list of adapters that matches the filtering criteria specified + * when calling ListAdapters. + *

    + */ + public java.util.List getAdapters() { + return adapters; + } + + /** + *

    + * A list of adapters that matches the filtering criteria specified when + * calling ListAdapters. + *

    + * + * @param adapters

    + * A list of adapters that matches the filtering criteria + * specified when calling ListAdapters. + *

    + */ + public void setAdapters(java.util.Collection adapters) { + if (adapters == null) { + this.adapters = null; + return; + } + + this.adapters = new java.util.ArrayList(adapters); + } + + /** + *

    + * A list of adapters that matches the filtering criteria specified when + * calling ListAdapters. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adapters

    + * A list of adapters that matches the filtering criteria + * specified when calling ListAdapters. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdaptersResult withAdapters(AdapterOverview... adapters) { + if (getAdapters() == null) { + this.adapters = new java.util.ArrayList(adapters.length); + } + for (AdapterOverview value : adapters) { + this.adapters.add(value); + } + return this; + } + + /** + *

    + * A list of adapters that matches the filtering criteria specified when + * calling ListAdapters. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adapters

    + * A list of adapters that matches the filtering criteria + * specified when calling ListAdapters. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdaptersResult withAdapters(java.util.Collection adapters) { + setAdapters(adapters); + return this; + } + + /** + *

    + * Identifies the next page of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @return

    + * Identifies the next page of results to return when listing + * adapters. + *

    + */ + public String getNextToken() { + return nextToken; + } + + /** + *

    + * Identifies the next page of results to return when listing adapters. + *

    + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @param nextToken

    + * Identifies the next page of results to return when listing + * adapters. + *

    + */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

    + * Identifies the next page of results to return when listing adapters. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 1024
    + * Pattern: .*\S.*
    + * + * @param nextToken

    + * Identifies the next page of results to return when listing + * adapters. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListAdaptersResult withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapters() != null) + sb.append("Adapters: " + getAdapters() + ","); + if (getNextToken() != null) + sb.append("NextToken: " + getNextToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapters() == null) ? 0 : getAdapters().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListAdaptersResult == false) + return false; + ListAdaptersResult other = (ListAdaptersResult) obj; + + if (other.getAdapters() == null ^ this.getAdapters() == null) + return false; + if (other.getAdapters() != null && other.getAdapters().equals(this.getAdapters()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListTagsForResourceRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListTagsForResourceRequest.java new file mode 100644 index 00000000000..db2d38c2159 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListTagsForResourceRequest.java @@ -0,0 +1,144 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Lists all tags for an Amazon Textract resource. + *

    + */ +public class ListTagsForResourceRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to list tags + * for. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + */ + private String resourceARN; + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to list tags + * for. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @return

    + * The Amazon Resource Name (ARN) that specifies the resource to + * list tags for. + *

    + */ + public String getResourceARN() { + return resourceARN; + } + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to list tags + * for. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @param resourceARN

    + * The Amazon Resource Name (ARN) that specifies the resource to + * list tags for. + *

    + */ + public void setResourceARN(String resourceARN) { + this.resourceARN = resourceARN; + } + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to list tags + * for. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @param resourceARN

    + * The Amazon Resource Name (ARN) that specifies the resource to + * list tags for. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListTagsForResourceRequest withResourceARN(String resourceARN) { + this.resourceARN = resourceARN; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getResourceARN() != null) + sb.append("ResourceARN: " + getResourceARN()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getResourceARN() == null) ? 0 : getResourceARN().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListTagsForResourceRequest == false) + return false; + ListTagsForResourceRequest other = (ListTagsForResourceRequest) obj; + + if (other.getResourceARN() == null ^ this.getResourceARN() == null) + return false; + if (other.getResourceARN() != null + && other.getResourceARN().equals(this.getResourceARN()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListTagsForResourceResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListTagsForResourceResult.java new file mode 100644 index 00000000000..4920ceabe01 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ListTagsForResourceResult.java @@ -0,0 +1,154 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class ListTagsForResourceResult implements Serializable { + /** + *

    + * A set of tags (key-value pairs) that are part of the requested resource. + *

    + */ + private java.util.Map tags; + + /** + *

    + * A set of tags (key-value pairs) that are part of the requested resource. + *

    + * + * @return

    + * A set of tags (key-value pairs) that are part of the requested + * resource. + *

    + */ + public java.util.Map getTags() { + return tags; + } + + /** + *

    + * A set of tags (key-value pairs) that are part of the requested resource. + *

    + * + * @param tags

    + * A set of tags (key-value pairs) that are part of the requested + * resource. + *

    + */ + public void setTags(java.util.Map tags) { + this.tags = tags; + } + + /** + *

    + * A set of tags (key-value pairs) that are part of the requested resource. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tags

    + * A set of tags (key-value pairs) that are part of the requested + * resource. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListTagsForResourceResult withTags(java.util.Map tags) { + this.tags = tags; + return this; + } + + /** + *

    + * A set of tags (key-value pairs) that are part of the requested resource. + *

    + *

    + * The method adds a new key-value pair into Tags parameter, and returns a + * reference to this object so that method calls can be chained together. + * + * @param key The key of the entry to be added into Tags. + * @param value The corresponding value of the entry to be added into Tags. + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListTagsForResourceResult addTagsEntry(String key, String value) { + if (null == this.tags) { + this.tags = new java.util.HashMap(); + } + if (this.tags.containsKey(key)) + throw new IllegalArgumentException("Duplicated keys (" + key.toString() + + ") are provided."); + this.tags.put(key, value); + return this; + } + + /** + * Removes all the entries added into Tags. + *

    + * Returns a reference to this object so that method calls can be chained + * together. + */ + public ListTagsForResourceResult clearTagsEntries() { + this.tags = null; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getTags() != null) + sb.append("Tags: " + getTags()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListTagsForResourceResult == false) + return false; + ListTagsForResourceResult other = (ListTagsForResourceResult) obj; + + if (other.getTags() == null ^ this.getTags() == null) + return false; + if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ResourceNotFoundException.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ResourceNotFoundException.java new file mode 100644 index 00000000000..89e2cf86713 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ResourceNotFoundException.java @@ -0,0 +1,37 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import com.amazonaws.AmazonServiceException; + +/** + *

    + * Returned when an operation tried to access a nonexistent resource. + *

    + */ +public class ResourceNotFoundException extends AmazonServiceException { + private static final long serialVersionUID = 1L; + + /** + * Constructs a new ResourceNotFoundException with the specified error + * message. + * + * @param message Describes the error encountered. + */ + public ResourceNotFoundException(String message) { + super(message); + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ServiceQuotaExceededException.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ServiceQuotaExceededException.java new file mode 100644 index 00000000000..4c200fb561c --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ServiceQuotaExceededException.java @@ -0,0 +1,38 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import com.amazonaws.AmazonServiceException; + +/** + *

    + * Returned when a request cannot be completed as it would exceed a maximum + * service quota. + *

    + */ +public class ServiceQuotaExceededException extends AmazonServiceException { + private static final long serialVersionUID = 1L; + + /** + * Constructs a new ServiceQuotaExceededException with the specified error + * message. + * + * @param message Describes the error encountered. + */ + public ServiceQuotaExceededException(String message) { + super(message); + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/StartDocumentAnalysisRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/StartDocumentAnalysisRequest.java index 20236a00f45..4b640a821bd 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/StartDocumentAnalysisRequest.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/StartDocumentAnalysisRequest.java @@ -137,6 +137,13 @@ public class StartDocumentAnalysisRequest extends AmazonWebServiceRequest implem */ private QueriesConfig queriesConfig; + /** + *

    + * Specifies the adapter to be used when analyzing a document. + *

    + */ + private AdaptersConfig adaptersConfig; + /** *

    * The location of the document to be processed. @@ -706,6 +713,51 @@ public StartDocumentAnalysisRequest withQueriesConfig(QueriesConfig queriesConfi return this; } + /** + *

    + * Specifies the adapter to be used when analyzing a document. + *

    + * + * @return

    + * Specifies the adapter to be used when analyzing a document. + *

    + */ + public AdaptersConfig getAdaptersConfig() { + return adaptersConfig; + } + + /** + *

    + * Specifies the adapter to be used when analyzing a document. + *

    + * + * @param adaptersConfig

    + * Specifies the adapter to be used when analyzing a document. + *

    + */ + public void setAdaptersConfig(AdaptersConfig adaptersConfig) { + this.adaptersConfig = adaptersConfig; + } + + /** + *

    + * Specifies the adapter to be used when analyzing a document. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param adaptersConfig

    + * Specifies the adapter to be used when analyzing a document. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public StartDocumentAnalysisRequest withAdaptersConfig(AdaptersConfig adaptersConfig) { + this.adaptersConfig = adaptersConfig; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -732,7 +784,9 @@ public String toString() { if (getKMSKeyId() != null) sb.append("KMSKeyId: " + getKMSKeyId() + ","); if (getQueriesConfig() != null) - sb.append("QueriesConfig: " + getQueriesConfig()); + sb.append("QueriesConfig: " + getQueriesConfig() + ","); + if (getAdaptersConfig() != null) + sb.append("AdaptersConfig: " + getAdaptersConfig()); sb.append("}"); return sb.toString(); } @@ -756,6 +810,8 @@ public int hashCode() { hashCode = prime * hashCode + ((getKMSKeyId() == null) ? 0 : getKMSKeyId().hashCode()); hashCode = prime * hashCode + ((getQueriesConfig() == null) ? 0 : getQueriesConfig().hashCode()); + hashCode = prime * hashCode + + ((getAdaptersConfig() == null) ? 0 : getAdaptersConfig().hashCode()); return hashCode; } @@ -808,6 +864,11 @@ public boolean equals(Object obj) { if (other.getQueriesConfig() != null && other.getQueriesConfig().equals(this.getQueriesConfig()) == false) return false; + if (other.getAdaptersConfig() == null ^ this.getAdaptersConfig() == null) + return false; + if (other.getAdaptersConfig() != null + && other.getAdaptersConfig().equals(this.getAdaptersConfig()) == false) + return false; return true; } } diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/TagResourceRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/TagResourceRequest.java new file mode 100644 index 00000000000..892c4e993c1 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/TagResourceRequest.java @@ -0,0 +1,237 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Adds one or more tags to the specified resource. + *

    + */ +public class TagResourceRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to be tagged. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + */ + private String resourceARN; + + /** + *

    + * A set of tags (key-value pairs) that you want to assign to the resource. + *

    + */ + private java.util.Map tags; + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to be tagged. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @return

    + * The Amazon Resource Name (ARN) that specifies the resource to be + * tagged. + *

    + */ + public String getResourceARN() { + return resourceARN; + } + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to be tagged. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @param resourceARN

    + * The Amazon Resource Name (ARN) that specifies the resource to + * be tagged. + *

    + */ + public void setResourceARN(String resourceARN) { + this.resourceARN = resourceARN; + } + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to be tagged. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @param resourceARN

    + * The Amazon Resource Name (ARN) that specifies the resource to + * be tagged. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TagResourceRequest withResourceARN(String resourceARN) { + this.resourceARN = resourceARN; + return this; + } + + /** + *

    + * A set of tags (key-value pairs) that you want to assign to the resource. + *

    + * + * @return

    + * A set of tags (key-value pairs) that you want to assign to the + * resource. + *

    + */ + public java.util.Map getTags() { + return tags; + } + + /** + *

    + * A set of tags (key-value pairs) that you want to assign to the resource. + *

    + * + * @param tags

    + * A set of tags (key-value pairs) that you want to assign to the + * resource. + *

    + */ + public void setTags(java.util.Map tags) { + this.tags = tags; + } + + /** + *

    + * A set of tags (key-value pairs) that you want to assign to the resource. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tags

    + * A set of tags (key-value pairs) that you want to assign to the + * resource. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TagResourceRequest withTags(java.util.Map tags) { + this.tags = tags; + return this; + } + + /** + *

    + * A set of tags (key-value pairs) that you want to assign to the resource. + *

    + *

    + * The method adds a new key-value pair into Tags parameter, and returns a + * reference to this object so that method calls can be chained together. + * + * @param key The key of the entry to be added into Tags. + * @param value The corresponding value of the entry to be added into Tags. + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TagResourceRequest addTagsEntry(String key, String value) { + if (null == this.tags) { + this.tags = new java.util.HashMap(); + } + if (this.tags.containsKey(key)) + throw new IllegalArgumentException("Duplicated keys (" + key.toString() + + ") are provided."); + this.tags.put(key, value); + return this; + } + + /** + * Removes all the entries added into Tags. + *

    + * Returns a reference to this object so that method calls can be chained + * together. + */ + public TagResourceRequest clearTagsEntries() { + this.tags = null; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getResourceARN() != null) + sb.append("ResourceARN: " + getResourceARN() + ","); + if (getTags() != null) + sb.append("Tags: " + getTags()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getResourceARN() == null) ? 0 : getResourceARN().hashCode()); + hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof TagResourceRequest == false) + return false; + TagResourceRequest other = (TagResourceRequest) obj; + + if (other.getResourceARN() == null ^ this.getResourceARN() == null) + return false; + if (other.getResourceARN() != null + && other.getResourceARN().equals(this.getResourceARN()) == false) + return false; + if (other.getTags() == null ^ this.getTags() == null) + return false; + if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/TagResourceResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/TagResourceResult.java new file mode 100644 index 00000000000..95d6aeb4532 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/TagResourceResult.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class TagResourceResult implements Serializable { + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof TagResourceResult == false) + return false; + TagResourceResult other = (TagResourceResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UntagResourceRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UntagResourceRequest.java new file mode 100644 index 00000000000..314b5f37c9b --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UntagResourceRequest.java @@ -0,0 +1,241 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Removes any tags with the specified keys from the specified resource. + *

    + */ +public class UntagResourceRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to be + * untagged. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + */ + private String resourceARN; + + /** + *

    + * Specifies the tags to be removed from the resource specified by the + * ResourceARN. + *

    + */ + private java.util.List tagKeys; + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to be + * untagged. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @return

    + * The Amazon Resource Name (ARN) that specifies the resource to be + * untagged. + *

    + */ + public String getResourceARN() { + return resourceARN; + } + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to be + * untagged. + *

    + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @param resourceARN

    + * The Amazon Resource Name (ARN) that specifies the resource to + * be untagged. + *

    + */ + public void setResourceARN(String resourceARN) { + this.resourceARN = resourceARN; + } + + /** + *

    + * The Amazon Resource Name (ARN) that specifies the resource to be + * untagged. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 1011
    + * + * @param resourceARN

    + * The Amazon Resource Name (ARN) that specifies the resource to + * be untagged. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UntagResourceRequest withResourceARN(String resourceARN) { + this.resourceARN = resourceARN; + return this; + } + + /** + *

    + * Specifies the tags to be removed from the resource specified by the + * ResourceARN. + *

    + * + * @return

    + * Specifies the tags to be removed from the resource specified by + * the ResourceARN. + *

    + */ + public java.util.List getTagKeys() { + return tagKeys; + } + + /** + *

    + * Specifies the tags to be removed from the resource specified by the + * ResourceARN. + *

    + * + * @param tagKeys

    + * Specifies the tags to be removed from the resource specified + * by the ResourceARN. + *

    + */ + public void setTagKeys(java.util.Collection tagKeys) { + if (tagKeys == null) { + this.tagKeys = null; + return; + } + + this.tagKeys = new java.util.ArrayList(tagKeys); + } + + /** + *

    + * Specifies the tags to be removed from the resource specified by the + * ResourceARN. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tagKeys

    + * Specifies the tags to be removed from the resource specified + * by the ResourceARN. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UntagResourceRequest withTagKeys(String... tagKeys) { + if (getTagKeys() == null) { + this.tagKeys = new java.util.ArrayList(tagKeys.length); + } + for (String value : tagKeys) { + this.tagKeys.add(value); + } + return this; + } + + /** + *

    + * Specifies the tags to be removed from the resource specified by the + * ResourceARN. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param tagKeys

    + * Specifies the tags to be removed from the resource specified + * by the ResourceARN. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UntagResourceRequest withTagKeys(java.util.Collection tagKeys) { + setTagKeys(tagKeys); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getResourceARN() != null) + sb.append("ResourceARN: " + getResourceARN() + ","); + if (getTagKeys() != null) + sb.append("TagKeys: " + getTagKeys()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getResourceARN() == null) ? 0 : getResourceARN().hashCode()); + hashCode = prime * hashCode + ((getTagKeys() == null) ? 0 : getTagKeys().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UntagResourceRequest == false) + return false; + UntagResourceRequest other = (UntagResourceRequest) obj; + + if (other.getResourceARN() == null ^ this.getResourceARN() == null) + return false; + if (other.getResourceARN() != null + && other.getResourceARN().equals(this.getResourceARN()) == false) + return false; + if (other.getTagKeys() == null ^ this.getTagKeys() == null) + return false; + if (other.getTagKeys() != null && other.getTagKeys().equals(this.getTagKeys()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UntagResourceResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UntagResourceResult.java new file mode 100644 index 00000000000..9064b10974e --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UntagResourceResult.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class UntagResourceResult implements Serializable { + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UntagResourceResult == false) + return false; + UntagResourceResult other = (UntagResourceResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UpdateAdapterRequest.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UpdateAdapterRequest.java new file mode 100644 index 00000000000..433ddb2628c --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UpdateAdapterRequest.java @@ -0,0 +1,417 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Update the configuration for an adapter. FeatureTypes configurations cannot + * be updated. At least one new parameter must be specified as an argument. + *

    + */ +public class UpdateAdapterRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * A string containing a unique ID for the adapter that will be updated. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * The new description to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + */ + private String description; + + /** + *

    + * The new name to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + */ + private String adapterName; + + /** + *

    + * The new auto-update status to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + */ + private String autoUpdate; + + /** + *

    + * A string containing a unique ID for the adapter that will be updated. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing a unique ID for the adapter that will be + * updated. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter that will be updated. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter that will be + * updated. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter that will be updated. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter that will be + * updated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterRequest withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * The new description to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @return

    + * The new description to be applied to the adapter. + *

    + */ + public String getDescription() { + return description; + } + + /** + *

    + * The new description to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param description

    + * The new description to be applied to the adapter. + *

    + */ + public void setDescription(String description) { + this.description = description; + } + + /** + *

    + * The new description to be applied to the adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param description

    + * The new description to be applied to the adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterRequest withDescription(String description) { + this.description = description; + return this; + } + + /** + *

    + * The new name to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @return

    + * The new name to be applied to the adapter. + *

    + */ + public String getAdapterName() { + return adapterName; + } + + /** + *

    + * The new name to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @param adapterName

    + * The new name to be applied to the adapter. + *

    + */ + public void setAdapterName(String adapterName) { + this.adapterName = adapterName; + } + + /** + *

    + * The new name to be applied to the adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @param adapterName

    + * The new name to be applied to the adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterRequest withAdapterName(String adapterName) { + this.adapterName = adapterName; + return this; + } + + /** + *

    + * The new auto-update status to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @return

    + * The new auto-update status to be applied to the adapter. + *

    + * @see AutoUpdate + */ + public String getAutoUpdate() { + return autoUpdate; + } + + /** + *

    + * The new auto-update status to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * The new auto-update status to be applied to the adapter. + *

    + * @see AutoUpdate + */ + public void setAutoUpdate(String autoUpdate) { + this.autoUpdate = autoUpdate; + } + + /** + *

    + * The new auto-update status to be applied to the adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * The new auto-update status to be applied to the adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoUpdate + */ + public UpdateAdapterRequest withAutoUpdate(String autoUpdate) { + this.autoUpdate = autoUpdate; + return this; + } + + /** + *

    + * The new auto-update status to be applied to the adapter. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * The new auto-update status to be applied to the adapter. + *

    + * @see AutoUpdate + */ + public void setAutoUpdate(AutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate.toString(); + } + + /** + *

    + * The new auto-update status to be applied to the adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * The new auto-update status to be applied to the adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoUpdate + */ + public UpdateAdapterRequest withAutoUpdate(AutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate.toString(); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getDescription() != null) + sb.append("Description: " + getDescription() + ","); + if (getAdapterName() != null) + sb.append("AdapterName: " + getAdapterName() + ","); + if (getAutoUpdate() != null) + sb.append("AutoUpdate: " + getAutoUpdate()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getDescription() == null) ? 0 : getDescription().hashCode()); + hashCode = prime * hashCode + + ((getAdapterName() == null) ? 0 : getAdapterName().hashCode()); + hashCode = prime * hashCode + ((getAutoUpdate() == null) ? 0 : getAutoUpdate().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UpdateAdapterRequest == false) + return false; + UpdateAdapterRequest other = (UpdateAdapterRequest) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getDescription() == null ^ this.getDescription() == null) + return false; + if (other.getDescription() != null + && other.getDescription().equals(this.getDescription()) == false) + return false; + if (other.getAdapterName() == null ^ this.getAdapterName() == null) + return false; + if (other.getAdapterName() != null + && other.getAdapterName().equals(this.getAdapterName()) == false) + return false; + if (other.getAutoUpdate() == null ^ this.getAutoUpdate() == null) + return false; + if (other.getAutoUpdate() != null + && other.getAutoUpdate().equals(this.getAutoUpdate()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UpdateAdapterResult.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UpdateAdapterResult.java new file mode 100644 index 00000000000..1707eba3288 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/UpdateAdapterResult.java @@ -0,0 +1,573 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import java.io.Serializable; + +public class UpdateAdapterResult implements Serializable { + /** + *

    + * A string containing a unique ID for the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + */ + private String adapterId; + + /** + *

    + * A string containing the name of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + */ + private String adapterName; + + /** + *

    + * An object specifying the creation time of the the adapter that has been + * updated. + *

    + */ + private java.util.Date creationTime; + + /** + *

    + * A string containing the description of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + */ + private String description; + + /** + *

    + * List of the targeted feature types for the updated adapter. + *

    + */ + private java.util.List featureTypes; + + /** + *

    + * The auto-update status of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + */ + private String autoUpdate; + + /** + *

    + * A string containing a unique ID for the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @return

    + * A string containing a unique ID for the adapter that has been + * updated. + *

    + */ + public String getAdapterId() { + return adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter that has been + * updated. + *

    + */ + public void setAdapterId(String adapterId) { + this.adapterId = adapterId; + } + + /** + *

    + * A string containing a unique ID for the adapter that has been updated. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 12 - 1011
    + * + * @param adapterId

    + * A string containing a unique ID for the adapter that has been + * updated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterResult withAdapterId(String adapterId) { + this.adapterId = adapterId; + return this; + } + + /** + *

    + * A string containing the name of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @return

    + * A string containing the name of the adapter that has been + * updated. + *

    + */ + public String getAdapterName() { + return adapterName; + } + + /** + *

    + * A string containing the name of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @param adapterName

    + * A string containing the name of the adapter that has been + * updated. + *

    + */ + public void setAdapterName(String adapterName) { + this.adapterName = adapterName; + } + + /** + *

    + * A string containing the name of the adapter that has been updated. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9-_]+
    + * + * @param adapterName

    + * A string containing the name of the adapter that has been + * updated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterResult withAdapterName(String adapterName) { + this.adapterName = adapterName; + return this; + } + + /** + *

    + * An object specifying the creation time of the the adapter that has been + * updated. + *

    + * + * @return

    + * An object specifying the creation time of the the adapter that + * has been updated. + *

    + */ + public java.util.Date getCreationTime() { + return creationTime; + } + + /** + *

    + * An object specifying the creation time of the the adapter that has been + * updated. + *

    + * + * @param creationTime

    + * An object specifying the creation time of the the adapter that + * has been updated. + *

    + */ + public void setCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + } + + /** + *

    + * An object specifying the creation time of the the adapter that has been + * updated. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param creationTime

    + * An object specifying the creation time of the the adapter that + * has been updated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterResult withCreationTime(java.util.Date creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + *

    + * A string containing the description of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @return

    + * A string containing the description of the adapter that has been + * updated. + *

    + */ + public String getDescription() { + return description; + } + + /** + *

    + * A string containing the description of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param description

    + * A string containing the description of the adapter that has + * been updated. + *

    + */ + public void setDescription(String description) { + this.description = description; + } + + /** + *

    + * A string containing the description of the adapter that has been updated. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 256
    + * Pattern: + * ^[a-zA-Z0-9\s!"\#\$%'&\(\)\*\+\,\-\./:;=\?@\[\\\]\^_`\{\|\}~><]+$ + *
    + * + * @param description

    + * A string containing the description of the adapter that has + * been updated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterResult withDescription(String description) { + this.description = description; + return this; + } + + /** + *

    + * List of the targeted feature types for the updated adapter. + *

    + * + * @return

    + * List of the targeted feature types for the updated adapter. + *

    + */ + public java.util.List getFeatureTypes() { + return featureTypes; + } + + /** + *

    + * List of the targeted feature types for the updated adapter. + *

    + * + * @param featureTypes

    + * List of the targeted feature types for the updated adapter. + *

    + */ + public void setFeatureTypes(java.util.Collection featureTypes) { + if (featureTypes == null) { + this.featureTypes = null; + return; + } + + this.featureTypes = new java.util.ArrayList(featureTypes); + } + + /** + *

    + * List of the targeted feature types for the updated adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

    + * List of the targeted feature types for the updated adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterResult withFeatureTypes(String... featureTypes) { + if (getFeatureTypes() == null) { + this.featureTypes = new java.util.ArrayList(featureTypes.length); + } + for (String value : featureTypes) { + this.featureTypes.add(value); + } + return this; + } + + /** + *

    + * List of the targeted feature types for the updated adapter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param featureTypes

    + * List of the targeted feature types for the updated adapter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UpdateAdapterResult withFeatureTypes(java.util.Collection featureTypes) { + setFeatureTypes(featureTypes); + return this; + } + + /** + *

    + * The auto-update status of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @return

    + * The auto-update status of the adapter that has been updated. + *

    + * @see AutoUpdate + */ + public String getAutoUpdate() { + return autoUpdate; + } + + /** + *

    + * The auto-update status of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * The auto-update status of the adapter that has been updated. + *

    + * @see AutoUpdate + */ + public void setAutoUpdate(String autoUpdate) { + this.autoUpdate = autoUpdate; + } + + /** + *

    + * The auto-update status of the adapter that has been updated. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * The auto-update status of the adapter that has been updated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoUpdate + */ + public UpdateAdapterResult withAutoUpdate(String autoUpdate) { + this.autoUpdate = autoUpdate; + return this; + } + + /** + *

    + * The auto-update status of the adapter that has been updated. + *

    + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * The auto-update status of the adapter that has been updated. + *

    + * @see AutoUpdate + */ + public void setAutoUpdate(AutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate.toString(); + } + + /** + *

    + * The auto-update status of the adapter that has been updated. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ENABLED, DISABLED + * + * @param autoUpdate

    + * The auto-update status of the adapter that has been updated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see AutoUpdate + */ + public UpdateAdapterResult withAutoUpdate(AutoUpdate autoUpdate) { + this.autoUpdate = autoUpdate.toString(); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAdapterId() != null) + sb.append("AdapterId: " + getAdapterId() + ","); + if (getAdapterName() != null) + sb.append("AdapterName: " + getAdapterName() + ","); + if (getCreationTime() != null) + sb.append("CreationTime: " + getCreationTime() + ","); + if (getDescription() != null) + sb.append("Description: " + getDescription() + ","); + if (getFeatureTypes() != null) + sb.append("FeatureTypes: " + getFeatureTypes() + ","); + if (getAutoUpdate() != null) + sb.append("AutoUpdate: " + getAutoUpdate()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getAdapterId() == null) ? 0 : getAdapterId().hashCode()); + hashCode = prime * hashCode + + ((getAdapterName() == null) ? 0 : getAdapterName().hashCode()); + hashCode = prime * hashCode + + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode()); + hashCode = prime * hashCode + + ((getDescription() == null) ? 0 : getDescription().hashCode()); + hashCode = prime * hashCode + + ((getFeatureTypes() == null) ? 0 : getFeatureTypes().hashCode()); + hashCode = prime * hashCode + ((getAutoUpdate() == null) ? 0 : getAutoUpdate().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UpdateAdapterResult == false) + return false; + UpdateAdapterResult other = (UpdateAdapterResult) obj; + + if (other.getAdapterId() == null ^ this.getAdapterId() == null) + return false; + if (other.getAdapterId() != null + && other.getAdapterId().equals(this.getAdapterId()) == false) + return false; + if (other.getAdapterName() == null ^ this.getAdapterName() == null) + return false; + if (other.getAdapterName() != null + && other.getAdapterName().equals(this.getAdapterName()) == false) + return false; + if (other.getCreationTime() == null ^ this.getCreationTime() == null) + return false; + if (other.getCreationTime() != null + && other.getCreationTime().equals(this.getCreationTime()) == false) + return false; + if (other.getDescription() == null ^ this.getDescription() == null) + return false; + if (other.getDescription() != null + && other.getDescription().equals(this.getDescription()) == false) + return false; + if (other.getFeatureTypes() == null ^ this.getFeatureTypes() == null) + return false; + if (other.getFeatureTypes() != null + && other.getFeatureTypes().equals(this.getFeatureTypes()) == false) + return false; + if (other.getAutoUpdate() == null ^ this.getAutoUpdate() == null) + return false; + if (other.getAutoUpdate() != null + && other.getAutoUpdate().equals(this.getAutoUpdate()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ValidationException.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ValidationException.java new file mode 100644 index 00000000000..1bccb861a8e --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/ValidationException.java @@ -0,0 +1,36 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model; + +import com.amazonaws.AmazonServiceException; + +/** + *

    + * Indicates that a request was not valid. Check request for proper formatting. + *

    + */ +public class ValidationException extends AmazonServiceException { + private static final long serialVersionUID = 1L; + + /** + * Constructs a new ValidationException with the specified error message. + * + * @param message Describes the error encountered. + */ + public ValidationException(String message) { + super(message); + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterJsonMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterJsonMarshaller.java new file mode 100644 index 00000000000..7a77357a3cd --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterJsonMarshaller.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO Adapter + */ +class AdapterJsonMarshaller { + + public void marshall(Adapter adapter, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (adapter.getAdapterId() != null) { + String adapterId = adapter.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + if (adapter.getPages() != null) { + java.util.List pages = adapter.getPages(); + jsonWriter.name("Pages"); + jsonWriter.beginArray(); + for (String pagesItem : pages) { + if (pagesItem != null) { + jsonWriter.value(pagesItem); + } + } + jsonWriter.endArray(); + } + if (adapter.getVersion() != null) { + String version = adapter.getVersion(); + jsonWriter.name("Version"); + jsonWriter.value(version); + } + jsonWriter.endObject(); + } + + private static AdapterJsonMarshaller instance; + + public static AdapterJsonMarshaller getInstance() { + if (instance == null) + instance = new AdapterJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterJsonUnmarshaller.java new file mode 100644 index 00000000000..09e18e171c1 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterJsonUnmarshaller.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO Adapter + */ +class AdapterJsonUnmarshaller implements Unmarshaller { + + public Adapter unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + Adapter adapter = new Adapter(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterId")) { + adapter.setAdapterId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Pages")) { + adapter.setPages(new ListUnmarshaller(StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("Version")) { + adapter.setVersion(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return adapter; + } + + private static AdapterJsonUnmarshaller instance; + + public static AdapterJsonUnmarshaller getInstance() { + if (instance == null) + instance = new AdapterJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterOverviewJsonMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterOverviewJsonMarshaller.java new file mode 100644 index 00000000000..96c32f6dc72 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterOverviewJsonMarshaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO AdapterOverview + */ +class AdapterOverviewJsonMarshaller { + + public void marshall(AdapterOverview adapterOverview, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (adapterOverview.getAdapterId() != null) { + String adapterId = adapterOverview.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + if (adapterOverview.getAdapterName() != null) { + String adapterName = adapterOverview.getAdapterName(); + jsonWriter.name("AdapterName"); + jsonWriter.value(adapterName); + } + if (adapterOverview.getCreationTime() != null) { + java.util.Date creationTime = adapterOverview.getCreationTime(); + jsonWriter.name("CreationTime"); + jsonWriter.value(creationTime); + } + if (adapterOverview.getFeatureTypes() != null) { + java.util.List featureTypes = adapterOverview.getFeatureTypes(); + jsonWriter.name("FeatureTypes"); + jsonWriter.beginArray(); + for (String featureTypesItem : featureTypes) { + if (featureTypesItem != null) { + jsonWriter.value(featureTypesItem); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static AdapterOverviewJsonMarshaller instance; + + public static AdapterOverviewJsonMarshaller getInstance() { + if (instance == null) + instance = new AdapterOverviewJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterOverviewJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterOverviewJsonUnmarshaller.java new file mode 100644 index 00000000000..b68c3c08a0b --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterOverviewJsonUnmarshaller.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO AdapterOverview + */ +class AdapterOverviewJsonUnmarshaller implements + Unmarshaller { + + public AdapterOverview unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + AdapterOverview adapterOverview = new AdapterOverview(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterId")) { + adapterOverview.setAdapterId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("AdapterName")) { + adapterOverview.setAdapterName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("CreationTime")) { + adapterOverview.setCreationTime(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("FeatureTypes")) { + adapterOverview.setFeatureTypes(new ListUnmarshaller(StringJsonUnmarshaller + .getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return adapterOverview; + } + + private static AdapterOverviewJsonUnmarshaller instance; + + public static AdapterOverviewJsonUnmarshaller getInstance() { + if (instance == null) + instance = new AdapterOverviewJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionDatasetConfigJsonMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionDatasetConfigJsonMarshaller.java new file mode 100644 index 00000000000..02e82919088 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionDatasetConfigJsonMarshaller.java @@ -0,0 +1,45 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO AdapterVersionDatasetConfig + */ +class AdapterVersionDatasetConfigJsonMarshaller { + + public void marshall(AdapterVersionDatasetConfig adapterVersionDatasetConfig, + AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (adapterVersionDatasetConfig.getManifestS3Object() != null) { + S3Object manifestS3Object = adapterVersionDatasetConfig.getManifestS3Object(); + jsonWriter.name("ManifestS3Object"); + S3ObjectJsonMarshaller.getInstance().marshall(manifestS3Object, jsonWriter); + } + jsonWriter.endObject(); + } + + private static AdapterVersionDatasetConfigJsonMarshaller instance; + + public static AdapterVersionDatasetConfigJsonMarshaller getInstance() { + if (instance == null) + instance = new AdapterVersionDatasetConfigJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionDatasetConfigJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionDatasetConfigJsonUnmarshaller.java new file mode 100644 index 00000000000..0a6281a4e93 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionDatasetConfigJsonUnmarshaller.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO AdapterVersionDatasetConfig + */ +class AdapterVersionDatasetConfigJsonUnmarshaller implements + Unmarshaller { + + public AdapterVersionDatasetConfig unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + AdapterVersionDatasetConfig adapterVersionDatasetConfig = new AdapterVersionDatasetConfig(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("ManifestS3Object")) { + adapterVersionDatasetConfig.setManifestS3Object(S3ObjectJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return adapterVersionDatasetConfig; + } + + private static AdapterVersionDatasetConfigJsonUnmarshaller instance; + + public static AdapterVersionDatasetConfigJsonUnmarshaller getInstance() { + if (instance == null) + instance = new AdapterVersionDatasetConfigJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionEvaluationMetricJsonMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionEvaluationMetricJsonMarshaller.java new file mode 100644 index 00000000000..311e673bfbd --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionEvaluationMetricJsonMarshaller.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO AdapterVersionEvaluationMetric + */ +class AdapterVersionEvaluationMetricJsonMarshaller { + + public void marshall(AdapterVersionEvaluationMetric adapterVersionEvaluationMetric, + AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (adapterVersionEvaluationMetric.getBaseline() != null) { + EvaluationMetric baseline = adapterVersionEvaluationMetric.getBaseline(); + jsonWriter.name("Baseline"); + EvaluationMetricJsonMarshaller.getInstance().marshall(baseline, jsonWriter); + } + if (adapterVersionEvaluationMetric.getAdapterVersion() != null) { + EvaluationMetric adapterVersion = adapterVersionEvaluationMetric.getAdapterVersion(); + jsonWriter.name("AdapterVersion"); + EvaluationMetricJsonMarshaller.getInstance().marshall(adapterVersion, jsonWriter); + } + if (adapterVersionEvaluationMetric.getFeatureType() != null) { + String featureType = adapterVersionEvaluationMetric.getFeatureType(); + jsonWriter.name("FeatureType"); + jsonWriter.value(featureType); + } + jsonWriter.endObject(); + } + + private static AdapterVersionEvaluationMetricJsonMarshaller instance; + + public static AdapterVersionEvaluationMetricJsonMarshaller getInstance() { + if (instance == null) + instance = new AdapterVersionEvaluationMetricJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionEvaluationMetricJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionEvaluationMetricJsonUnmarshaller.java new file mode 100644 index 00000000000..7ec6fd0b375 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionEvaluationMetricJsonUnmarshaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO AdapterVersionEvaluationMetric + */ +class AdapterVersionEvaluationMetricJsonUnmarshaller implements + Unmarshaller { + + public AdapterVersionEvaluationMetric unmarshall(JsonUnmarshallerContext context) + throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + AdapterVersionEvaluationMetric adapterVersionEvaluationMetric = new AdapterVersionEvaluationMetric(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Baseline")) { + adapterVersionEvaluationMetric.setBaseline(EvaluationMetricJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else if (name.equals("AdapterVersion")) { + adapterVersionEvaluationMetric.setAdapterVersion(EvaluationMetricJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else if (name.equals("FeatureType")) { + adapterVersionEvaluationMetric.setFeatureType(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return adapterVersionEvaluationMetric; + } + + private static AdapterVersionEvaluationMetricJsonUnmarshaller instance; + + public static AdapterVersionEvaluationMetricJsonUnmarshaller getInstance() { + if (instance == null) + instance = new AdapterVersionEvaluationMetricJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionOverviewJsonMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionOverviewJsonMarshaller.java new file mode 100644 index 00000000000..86f460f13b7 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionOverviewJsonMarshaller.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO AdapterVersionOverview + */ +class AdapterVersionOverviewJsonMarshaller { + + public void marshall(AdapterVersionOverview adapterVersionOverview, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (adapterVersionOverview.getAdapterId() != null) { + String adapterId = adapterVersionOverview.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + if (adapterVersionOverview.getAdapterVersion() != null) { + String adapterVersion = adapterVersionOverview.getAdapterVersion(); + jsonWriter.name("AdapterVersion"); + jsonWriter.value(adapterVersion); + } + if (adapterVersionOverview.getCreationTime() != null) { + java.util.Date creationTime = adapterVersionOverview.getCreationTime(); + jsonWriter.name("CreationTime"); + jsonWriter.value(creationTime); + } + if (adapterVersionOverview.getFeatureTypes() != null) { + java.util.List featureTypes = adapterVersionOverview.getFeatureTypes(); + jsonWriter.name("FeatureTypes"); + jsonWriter.beginArray(); + for (String featureTypesItem : featureTypes) { + if (featureTypesItem != null) { + jsonWriter.value(featureTypesItem); + } + } + jsonWriter.endArray(); + } + if (adapterVersionOverview.getStatus() != null) { + String status = adapterVersionOverview.getStatus(); + jsonWriter.name("Status"); + jsonWriter.value(status); + } + if (adapterVersionOverview.getStatusMessage() != null) { + String statusMessage = adapterVersionOverview.getStatusMessage(); + jsonWriter.name("StatusMessage"); + jsonWriter.value(statusMessage); + } + jsonWriter.endObject(); + } + + private static AdapterVersionOverviewJsonMarshaller instance; + + public static AdapterVersionOverviewJsonMarshaller getInstance() { + if (instance == null) + instance = new AdapterVersionOverviewJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionOverviewJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionOverviewJsonUnmarshaller.java new file mode 100644 index 00000000000..6790519a986 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdapterVersionOverviewJsonUnmarshaller.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO AdapterVersionOverview + */ +class AdapterVersionOverviewJsonUnmarshaller implements + Unmarshaller { + + public AdapterVersionOverview unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + AdapterVersionOverview adapterVersionOverview = new AdapterVersionOverview(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterId")) { + adapterVersionOverview.setAdapterId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("AdapterVersion")) { + adapterVersionOverview.setAdapterVersion(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("CreationTime")) { + adapterVersionOverview.setCreationTime(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("FeatureTypes")) { + adapterVersionOverview.setFeatureTypes(new ListUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("Status")) { + adapterVersionOverview.setStatus(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("StatusMessage")) { + adapterVersionOverview.setStatusMessage(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return adapterVersionOverview; + } + + private static AdapterVersionOverviewJsonUnmarshaller instance; + + public static AdapterVersionOverviewJsonUnmarshaller getInstance() { + if (instance == null) + instance = new AdapterVersionOverviewJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdaptersConfigJsonMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdaptersConfigJsonMarshaller.java new file mode 100644 index 00000000000..b71310a7b39 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdaptersConfigJsonMarshaller.java @@ -0,0 +1,50 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO AdaptersConfig + */ +class AdaptersConfigJsonMarshaller { + + public void marshall(AdaptersConfig adaptersConfig, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (adaptersConfig.getAdapters() != null) { + java.util.List adapters = adaptersConfig.getAdapters(); + jsonWriter.name("Adapters"); + jsonWriter.beginArray(); + for (Adapter adaptersItem : adapters) { + if (adaptersItem != null) { + AdapterJsonMarshaller.getInstance().marshall(adaptersItem, jsonWriter); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static AdaptersConfigJsonMarshaller instance; + + public static AdaptersConfigJsonMarshaller getInstance() { + if (instance == null) + instance = new AdaptersConfigJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdaptersConfigJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdaptersConfigJsonUnmarshaller.java new file mode 100644 index 00000000000..e9bfbabafa7 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AdaptersConfigJsonUnmarshaller.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO AdaptersConfig + */ +class AdaptersConfigJsonUnmarshaller implements + Unmarshaller { + + public AdaptersConfig unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + AdaptersConfig adaptersConfig = new AdaptersConfig(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Adapters")) { + adaptersConfig.setAdapters(new ListUnmarshaller(AdapterJsonUnmarshaller + .getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return adaptersConfig; + } + + private static AdaptersConfigJsonUnmarshaller instance; + + public static AdaptersConfigJsonUnmarshaller getInstance() { + if (instance == null) + instance = new AdaptersConfigJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AnalyzeDocumentRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AnalyzeDocumentRequestMarshaller.java index d5373a6a291..234a28b60e8 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AnalyzeDocumentRequestMarshaller.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/AnalyzeDocumentRequestMarshaller.java @@ -88,6 +88,11 @@ public Request marshall(AnalyzeDocumentRequest analyzeDo jsonWriter.name("QueriesConfig"); QueriesConfigJsonMarshaller.getInstance().marshall(queriesConfig, jsonWriter); } + if (analyzeDocumentRequest.getAdaptersConfig() != null) { + AdaptersConfig adaptersConfig = analyzeDocumentRequest.getAdaptersConfig(); + jsonWriter.name("AdaptersConfig"); + AdaptersConfigJsonMarshaller.getInstance().marshall(adaptersConfig, jsonWriter); + } jsonWriter.endObject(); jsonWriter.close(); diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ConflictExceptionUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ConflictExceptionUnmarshaller.java new file mode 100644 index 00000000000..cd58111a327 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ConflictExceptionUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse; +import com.amazonaws.transform.JsonErrorUnmarshaller; +import com.amazonaws.services.textract.model.ConflictException; + +public class ConflictExceptionUnmarshaller extends JsonErrorUnmarshaller { + + public ConflictExceptionUnmarshaller() { + super(ConflictException.class); + } + + @Override + public boolean match(JsonErrorResponse error) throws Exception { + return error.getErrorCode().equals("ConflictException"); + } + + @Override + public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception { + + ConflictException e = (ConflictException) super.unmarshall(error); + e.setErrorCode("ConflictException"); + + return e; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterRequestMarshaller.java new file mode 100644 index 00000000000..852a4458aa4 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterRequestMarshaller.java @@ -0,0 +1,126 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for CreateAdapterRequest + */ +public class CreateAdapterRequestMarshaller implements + Marshaller, CreateAdapterRequest> { + + public Request marshall(CreateAdapterRequest createAdapterRequest) { + if (createAdapterRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(CreateAdapterRequest)"); + } + + Request request = new DefaultRequest( + createAdapterRequest, "AmazonTextract"); + String target = "Textract.CreateAdapter"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (createAdapterRequest.getAdapterName() != null) { + String adapterName = createAdapterRequest.getAdapterName(); + jsonWriter.name("AdapterName"); + jsonWriter.value(adapterName); + } + if (createAdapterRequest.getClientRequestToken() != null) { + String clientRequestToken = createAdapterRequest.getClientRequestToken(); + jsonWriter.name("ClientRequestToken"); + jsonWriter.value(clientRequestToken); + } + if (createAdapterRequest.getDescription() != null) { + String description = createAdapterRequest.getDescription(); + jsonWriter.name("Description"); + jsonWriter.value(description); + } + if (createAdapterRequest.getFeatureTypes() != null) { + java.util.List featureTypes = createAdapterRequest.getFeatureTypes(); + jsonWriter.name("FeatureTypes"); + jsonWriter.beginArray(); + for (String featureTypesItem : featureTypes) { + if (featureTypesItem != null) { + jsonWriter.value(featureTypesItem); + } + } + jsonWriter.endArray(); + } + if (createAdapterRequest.getAutoUpdate() != null) { + String autoUpdate = createAdapterRequest.getAutoUpdate(); + jsonWriter.name("AutoUpdate"); + jsonWriter.value(autoUpdate); + } + if (createAdapterRequest.getTags() != null) { + java.util.Map tags = createAdapterRequest.getTags(); + jsonWriter.name("Tags"); + jsonWriter.beginObject(); + for (java.util.Map.Entry tagsEntry : tags.entrySet()) { + String tagsValue = tagsEntry.getValue(); + if (tagsValue != null) { + jsonWriter.name(tagsEntry.getKey()); + jsonWriter.value(tagsValue); + } + } + jsonWriter.endObject(); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterResultJsonUnmarshaller.java new file mode 100644 index 00000000000..d544085dbc4 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterResultJsonUnmarshaller.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response CreateAdapterResult + */ +public class CreateAdapterResultJsonUnmarshaller implements + Unmarshaller { + + public CreateAdapterResult unmarshall(JsonUnmarshallerContext context) throws Exception { + CreateAdapterResult createAdapterResult = new CreateAdapterResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterId")) { + createAdapterResult.setAdapterId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return createAdapterResult; + } + + private static CreateAdapterResultJsonUnmarshaller instance; + + public static CreateAdapterResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new CreateAdapterResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterVersionRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterVersionRequestMarshaller.java new file mode 100644 index 00000000000..bb596e03415 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterVersionRequestMarshaller.java @@ -0,0 +1,123 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for CreateAdapterVersionRequest + */ +public class CreateAdapterVersionRequestMarshaller implements + Marshaller, CreateAdapterVersionRequest> { + + public Request marshall( + CreateAdapterVersionRequest createAdapterVersionRequest) { + if (createAdapterVersionRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(CreateAdapterVersionRequest)"); + } + + Request request = new DefaultRequest( + createAdapterVersionRequest, "AmazonTextract"); + String target = "Textract.CreateAdapterVersion"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (createAdapterVersionRequest.getAdapterId() != null) { + String adapterId = createAdapterVersionRequest.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + if (createAdapterVersionRequest.getClientRequestToken() != null) { + String clientRequestToken = createAdapterVersionRequest.getClientRequestToken(); + jsonWriter.name("ClientRequestToken"); + jsonWriter.value(clientRequestToken); + } + if (createAdapterVersionRequest.getDatasetConfig() != null) { + AdapterVersionDatasetConfig datasetConfig = createAdapterVersionRequest + .getDatasetConfig(); + jsonWriter.name("DatasetConfig"); + AdapterVersionDatasetConfigJsonMarshaller.getInstance().marshall(datasetConfig, + jsonWriter); + } + if (createAdapterVersionRequest.getKMSKeyId() != null) { + String kMSKeyId = createAdapterVersionRequest.getKMSKeyId(); + jsonWriter.name("KMSKeyId"); + jsonWriter.value(kMSKeyId); + } + if (createAdapterVersionRequest.getOutputConfig() != null) { + OutputConfig outputConfig = createAdapterVersionRequest.getOutputConfig(); + jsonWriter.name("OutputConfig"); + OutputConfigJsonMarshaller.getInstance().marshall(outputConfig, jsonWriter); + } + if (createAdapterVersionRequest.getTags() != null) { + java.util.Map tags = createAdapterVersionRequest.getTags(); + jsonWriter.name("Tags"); + jsonWriter.beginObject(); + for (java.util.Map.Entry tagsEntry : tags.entrySet()) { + String tagsValue = tagsEntry.getValue(); + if (tagsValue != null) { + jsonWriter.name(tagsEntry.getKey()); + jsonWriter.value(tagsValue); + } + } + jsonWriter.endObject(); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterVersionResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterVersionResultJsonUnmarshaller.java new file mode 100644 index 00000000000..fcd6e8c8881 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/CreateAdapterVersionResultJsonUnmarshaller.java @@ -0,0 +1,58 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response CreateAdapterVersionResult + */ +public class CreateAdapterVersionResultJsonUnmarshaller implements + Unmarshaller { + + public CreateAdapterVersionResult unmarshall(JsonUnmarshallerContext context) throws Exception { + CreateAdapterVersionResult createAdapterVersionResult = new CreateAdapterVersionResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterId")) { + createAdapterVersionResult.setAdapterId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("AdapterVersion")) { + createAdapterVersionResult.setAdapterVersion(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return createAdapterVersionResult; + } + + private static CreateAdapterVersionResultJsonUnmarshaller instance; + + public static CreateAdapterVersionResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new CreateAdapterVersionResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterRequestMarshaller.java new file mode 100644 index 00000000000..f8c8e2c1320 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterRequestMarshaller.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for DeleteAdapterRequest + */ +public class DeleteAdapterRequestMarshaller implements + Marshaller, DeleteAdapterRequest> { + + public Request marshall(DeleteAdapterRequest deleteAdapterRequest) { + if (deleteAdapterRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DeleteAdapterRequest)"); + } + + Request request = new DefaultRequest( + deleteAdapterRequest, "AmazonTextract"); + String target = "Textract.DeleteAdapter"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (deleteAdapterRequest.getAdapterId() != null) { + String adapterId = deleteAdapterRequest.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterResultJsonUnmarshaller.java new file mode 100644 index 00000000000..9278b01ce6c --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DeleteAdapterResult + */ +public class DeleteAdapterResultJsonUnmarshaller implements + Unmarshaller { + + public DeleteAdapterResult unmarshall(JsonUnmarshallerContext context) throws Exception { + DeleteAdapterResult deleteAdapterResult = new DeleteAdapterResult(); + + return deleteAdapterResult; + } + + private static DeleteAdapterResultJsonUnmarshaller instance; + + public static DeleteAdapterResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DeleteAdapterResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterVersionRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterVersionRequestMarshaller.java new file mode 100644 index 00000000000..c00838b26b5 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterVersionRequestMarshaller.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for DeleteAdapterVersionRequest + */ +public class DeleteAdapterVersionRequestMarshaller implements + Marshaller, DeleteAdapterVersionRequest> { + + public Request marshall( + DeleteAdapterVersionRequest deleteAdapterVersionRequest) { + if (deleteAdapterVersionRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DeleteAdapterVersionRequest)"); + } + + Request request = new DefaultRequest( + deleteAdapterVersionRequest, "AmazonTextract"); + String target = "Textract.DeleteAdapterVersion"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (deleteAdapterVersionRequest.getAdapterId() != null) { + String adapterId = deleteAdapterVersionRequest.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + if (deleteAdapterVersionRequest.getAdapterVersion() != null) { + String adapterVersion = deleteAdapterVersionRequest.getAdapterVersion(); + jsonWriter.name("AdapterVersion"); + jsonWriter.value(adapterVersion); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterVersionResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterVersionResultJsonUnmarshaller.java new file mode 100644 index 00000000000..f1cc859dac2 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/DeleteAdapterVersionResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DeleteAdapterVersionResult + */ +public class DeleteAdapterVersionResultJsonUnmarshaller implements + Unmarshaller { + + public DeleteAdapterVersionResult unmarshall(JsonUnmarshallerContext context) throws Exception { + DeleteAdapterVersionResult deleteAdapterVersionResult = new DeleteAdapterVersionResult(); + + return deleteAdapterVersionResult; + } + + private static DeleteAdapterVersionResultJsonUnmarshaller instance; + + public static DeleteAdapterVersionResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DeleteAdapterVersionResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/EvaluationMetricJsonMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/EvaluationMetricJsonMarshaller.java new file mode 100644 index 00000000000..be826ee69cf --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/EvaluationMetricJsonMarshaller.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO EvaluationMetric + */ +class EvaluationMetricJsonMarshaller { + + public void marshall(EvaluationMetric evaluationMetric, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (evaluationMetric.getF1Score() != null) { + Float f1Score = evaluationMetric.getF1Score(); + jsonWriter.name("F1Score"); + jsonWriter.value(f1Score); + } + if (evaluationMetric.getPrecision() != null) { + Float precision = evaluationMetric.getPrecision(); + jsonWriter.name("Precision"); + jsonWriter.value(precision); + } + if (evaluationMetric.getRecall() != null) { + Float recall = evaluationMetric.getRecall(); + jsonWriter.name("Recall"); + jsonWriter.value(recall); + } + jsonWriter.endObject(); + } + + private static EvaluationMetricJsonMarshaller instance; + + public static EvaluationMetricJsonMarshaller getInstance() { + if (instance == null) + instance = new EvaluationMetricJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/EvaluationMetricJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/EvaluationMetricJsonUnmarshaller.java new file mode 100644 index 00000000000..25fc218497d --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/EvaluationMetricJsonUnmarshaller.java @@ -0,0 +1,63 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO EvaluationMetric + */ +class EvaluationMetricJsonUnmarshaller implements + Unmarshaller { + + public EvaluationMetric unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + EvaluationMetric evaluationMetric = new EvaluationMetric(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("F1Score")) { + evaluationMetric.setF1Score(FloatJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Precision")) { + evaluationMetric.setPrecision(FloatJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Recall")) { + evaluationMetric.setRecall(FloatJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return evaluationMetric; + } + + private static EvaluationMetricJsonUnmarshaller instance; + + public static EvaluationMetricJsonUnmarshaller getInstance() { + if (instance == null) + instance = new EvaluationMetricJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterRequestMarshaller.java new file mode 100644 index 00000000000..8efef556d76 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterRequestMarshaller.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for GetAdapterRequest + */ +public class GetAdapterRequestMarshaller implements + Marshaller, GetAdapterRequest> { + + public Request marshall(GetAdapterRequest getAdapterRequest) { + if (getAdapterRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(GetAdapterRequest)"); + } + + Request request = new DefaultRequest( + getAdapterRequest, "AmazonTextract"); + String target = "Textract.GetAdapter"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (getAdapterRequest.getAdapterId() != null) { + String adapterId = getAdapterRequest.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterResultJsonUnmarshaller.java new file mode 100644 index 00000000000..2841c94337d --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterResultJsonUnmarshaller.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response GetAdapterResult + */ +public class GetAdapterResultJsonUnmarshaller implements + Unmarshaller { + + public GetAdapterResult unmarshall(JsonUnmarshallerContext context) throws Exception { + GetAdapterResult getAdapterResult = new GetAdapterResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterId")) { + getAdapterResult.setAdapterId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("AdapterName")) { + getAdapterResult.setAdapterName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("CreationTime")) { + getAdapterResult.setCreationTime(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Description")) { + getAdapterResult.setDescription(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("FeatureTypes")) { + getAdapterResult.setFeatureTypes(new ListUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("AutoUpdate")) { + getAdapterResult.setAutoUpdate(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Tags")) { + getAdapterResult.setTags(new MapUnmarshaller(StringJsonUnmarshaller + .getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return getAdapterResult; + } + + private static GetAdapterResultJsonUnmarshaller instance; + + public static GetAdapterResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new GetAdapterResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterVersionRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterVersionRequestMarshaller.java new file mode 100644 index 00000000000..c8c76f12375 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterVersionRequestMarshaller.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for GetAdapterVersionRequest + */ +public class GetAdapterVersionRequestMarshaller implements + Marshaller, GetAdapterVersionRequest> { + + public Request marshall( + GetAdapterVersionRequest getAdapterVersionRequest) { + if (getAdapterVersionRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(GetAdapterVersionRequest)"); + } + + Request request = new DefaultRequest( + getAdapterVersionRequest, "AmazonTextract"); + String target = "Textract.GetAdapterVersion"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (getAdapterVersionRequest.getAdapterId() != null) { + String adapterId = getAdapterVersionRequest.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + if (getAdapterVersionRequest.getAdapterVersion() != null) { + String adapterVersion = getAdapterVersionRequest.getAdapterVersion(); + jsonWriter.name("AdapterVersion"); + jsonWriter.value(adapterVersion); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterVersionResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterVersionResultJsonUnmarshaller.java new file mode 100644 index 00000000000..2cd1e839bb3 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/GetAdapterVersionResultJsonUnmarshaller.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response GetAdapterVersionResult + */ +public class GetAdapterVersionResultJsonUnmarshaller implements + Unmarshaller { + + public GetAdapterVersionResult unmarshall(JsonUnmarshallerContext context) throws Exception { + GetAdapterVersionResult getAdapterVersionResult = new GetAdapterVersionResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterId")) { + getAdapterVersionResult.setAdapterId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("AdapterVersion")) { + getAdapterVersionResult.setAdapterVersion(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("CreationTime")) { + getAdapterVersionResult.setCreationTime(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("FeatureTypes")) { + getAdapterVersionResult.setFeatureTypes(new ListUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("Status")) { + getAdapterVersionResult.setStatus(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("StatusMessage")) { + getAdapterVersionResult.setStatusMessage(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("DatasetConfig")) { + getAdapterVersionResult + .setDatasetConfig(AdapterVersionDatasetConfigJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("KMSKeyId")) { + getAdapterVersionResult.setKMSKeyId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("OutputConfig")) { + getAdapterVersionResult.setOutputConfig(OutputConfigJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("EvaluationMetrics")) { + getAdapterVersionResult + .setEvaluationMetrics(new ListUnmarshaller( + AdapterVersionEvaluationMetricJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("Tags")) { + getAdapterVersionResult.setTags(new MapUnmarshaller(StringJsonUnmarshaller + .getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return getAdapterVersionResult; + } + + private static GetAdapterVersionResultJsonUnmarshaller instance; + + public static GetAdapterVersionResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new GetAdapterVersionResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdapterVersionsRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdapterVersionsRequestMarshaller.java new file mode 100644 index 00000000000..4e7041b3c49 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdapterVersionsRequestMarshaller.java @@ -0,0 +1,110 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for ListAdapterVersionsRequest + */ +public class ListAdapterVersionsRequestMarshaller implements + Marshaller, ListAdapterVersionsRequest> { + + public Request marshall( + ListAdapterVersionsRequest listAdapterVersionsRequest) { + if (listAdapterVersionsRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(ListAdapterVersionsRequest)"); + } + + Request request = new DefaultRequest( + listAdapterVersionsRequest, "AmazonTextract"); + String target = "Textract.ListAdapterVersions"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (listAdapterVersionsRequest.getAdapterId() != null) { + String adapterId = listAdapterVersionsRequest.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + if (listAdapterVersionsRequest.getAfterCreationTime() != null) { + java.util.Date afterCreationTime = listAdapterVersionsRequest + .getAfterCreationTime(); + jsonWriter.name("AfterCreationTime"); + jsonWriter.value(afterCreationTime); + } + if (listAdapterVersionsRequest.getBeforeCreationTime() != null) { + java.util.Date beforeCreationTime = listAdapterVersionsRequest + .getBeforeCreationTime(); + jsonWriter.name("BeforeCreationTime"); + jsonWriter.value(beforeCreationTime); + } + if (listAdapterVersionsRequest.getMaxResults() != null) { + Integer maxResults = listAdapterVersionsRequest.getMaxResults(); + jsonWriter.name("MaxResults"); + jsonWriter.value(maxResults); + } + if (listAdapterVersionsRequest.getNextToken() != null) { + String nextToken = listAdapterVersionsRequest.getNextToken(); + jsonWriter.name("NextToken"); + jsonWriter.value(nextToken); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdapterVersionsResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdapterVersionsResultJsonUnmarshaller.java new file mode 100644 index 00000000000..eaa8ec66643 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdapterVersionsResultJsonUnmarshaller.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response ListAdapterVersionsResult + */ +public class ListAdapterVersionsResultJsonUnmarshaller implements + Unmarshaller { + + public ListAdapterVersionsResult unmarshall(JsonUnmarshallerContext context) throws Exception { + ListAdapterVersionsResult listAdapterVersionsResult = new ListAdapterVersionsResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterVersions")) { + listAdapterVersionsResult + .setAdapterVersions(new ListUnmarshaller( + AdapterVersionOverviewJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("NextToken")) { + listAdapterVersionsResult.setNextToken(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return listAdapterVersionsResult; + } + + private static ListAdapterVersionsResultJsonUnmarshaller instance; + + public static ListAdapterVersionsResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ListAdapterVersionsResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdaptersRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdaptersRequestMarshaller.java new file mode 100644 index 00000000000..ada65cb6d8a --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdaptersRequestMarshaller.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for ListAdaptersRequest + */ +public class ListAdaptersRequestMarshaller implements + Marshaller, ListAdaptersRequest> { + + public Request marshall(ListAdaptersRequest listAdaptersRequest) { + if (listAdaptersRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(ListAdaptersRequest)"); + } + + Request request = new DefaultRequest( + listAdaptersRequest, "AmazonTextract"); + String target = "Textract.ListAdapters"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (listAdaptersRequest.getAfterCreationTime() != null) { + java.util.Date afterCreationTime = listAdaptersRequest.getAfterCreationTime(); + jsonWriter.name("AfterCreationTime"); + jsonWriter.value(afterCreationTime); + } + if (listAdaptersRequest.getBeforeCreationTime() != null) { + java.util.Date beforeCreationTime = listAdaptersRequest.getBeforeCreationTime(); + jsonWriter.name("BeforeCreationTime"); + jsonWriter.value(beforeCreationTime); + } + if (listAdaptersRequest.getMaxResults() != null) { + Integer maxResults = listAdaptersRequest.getMaxResults(); + jsonWriter.name("MaxResults"); + jsonWriter.value(maxResults); + } + if (listAdaptersRequest.getNextToken() != null) { + String nextToken = listAdaptersRequest.getNextToken(); + jsonWriter.name("NextToken"); + jsonWriter.value(nextToken); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdaptersResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdaptersResultJsonUnmarshaller.java new file mode 100644 index 00000000000..1695acd8c19 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListAdaptersResultJsonUnmarshaller.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response ListAdaptersResult + */ +public class ListAdaptersResultJsonUnmarshaller implements + Unmarshaller { + + public ListAdaptersResult unmarshall(JsonUnmarshallerContext context) throws Exception { + ListAdaptersResult listAdaptersResult = new ListAdaptersResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Adapters")) { + listAdaptersResult.setAdapters(new ListUnmarshaller( + AdapterOverviewJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("NextToken")) { + listAdaptersResult.setNextToken(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return listAdaptersResult; + } + + private static ListAdaptersResultJsonUnmarshaller instance; + + public static ListAdaptersResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ListAdaptersResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListTagsForResourceRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListTagsForResourceRequestMarshaller.java new file mode 100644 index 00000000000..6258c59ab7d --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListTagsForResourceRequestMarshaller.java @@ -0,0 +1,88 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for ListTagsForResourceRequest + */ +public class ListTagsForResourceRequestMarshaller implements + Marshaller, ListTagsForResourceRequest> { + + public Request marshall( + ListTagsForResourceRequest listTagsForResourceRequest) { + if (listTagsForResourceRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(ListTagsForResourceRequest)"); + } + + Request request = new DefaultRequest( + listTagsForResourceRequest, "AmazonTextract"); + String target = "Textract.ListTagsForResource"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (listTagsForResourceRequest.getResourceARN() != null) { + String resourceARN = listTagsForResourceRequest.getResourceARN(); + jsonWriter.name("ResourceARN"); + jsonWriter.value(resourceARN); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListTagsForResourceResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListTagsForResourceResultJsonUnmarshaller.java new file mode 100644 index 00000000000..dd14dcf8f55 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ListTagsForResourceResultJsonUnmarshaller.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response ListTagsForResourceResult + */ +public class ListTagsForResourceResultJsonUnmarshaller implements + Unmarshaller { + + public ListTagsForResourceResult unmarshall(JsonUnmarshallerContext context) throws Exception { + ListTagsForResourceResult listTagsForResourceResult = new ListTagsForResourceResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Tags")) { + listTagsForResourceResult.setTags(new MapUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return listTagsForResourceResult; + } + + private static ListTagsForResourceResultJsonUnmarshaller instance; + + public static ListTagsForResourceResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ListTagsForResourceResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ResourceNotFoundExceptionUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ResourceNotFoundExceptionUnmarshaller.java new file mode 100644 index 00000000000..965f1bcfa42 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ResourceNotFoundExceptionUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse; +import com.amazonaws.transform.JsonErrorUnmarshaller; +import com.amazonaws.services.textract.model.ResourceNotFoundException; + +public class ResourceNotFoundExceptionUnmarshaller extends JsonErrorUnmarshaller { + + public ResourceNotFoundExceptionUnmarshaller() { + super(ResourceNotFoundException.class); + } + + @Override + public boolean match(JsonErrorResponse error) throws Exception { + return error.getErrorCode().equals("ResourceNotFoundException"); + } + + @Override + public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception { + + ResourceNotFoundException e = (ResourceNotFoundException) super.unmarshall(error); + e.setErrorCode("ResourceNotFoundException"); + + return e; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ServiceQuotaExceededExceptionUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ServiceQuotaExceededExceptionUnmarshaller.java new file mode 100644 index 00000000000..b366c8752d4 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ServiceQuotaExceededExceptionUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse; +import com.amazonaws.transform.JsonErrorUnmarshaller; +import com.amazonaws.services.textract.model.ServiceQuotaExceededException; + +public class ServiceQuotaExceededExceptionUnmarshaller extends JsonErrorUnmarshaller { + + public ServiceQuotaExceededExceptionUnmarshaller() { + super(ServiceQuotaExceededException.class); + } + + @Override + public boolean match(JsonErrorResponse error) throws Exception { + return error.getErrorCode().equals("ServiceQuotaExceededException"); + } + + @Override + public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception { + + ServiceQuotaExceededException e = (ServiceQuotaExceededException) super.unmarshall(error); + e.setErrorCode("ServiceQuotaExceededException"); + + return e; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/StartDocumentAnalysisRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/StartDocumentAnalysisRequestMarshaller.java index ae092cb31b9..602888803bd 100644 --- a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/StartDocumentAnalysisRequestMarshaller.java +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/StartDocumentAnalysisRequestMarshaller.java @@ -113,6 +113,11 @@ public Request marshall( jsonWriter.name("QueriesConfig"); QueriesConfigJsonMarshaller.getInstance().marshall(queriesConfig, jsonWriter); } + if (startDocumentAnalysisRequest.getAdaptersConfig() != null) { + AdaptersConfig adaptersConfig = startDocumentAnalysisRequest.getAdaptersConfig(); + jsonWriter.name("AdaptersConfig"); + AdaptersConfigJsonMarshaller.getInstance().marshall(adaptersConfig, jsonWriter); + } jsonWriter.endObject(); jsonWriter.close(); diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/TagResourceRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/TagResourceRequestMarshaller.java new file mode 100644 index 00000000000..11f5ebdcb57 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/TagResourceRequestMarshaller.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for TagResourceRequest + */ +public class TagResourceRequestMarshaller implements + Marshaller, TagResourceRequest> { + + public Request marshall(TagResourceRequest tagResourceRequest) { + if (tagResourceRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(TagResourceRequest)"); + } + + Request request = new DefaultRequest( + tagResourceRequest, "AmazonTextract"); + String target = "Textract.TagResource"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (tagResourceRequest.getResourceARN() != null) { + String resourceARN = tagResourceRequest.getResourceARN(); + jsonWriter.name("ResourceARN"); + jsonWriter.value(resourceARN); + } + if (tagResourceRequest.getTags() != null) { + java.util.Map tags = tagResourceRequest.getTags(); + jsonWriter.name("Tags"); + jsonWriter.beginObject(); + for (java.util.Map.Entry tagsEntry : tags.entrySet()) { + String tagsValue = tagsEntry.getValue(); + if (tagsValue != null) { + jsonWriter.name(tagsEntry.getKey()); + jsonWriter.value(tagsValue); + } + } + jsonWriter.endObject(); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/TagResourceResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/TagResourceResultJsonUnmarshaller.java new file mode 100644 index 00000000000..cc2c4f5af46 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/TagResourceResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response TagResourceResult + */ +public class TagResourceResultJsonUnmarshaller implements + Unmarshaller { + + public TagResourceResult unmarshall(JsonUnmarshallerContext context) throws Exception { + TagResourceResult tagResourceResult = new TagResourceResult(); + + return tagResourceResult; + } + + private static TagResourceResultJsonUnmarshaller instance; + + public static TagResourceResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new TagResourceResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UntagResourceRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UntagResourceRequestMarshaller.java new file mode 100644 index 00000000000..b8db79fb566 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UntagResourceRequestMarshaller.java @@ -0,0 +1,98 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for UntagResourceRequest + */ +public class UntagResourceRequestMarshaller implements + Marshaller, UntagResourceRequest> { + + public Request marshall(UntagResourceRequest untagResourceRequest) { + if (untagResourceRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(UntagResourceRequest)"); + } + + Request request = new DefaultRequest( + untagResourceRequest, "AmazonTextract"); + String target = "Textract.UntagResource"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (untagResourceRequest.getResourceARN() != null) { + String resourceARN = untagResourceRequest.getResourceARN(); + jsonWriter.name("ResourceARN"); + jsonWriter.value(resourceARN); + } + if (untagResourceRequest.getTagKeys() != null) { + java.util.List tagKeys = untagResourceRequest.getTagKeys(); + jsonWriter.name("TagKeys"); + jsonWriter.beginArray(); + for (String tagKeysItem : tagKeys) { + if (tagKeysItem != null) { + jsonWriter.value(tagKeysItem); + } + } + jsonWriter.endArray(); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UntagResourceResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UntagResourceResultJsonUnmarshaller.java new file mode 100644 index 00000000000..935d0e4cf19 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UntagResourceResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response UntagResourceResult + */ +public class UntagResourceResultJsonUnmarshaller implements + Unmarshaller { + + public UntagResourceResult unmarshall(JsonUnmarshallerContext context) throws Exception { + UntagResourceResult untagResourceResult = new UntagResourceResult(); + + return untagResourceResult; + } + + private static UntagResourceResultJsonUnmarshaller instance; + + public static UntagResourceResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new UntagResourceResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UpdateAdapterRequestMarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UpdateAdapterRequestMarshaller.java new file mode 100644 index 00000000000..5f6c34a56f9 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UpdateAdapterRequestMarshaller.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for UpdateAdapterRequest + */ +public class UpdateAdapterRequestMarshaller implements + Marshaller, UpdateAdapterRequest> { + + public Request marshall(UpdateAdapterRequest updateAdapterRequest) { + if (updateAdapterRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(UpdateAdapterRequest)"); + } + + Request request = new DefaultRequest( + updateAdapterRequest, "AmazonTextract"); + String target = "Textract.UpdateAdapter"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (updateAdapterRequest.getAdapterId() != null) { + String adapterId = updateAdapterRequest.getAdapterId(); + jsonWriter.name("AdapterId"); + jsonWriter.value(adapterId); + } + if (updateAdapterRequest.getDescription() != null) { + String description = updateAdapterRequest.getDescription(); + jsonWriter.name("Description"); + jsonWriter.value(description); + } + if (updateAdapterRequest.getAdapterName() != null) { + String adapterName = updateAdapterRequest.getAdapterName(); + jsonWriter.name("AdapterName"); + jsonWriter.value(adapterName); + } + if (updateAdapterRequest.getAutoUpdate() != null) { + String autoUpdate = updateAdapterRequest.getAutoUpdate(); + jsonWriter.name("AutoUpdate"); + jsonWriter.value(autoUpdate); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UpdateAdapterResultJsonUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UpdateAdapterResultJsonUnmarshaller.java new file mode 100644 index 00000000000..f18a897f3de --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/UpdateAdapterResultJsonUnmarshaller.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.services.textract.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response UpdateAdapterResult + */ +public class UpdateAdapterResultJsonUnmarshaller implements + Unmarshaller { + + public UpdateAdapterResult unmarshall(JsonUnmarshallerContext context) throws Exception { + UpdateAdapterResult updateAdapterResult = new UpdateAdapterResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AdapterId")) { + updateAdapterResult.setAdapterId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("AdapterName")) { + updateAdapterResult.setAdapterName(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("CreationTime")) { + updateAdapterResult.setCreationTime(DateJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Description")) { + updateAdapterResult.setDescription(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("FeatureTypes")) { + updateAdapterResult.setFeatureTypes(new ListUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("AutoUpdate")) { + updateAdapterResult.setAutoUpdate(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return updateAdapterResult; + } + + private static UpdateAdapterResultJsonUnmarshaller instance; + + public static UpdateAdapterResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new UpdateAdapterResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ValidationExceptionUnmarshaller.java b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ValidationExceptionUnmarshaller.java new file mode 100644 index 00000000000..cab95242e87 --- /dev/null +++ b/aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/model/transform/ValidationExceptionUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.textract.model.transform; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse; +import com.amazonaws.transform.JsonErrorUnmarshaller; +import com.amazonaws.services.textract.model.ValidationException; + +public class ValidationExceptionUnmarshaller extends JsonErrorUnmarshaller { + + public ValidationExceptionUnmarshaller() { + super(ValidationException.class); + } + + @Override + public boolean match(JsonErrorResponse error) throws Exception { + return error.getErrorCode().equals("ValidationException"); + } + + @Override + public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception { + + ValidationException e = (ValidationException) super.unmarshall(error); + e.setErrorCode("ValidationException"); + + return e; + } +}