Skip to content

Commit f592ef2

Browse files
feat(aws-android-sdk-textract): update models to latest (#2553)
Co-authored-by: Raphael Kim <[email protected]>
1 parent 61a1e78 commit f592ef2

File tree

131 files changed

+3439
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+3439
-116
lines changed

aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextract.java

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -167,6 +167,54 @@ public interface AmazonTextract {
167167
AnalyzeDocumentResult analyzeDocument(AnalyzeDocumentRequest analyzeDocumentRequest)
168168
throws AmazonClientException, AmazonServiceException;
169169

170+
/**
171+
* <p>
172+
* Analyzes an input document for financially related relationships between
173+
* text.
174+
* </p>
175+
* <p>
176+
* Information is returned as <code>ExpenseDocuments</code> and seperated as
177+
* follows.
178+
* </p>
179+
* <ul>
180+
* <li>
181+
* <p>
182+
* <code>LineItemGroups</code>- A data set containing <code>LineItems</code>
183+
* which store information about the lines of text, such as an item
184+
* purchased and its price on a receipt.
185+
* </p>
186+
* </li>
187+
* <li>
188+
* <p>
189+
* <code>SummaryFields</code>- Contains all other information a receipt,
190+
* such as header information or the vendors name.
191+
* </p>
192+
* </li>
193+
* </ul>
194+
*
195+
* @param analyzeExpenseRequest
196+
* @return analyzeExpenseResult The response from the AnalyzeExpense service
197+
* method, as returned by Amazon Textract.
198+
* @throws InvalidParameterException
199+
* @throws InvalidS3ObjectException
200+
* @throws UnsupportedDocumentException
201+
* @throws DocumentTooLargeException
202+
* @throws BadDocumentException
203+
* @throws AccessDeniedException
204+
* @throws ProvisionedThroughputExceededException
205+
* @throws InternalServerErrorException
206+
* @throws ThrottlingException
207+
* @throws AmazonClientException If any internal errors are encountered
208+
* inside the client while attempting to make the request or
209+
* handle the response. For example if a network connection is
210+
* not available.
211+
* @throws AmazonServiceException If an error response is returned by Amazon
212+
* Textract indicating either a problem with the data in the
213+
* request, or a server side issue.
214+
*/
215+
AnalyzeExpenseResult analyzeExpense(AnalyzeExpenseRequest analyzeExpenseRequest)
216+
throws AmazonClientException, AmazonServiceException;
217+
170218
/**
171219
* <p>
172220
* Detects text in the input document. Amazon Textract can detect lines of
@@ -297,6 +345,7 @@ DetectDocumentTextResult detectDocumentText(DetectDocumentTextRequest detectDocu
297345
* @throws InternalServerErrorException
298346
* @throws ThrottlingException
299347
* @throws InvalidS3ObjectException
348+
* @throws InvalidKMSKeyException
300349
* @throws AmazonClientException If any internal errors are encountered
301350
* inside the client while attempting to make the request or
302351
* handle the response. For example if a network connection is
@@ -367,6 +416,7 @@ GetDocumentAnalysisResult getDocumentAnalysis(
367416
* @throws InternalServerErrorException
368417
* @throws ThrottlingException
369418
* @throws InvalidS3ObjectException
419+
* @throws InvalidKMSKeyException
370420
* @throws AmazonClientException If any internal errors are encountered
371421
* inside the client while attempting to make the request or
372422
* handle the response. For example if a network connection is

aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsync.java

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -197,6 +197,107 @@ Future<AnalyzeDocumentResult> analyzeDocumentAsync(
197197
AsyncHandler<AnalyzeDocumentRequest, AnalyzeDocumentResult> asyncHandler)
198198
throws AmazonServiceException, AmazonClientException;
199199

200+
/**
201+
* <p>
202+
* Analyzes an input document for financially related relationships between
203+
* text.
204+
* </p>
205+
* <p>
206+
* Information is returned as <code>ExpenseDocuments</code> and seperated as
207+
* follows.
208+
* </p>
209+
* <ul>
210+
* <li>
211+
* <p>
212+
* <code>LineItemGroups</code>- A data set containing <code>LineItems</code>
213+
* which store information about the lines of text, such as an item
214+
* purchased and its price on a receipt.
215+
* </p>
216+
* </li>
217+
* <li>
218+
* <p>
219+
* <code>SummaryFields</code>- Contains all other information a receipt,
220+
* such as header information or the vendors name.
221+
* </p>
222+
* </li>
223+
* </ul>
224+
*
225+
* @param analyzeExpenseRequest
226+
* @return A Java Future object containing the response from the
227+
* AnalyzeExpense service method, as returned by Amazon Textract.
228+
* @throws InvalidParameterException
229+
* @throws InvalidS3ObjectException
230+
* @throws UnsupportedDocumentException
231+
* @throws DocumentTooLargeException
232+
* @throws BadDocumentException
233+
* @throws AccessDeniedException
234+
* @throws ProvisionedThroughputExceededException
235+
* @throws InternalServerErrorException
236+
* @throws ThrottlingException
237+
* @throws AmazonClientException If any internal errors are encountered
238+
* inside the client while attempting to make the request or
239+
* handle the response. For example if a network connection is
240+
* not available.
241+
* @throws AmazonServiceException If an error response is returned by Amazon
242+
* Textract indicating either a problem with the data in the
243+
* request, or a server side issue.
244+
*/
245+
Future<AnalyzeExpenseResult> analyzeExpenseAsync(AnalyzeExpenseRequest analyzeExpenseRequest)
246+
throws AmazonServiceException, AmazonClientException;
247+
248+
/**
249+
* <p>
250+
* Analyzes an input document for financially related relationships between
251+
* text.
252+
* </p>
253+
* <p>
254+
* Information is returned as <code>ExpenseDocuments</code> and seperated as
255+
* follows.
256+
* </p>
257+
* <ul>
258+
* <li>
259+
* <p>
260+
* <code>LineItemGroups</code>- A data set containing <code>LineItems</code>
261+
* which store information about the lines of text, such as an item
262+
* purchased and its price on a receipt.
263+
* </p>
264+
* </li>
265+
* <li>
266+
* <p>
267+
* <code>SummaryFields</code>- Contains all other information a receipt,
268+
* such as header information or the vendors name.
269+
* </p>
270+
* </li>
271+
* </ul>
272+
*
273+
* @param analyzeExpenseRequest
274+
* @param asyncHandler Asynchronous callback handler for events in the
275+
* life-cycle of the request. Users could provide the
276+
* implementation of the four callback methods in this interface
277+
* to process the operation result or handle the exception.
278+
* @return A Java Future object containing the response from the
279+
* AnalyzeExpense service method, as returned by Amazon Textract.
280+
* @throws InvalidParameterException
281+
* @throws InvalidS3ObjectException
282+
* @throws UnsupportedDocumentException
283+
* @throws DocumentTooLargeException
284+
* @throws BadDocumentException
285+
* @throws AccessDeniedException
286+
* @throws ProvisionedThroughputExceededException
287+
* @throws InternalServerErrorException
288+
* @throws ThrottlingException
289+
* @throws AmazonClientException If any internal errors are encountered
290+
* inside the client while attempting to make the request or
291+
* handle the response. For example if a network connection is
292+
* not available.
293+
* @throws AmazonServiceException If an error response is returned by Amazon
294+
* Textract indicating either a problem with the data in the
295+
* request, or a server side issue.
296+
*/
297+
Future<AnalyzeExpenseResult> analyzeExpenseAsync(AnalyzeExpenseRequest analyzeExpenseRequest,
298+
AsyncHandler<AnalyzeExpenseRequest, AnalyzeExpenseResult> asyncHandler)
299+
throws AmazonServiceException, AmazonClientException;
300+
200301
/**
201302
* <p>
202303
* Detects text in the input document. Amazon Textract can detect lines of
@@ -384,6 +485,7 @@ Future<DetectDocumentTextResult> detectDocumentTextAsync(
384485
* @throws InternalServerErrorException
385486
* @throws ThrottlingException
386487
* @throws InvalidS3ObjectException
488+
* @throws InvalidKMSKeyException
387489
* @throws AmazonClientException If any internal errors are encountered
388490
* inside the client while attempting to make the request or
389491
* handle the response. For example if a network connection is
@@ -482,6 +584,7 @@ Future<GetDocumentAnalysisResult> getDocumentAnalysisAsync(
482584
* @throws InternalServerErrorException
483585
* @throws ThrottlingException
484586
* @throws InvalidS3ObjectException
587+
* @throws InvalidKMSKeyException
485588
* @throws AmazonClientException If any internal errors are encountered
486589
* inside the client while attempting to make the request or
487590
* handle the response. For example if a network connection is
@@ -553,6 +656,7 @@ Future<GetDocumentAnalysisResult> getDocumentAnalysisAsync(
553656
* @throws InternalServerErrorException
554657
* @throws ThrottlingException
555658
* @throws InvalidS3ObjectException
659+
* @throws InvalidKMSKeyException
556660
* @throws AmazonClientException If any internal errors are encountered
557661
* inside the client while attempting to make the request or
558662
* handle the response. For example if a network connection is
@@ -627,6 +731,7 @@ Future<GetDocumentTextDetectionResult> getDocumentTextDetectionAsync(
627731
* @throws InternalServerErrorException
628732
* @throws ThrottlingException
629733
* @throws InvalidS3ObjectException
734+
* @throws InvalidKMSKeyException
630735
* @throws AmazonClientException If any internal errors are encountered
631736
* inside the client while attempting to make the request or
632737
* handle the response. For example if a network connection is

aws-android-sdk-textract/src/main/java/com/amazonaws/services/textract/AmazonTextractAsyncClient.java

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -440,6 +440,125 @@ public AnalyzeDocumentResult call() throws Exception {
440440
});
441441
}
442442

443+
/**
444+
* <p>
445+
* Analyzes an input document for financially related relationships between
446+
* text.
447+
* </p>
448+
* <p>
449+
* Information is returned as <code>ExpenseDocuments</code> and seperated as
450+
* follows.
451+
* </p>
452+
* <ul>
453+
* <li>
454+
* <p>
455+
* <code>LineItemGroups</code>- A data set containing <code>LineItems</code>
456+
* which store information about the lines of text, such as an item
457+
* purchased and its price on a receipt.
458+
* </p>
459+
* </li>
460+
* <li>
461+
* <p>
462+
* <code>SummaryFields</code>- Contains all other information a receipt,
463+
* such as header information or the vendors name.
464+
* </p>
465+
* </li>
466+
* </ul>
467+
*
468+
* @param analyzeExpenseRequest
469+
* @return A Java Future object containing the response from the
470+
* AnalyzeExpense service method, as returned by Amazon Textract.
471+
* @throws InvalidParameterException
472+
* @throws InvalidS3ObjectException
473+
* @throws UnsupportedDocumentException
474+
* @throws DocumentTooLargeException
475+
* @throws BadDocumentException
476+
* @throws AccessDeniedException
477+
* @throws ProvisionedThroughputExceededException
478+
* @throws InternalServerErrorException
479+
* @throws ThrottlingException
480+
* @throws AmazonClientException If any internal errors are encountered
481+
* inside the client while attempting to make the request or
482+
* handle the response. For example if a network connection is
483+
* not available.
484+
* @throws AmazonServiceException If an error response is returned by Amazon
485+
* Textract indicating either a problem with the data in the
486+
* request, or a server side issue.
487+
*/
488+
public Future<AnalyzeExpenseResult> analyzeExpenseAsync(
489+
final AnalyzeExpenseRequest analyzeExpenseRequest) throws AmazonServiceException,
490+
AmazonClientException {
491+
return executorService.submit(new Callable<AnalyzeExpenseResult>() {
492+
public AnalyzeExpenseResult call() throws Exception {
493+
return analyzeExpense(analyzeExpenseRequest);
494+
}
495+
});
496+
}
497+
498+
/**
499+
* <p>
500+
* Analyzes an input document for financially related relationships between
501+
* text.
502+
* </p>
503+
* <p>
504+
* Information is returned as <code>ExpenseDocuments</code> and seperated as
505+
* follows.
506+
* </p>
507+
* <ul>
508+
* <li>
509+
* <p>
510+
* <code>LineItemGroups</code>- A data set containing <code>LineItems</code>
511+
* which store information about the lines of text, such as an item
512+
* purchased and its price on a receipt.
513+
* </p>
514+
* </li>
515+
* <li>
516+
* <p>
517+
* <code>SummaryFields</code>- Contains all other information a receipt,
518+
* such as header information or the vendors name.
519+
* </p>
520+
* </li>
521+
* </ul>
522+
*
523+
* @param analyzeExpenseRequest
524+
* @return A Java Future object containing the response from the
525+
* AnalyzeExpense service method, as returned by Amazon Textract.
526+
* @throws InvalidParameterException
527+
* @throws InvalidS3ObjectException
528+
* @throws UnsupportedDocumentException
529+
* @throws DocumentTooLargeException
530+
* @throws BadDocumentException
531+
* @throws AccessDeniedException
532+
* @throws ProvisionedThroughputExceededException
533+
* @throws InternalServerErrorException
534+
* @throws ThrottlingException
535+
* @throws AmazonClientException If any internal errors are encountered
536+
* inside the client while attempting to make the request or
537+
* handle the response. For example if a network connection is
538+
* not available.
539+
* @throws AmazonServiceException If an error response is returned by Amazon
540+
* Textract indicating either a problem with the data in the
541+
* request, or a server side issue.
542+
*/
543+
public Future<AnalyzeExpenseResult> analyzeExpenseAsync(
544+
final AnalyzeExpenseRequest analyzeExpenseRequest,
545+
final AsyncHandler<AnalyzeExpenseRequest, AnalyzeExpenseResult> asyncHandler)
546+
throws AmazonServiceException, AmazonClientException {
547+
return executorService.submit(new Callable<AnalyzeExpenseResult>() {
548+
public AnalyzeExpenseResult call() throws Exception {
549+
AnalyzeExpenseResult result = null;
550+
try {
551+
result = analyzeExpense(analyzeExpenseRequest);
552+
} catch (Exception ex) {
553+
asyncHandler.onError(ex);
554+
throw ex;
555+
}
556+
asyncHandler.onSuccess(analyzeExpenseRequest, result);
557+
return result;
558+
}
559+
});
560+
}
561+
443562
/**
444563
* <p>
445564
* Detects text in the input document. Amazon Textract can detect lines of
@@ -643,6 +762,7 @@ public DetectDocumentTextResult call() throws Exception {
643762
* @throws InternalServerErrorException
644763
* @throws ThrottlingException
645764
* @throws InvalidS3ObjectException
765+
* @throws InvalidKMSKeyException
646766
* @throws AmazonClientException If any internal errors are encountered
647767
* inside the client while attempting to make the request or
648768
* handle the response. For example if a network connection is
@@ -743,6 +863,7 @@ public GetDocumentAnalysisResult call() throws Exception {
743863
* @throws InternalServerErrorException
744864
* @throws ThrottlingException
745865
* @throws InvalidS3ObjectException
866+
* @throws InvalidKMSKeyException
746867
* @throws AmazonClientException If any internal errors are encountered
747868
* inside the client while attempting to make the request or
748869
* handle the response. For example if a network connection is
@@ -828,6 +949,7 @@ public GetDocumentAnalysisResult call() throws Exception {
828949
* @throws InternalServerErrorException
829950
* @throws ThrottlingException
830951
* @throws InvalidS3ObjectException
952+
* @throws InvalidKMSKeyException
831953
* @throws AmazonClientException If any internal errors are encountered
832954
* inside the client while attempting to make the request or
833955
* handle the response. For example if a network connection is
@@ -904,6 +1026,7 @@ public GetDocumentTextDetectionResult call() throws Exception {
9041026
* @throws InternalServerErrorException
9051027
* @throws ThrottlingException
9061028
* @throws InvalidS3ObjectException
1029+
* @throws InvalidKMSKeyException
9071030
* @throws AmazonClientException If any internal errors are encountered
9081031
* inside the client while attempting to make the request or
9091032
* handle the response. For example if a network connection is

0 commit comments

Comments
 (0)