Skip to content

Commit 8a3416b

Browse files
feat(aws-android-sdk-comprehend): update models to latest (#2378)
Co-authored-by: Raphael Kim <[email protected]>
1 parent 7dcd7d0 commit 8a3416b

File tree

469 files changed

+1694
-472
lines changed

Some content is hidden

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

469 files changed

+1694
-472
lines changed

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehend.java

Lines changed: 28 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.
@@ -250,6 +250,33 @@ BatchDetectSyntaxResult batchDetectSyntax(BatchDetectSyntaxRequest batchDetectSy
250250
ClassifyDocumentResult classifyDocument(ClassifyDocumentRequest classifyDocumentRequest)
251251
throws AmazonClientException, AmazonServiceException;
252252

253+
/**
254+
* <p>
255+
* Analyzes input text for the presence of personally identifiable
256+
* information (PII) and returns the labels of identified PII entity types
257+
* such as name, address, bank account number, or phone number.
258+
* </p>
259+
*
260+
* @param containsPiiEntitiesRequest
261+
* @return containsPiiEntitiesResult The response from the
262+
* ContainsPiiEntities service method, as returned by Amazon
263+
* Comprehend.
264+
* @throws InvalidRequestException
265+
* @throws TextSizeLimitExceededException
266+
* @throws UnsupportedLanguageException
267+
* @throws InternalServerException
268+
* @throws AmazonClientException If any internal errors are encountered
269+
* inside the client while attempting to make the request or
270+
* handle the response. For example if a network connection is
271+
* not available.
272+
* @throws AmazonServiceException If an error response is returned by Amazon
273+
* Comprehend indicating either a problem with the data in the
274+
* request, or a server side issue.
275+
*/
276+
ContainsPiiEntitiesResult containsPiiEntities(
277+
ContainsPiiEntitiesRequest containsPiiEntitiesRequest) throws AmazonClientException,
278+
AmazonServiceException;
279+
253280
/**
254281
* <p>
255282
* Creates a new document classifier that you can use to categorize

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsync.java

Lines changed: 60 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.
@@ -394,6 +394,65 @@ Future<ClassifyDocumentResult> classifyDocumentAsync(
394394
AsyncHandler<ClassifyDocumentRequest, ClassifyDocumentResult> asyncHandler)
395395
throws AmazonServiceException, AmazonClientException;
396396

397+
/**
398+
* <p>
399+
* Analyzes input text for the presence of personally identifiable
400+
* information (PII) and returns the labels of identified PII entity types
401+
* such as name, address, bank account number, or phone number.
402+
* </p>
403+
*
404+
* @param containsPiiEntitiesRequest
405+
* @return A Java Future object containing the response from the
406+
* ContainsPiiEntities service method, as returned by Amazon
407+
* Comprehend.
408+
* @throws InvalidRequestException
409+
* @throws TextSizeLimitExceededException
410+
* @throws UnsupportedLanguageException
411+
* @throws InternalServerException
412+
* @throws AmazonClientException If any internal errors are encountered
413+
* inside the client while attempting to make the request or
414+
* handle the response. For example if a network connection is
415+
* not available.
416+
* @throws AmazonServiceException If an error response is returned by Amazon
417+
* Comprehend indicating either a problem with the data in the
418+
* request, or a server side issue.
419+
*/
420+
Future<ContainsPiiEntitiesResult> containsPiiEntitiesAsync(
421+
ContainsPiiEntitiesRequest containsPiiEntitiesRequest) throws AmazonServiceException,
422+
AmazonClientException;
423+
424+
/**
425+
* <p>
426+
* Analyzes input text for the presence of personally identifiable
427+
* information (PII) and returns the labels of identified PII entity types
428+
* such as name, address, bank account number, or phone number.
429+
* </p>
430+
*
431+
* @param containsPiiEntitiesRequest
432+
* @param asyncHandler Asynchronous callback handler for events in the
433+
* life-cycle of the request. Users could provide the
434+
* implementation of the four callback methods in this interface
435+
* to process the operation result or handle the exception.
436+
* @return A Java Future object containing the response from the
437+
* ContainsPiiEntities service method, as returned by Amazon
438+
* Comprehend.
439+
* @throws InvalidRequestException
440+
* @throws TextSizeLimitExceededException
441+
* @throws UnsupportedLanguageException
442+
* @throws InternalServerException
443+
* @throws AmazonClientException If any internal errors are encountered
444+
* inside the client while attempting to make the request or
445+
* handle the response. For example if a network connection is
446+
* not available.
447+
* @throws AmazonServiceException If an error response is returned by Amazon
448+
* Comprehend indicating either a problem with the data in the
449+
* request, or a server side issue.
450+
*/
451+
Future<ContainsPiiEntitiesResult> containsPiiEntitiesAsync(
452+
ContainsPiiEntitiesRequest containsPiiEntitiesRequest,
453+
AsyncHandler<ContainsPiiEntitiesRequest, ContainsPiiEntitiesResult> asyncHandler)
454+
throws AmazonServiceException, AmazonClientException;
455+
397456
/**
398457
* <p>
399458
* Creates a new document classifier that you can use to categorize

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsyncClient.java

Lines changed: 76 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.
@@ -718,6 +718,81 @@ public ClassifyDocumentResult call() throws Exception {
718718
});
719719
}
720720

721+
/**
722+
* <p>
723+
* Analyzes input text for the presence of personally identifiable
724+
* information (PII) and returns the labels of identified PII entity types
725+
* such as name, address, bank account number, or phone number.
726+
* </p>
727+
*
728+
* @param containsPiiEntitiesRequest
729+
* @return A Java Future object containing the response from the
730+
* ContainsPiiEntities service method, as returned by Amazon
731+
* Comprehend.
732+
* @throws InvalidRequestException
733+
* @throws TextSizeLimitExceededException
734+
* @throws UnsupportedLanguageException
735+
* @throws InternalServerException
736+
* @throws AmazonClientException If any internal errors are encountered
737+
* inside the client while attempting to make the request or
738+
* handle the response. For example if a network connection is
739+
* not available.
740+
* @throws AmazonServiceException If an error response is returned by Amazon
741+
* Comprehend indicating either a problem with the data in the
742+
* request, or a server side issue.
743+
*/
744+
public Future<ContainsPiiEntitiesResult> containsPiiEntitiesAsync(
745+
final ContainsPiiEntitiesRequest containsPiiEntitiesRequest)
746+
throws AmazonServiceException, AmazonClientException {
747+
return executorService.submit(new Callable<ContainsPiiEntitiesResult>() {
748+
public ContainsPiiEntitiesResult call() throws Exception {
749+
return containsPiiEntities(containsPiiEntitiesRequest);
750+
}
751+
});
752+
}
753+
754+
/**
755+
* <p>
756+
* Analyzes input text for the presence of personally identifiable
757+
* information (PII) and returns the labels of identified PII entity types
758+
* such as name, address, bank account number, or phone number.
759+
* </p>
760+
*
761+
* @param containsPiiEntitiesRequest
762+
* @return A Java Future object containing the response from the
763+
* ContainsPiiEntities service method, as returned by Amazon
764+
* Comprehend.
765+
* @throws InvalidRequestException
766+
* @throws TextSizeLimitExceededException
767+
* @throws UnsupportedLanguageException
768+
* @throws InternalServerException
769+
* @throws AmazonClientException If any internal errors are encountered
770+
* inside the client while attempting to make the request or
771+
* handle the response. For example if a network connection is
772+
* not available.
773+
* @throws AmazonServiceException If an error response is returned by Amazon
774+
* Comprehend indicating either a problem with the data in the
775+
* request, or a server side issue.
776+
*/
777+
public Future<ContainsPiiEntitiesResult> containsPiiEntitiesAsync(
778+
final ContainsPiiEntitiesRequest containsPiiEntitiesRequest,
779+
final AsyncHandler<ContainsPiiEntitiesRequest, ContainsPiiEntitiesResult> asyncHandler)
780+
throws AmazonServiceException, AmazonClientException {
781+
return executorService.submit(new Callable<ContainsPiiEntitiesResult>() {
782+
public ContainsPiiEntitiesResult call() throws Exception {
783+
ContainsPiiEntitiesResult result = null;
784+
try {
785+
result = containsPiiEntities(containsPiiEntitiesRequest);
786+
} catch (Exception ex) {
787+
asyncHandler.onError(ex);
788+
throw ex;
789+
}
790+
asyncHandler.onSuccess(containsPiiEntitiesRequest, result);
791+
return result;
792+
}
793+
});
794+
}
795+
721796
/**
722797
* <p>
723798
* Creates a new document classifier that you can use to categorize

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendClient.java

Lines changed: 55 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.
@@ -687,6 +687,60 @@ public ClassifyDocumentResult classifyDocument(ClassifyDocumentRequest classifyD
687687
}
688688
}
689689

690+
/**
691+
* <p>
692+
* Analyzes input text for the presence of personally identifiable
693+
* information (PII) and returns the labels of identified PII entity types
694+
* such as name, address, bank account number, or phone number.
695+
* </p>
696+
*
697+
* @param containsPiiEntitiesRequest
698+
* @return containsPiiEntitiesResult The response from the
699+
* ContainsPiiEntities service method, as returned by Amazon
700+
* Comprehend.
701+
* @throws InvalidRequestException
702+
* @throws TextSizeLimitExceededException
703+
* @throws UnsupportedLanguageException
704+
* @throws InternalServerException
705+
* @throws AmazonClientException If any internal errors are encountered
706+
* inside the client while attempting to make the request or
707+
* handle the response. For example if a network connection is
708+
* not available.
709+
* @throws AmazonServiceException If an error response is returned by Amazon
710+
* Comprehend indicating either a problem with the data in the
711+
* request, or a server side issue.
712+
*/
713+
public ContainsPiiEntitiesResult containsPiiEntities(
714+
ContainsPiiEntitiesRequest containsPiiEntitiesRequest)
715+
throws AmazonServiceException, AmazonClientException {
716+
ExecutionContext executionContext = createExecutionContext(containsPiiEntitiesRequest);
717+
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
718+
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
719+
Request<ContainsPiiEntitiesRequest> request = null;
720+
Response<ContainsPiiEntitiesResult> response = null;
721+
try {
722+
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
723+
try {
724+
request = new ContainsPiiEntitiesRequestMarshaller()
725+
.marshall(containsPiiEntitiesRequest);
726+
// Binds the request metrics to the current request.
727+
request.setAWSRequestMetrics(awsRequestMetrics);
728+
} finally {
729+
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
730+
}
731+
Unmarshaller<ContainsPiiEntitiesResult, JsonUnmarshallerContext> unmarshaller = new ContainsPiiEntitiesResultJsonUnmarshaller();
732+
JsonResponseHandler<ContainsPiiEntitiesResult> responseHandler = new JsonResponseHandler<ContainsPiiEntitiesResult>(
733+
unmarshaller);
734+
735+
response = invoke(request, responseHandler, executionContext);
736+
737+
return response.getAwsResponse();
738+
} finally {
739+
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
740+
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
741+
}
742+
}
743+
690744
/**
691745
* <p>
692746
* Creates a new document classifier that you can use to categorize

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/AugmentedManifestsListItem.java

Lines changed: 1 addition & 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.

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectDominantLanguageItemResult.java

Lines changed: 1 addition & 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.

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectDominantLanguageRequest.java

Lines changed: 1 addition & 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.

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectDominantLanguageResult.java

Lines changed: 1 addition & 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.

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectEntitiesItemResult.java

Lines changed: 1 addition & 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.

aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectEntitiesRequest.java

Lines changed: 1 addition & 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.

0 commit comments

Comments
 (0)