From 8cd9d63cd814bba58e4f01c7d26fabcd07de74ba Mon Sep 17 00:00:00 2001 From: awsmobilesdk Date: Wed, 21 Sep 2022 18:12:01 +0000 Subject: [PATCH] feat(aws-android-sdk-comprehend): update models to latest --- .../services/comprehend/AmazonComprehend.java | 86 ++- .../comprehend/AmazonComprehendAsync.java | 182 +++++- .../AmazonComprehendAsyncClient.java | 214 +++++- .../comprehend/AmazonComprehendClient.java | 140 +++- .../BatchDetectDominantLanguageRequest.java | 67 +- .../model/BatchDetectEntitiesRequest.java | 59 +- .../model/BatchDetectKeyPhrasesRequest.java | 54 +- .../model/BatchDetectSentimentRequest.java | 117 +++- .../model/BatchDetectSyntaxRequest.java | 58 +- ...atchDetectTargetedSentimentItemResult.java | 210 ++++++ .../BatchDetectTargetedSentimentRequest.java | 304 +++++++++ .../BatchDetectTargetedSentimentResult.java | 272 ++++++++ .../model/ContainsPiiEntitiesRequest.java | 28 +- .../CreateDocumentClassifierRequest.java | 4 +- .../model/DetectDominantLanguageRequest.java | 31 +- .../model/DetectEntitiesRequest.java | 25 +- .../model/DetectEntitiesResult.java | 36 +- .../model/DetectKeyPhrasesRequest.java | 28 +- .../model/DetectPiiEntitiesRequest.java | 21 +- .../model/DetectSentimentRequest.java | 70 +- .../comprehend/model/DetectSyntaxRequest.java | 25 +- .../comprehend/model/DetectSyntaxResult.java | 36 +- .../model/DetectTargetedSentimentRequest.java | 268 ++++++++ .../model/DetectTargetedSentimentResult.java | 155 +++++ .../DocumentClassifierInputDataConfig.java | 56 +- .../services/comprehend/model/Entity.java | 103 +-- .../model/EntityRecognizerAnnotations.java | 44 +- .../services/comprehend/model/KeyPhrase.java | 103 +-- .../comprehend/model/MentionSentiment.java | 250 ++++++++ .../comprehend/model/PartOfSpeechTag.java | 4 +- .../services/comprehend/model/PiiEntity.java | 104 +-- ...tTargetedSentimentDetectionJobRequest.java | 34 +- .../comprehend/model/SyntaxToken.java | 30 +- .../model/TargetedSentimentEntity.java | 286 +++++++++ .../model/TargetedSentimentEntityType.java | 92 +++ .../model/TargetedSentimentMention.java | 607 ++++++++++++++++++ .../model/UnsupportedLanguageException.java | 5 +- ...etedSentimentItemResultJsonMarshaller.java | 59 ++ ...edSentimentItemResultJsonUnmarshaller.java | 65 ++ ...ectTargetedSentimentRequestMarshaller.java | 100 +++ ...rgetedSentimentResultJsonUnmarshaller.java | 66 ++ ...ectTargetedSentimentRequestMarshaller.java | 93 +++ ...rgetedSentimentResultJsonUnmarshaller.java | 59 ++ .../MentionSentimentJsonMarshaller.java | 50 ++ .../MentionSentimentJsonUnmarshaller.java | 60 ++ ...TargetedSentimentEntityJsonMarshaller.java | 65 ++ ...rgetedSentimentEntityJsonUnmarshaller.java | 64 ++ ...argetedSentimentMentionJsonMarshaller.java | 75 +++ ...getedSentimentMentionJsonUnmarshaller.java | 76 +++ 49 files changed, 4414 insertions(+), 626 deletions(-) create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentItemResult.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentRequest.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentResult.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectTargetedSentimentRequest.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectTargetedSentimentResult.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/MentionSentiment.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentEntity.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentEntityType.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentMention.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentItemResultJsonMarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentItemResultJsonUnmarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentRequestMarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentResultJsonUnmarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/DetectTargetedSentimentRequestMarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/DetectTargetedSentimentResultJsonUnmarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/MentionSentimentJsonMarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/MentionSentimentJsonUnmarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentEntityJsonMarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentEntityJsonUnmarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentMentionJsonMarshaller.java create mode 100644 aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentMentionJsonUnmarshaller.java diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehend.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehend.java index e05a02f154..da1e50e6fc 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehend.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehend.java @@ -120,8 +120,10 @@ BatchDetectDominantLanguageResult batchDetectDominantLanguage( /** *

* Inspects the text of a batch of documents for named entities and returns - * information about them. For more information about named entities, see - * how-entities + * information about them. For more information about named entities, see + * Entities in the Comprehend Developer Guide. *

* * @param batchDetectEntitiesRequest @@ -203,7 +205,9 @@ BatchDetectSentimentResult batchDetectSentiment( *

* Inspects the text of a batch of documents for the syntax and part of * speech of the words in the document and returns information about them. - * For more information, see how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param batchDetectSyntaxRequest @@ -225,6 +229,38 @@ BatchDetectSentimentResult batchDetectSentiment( BatchDetectSyntaxResult batchDetectSyntax(BatchDetectSyntaxRequest batchDetectSyntaxRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Inspects a batch of documents and returns a sentiment analysis for each + * entity identified in the documents. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param batchDetectTargetedSentimentRequest + * @return batchDetectTargetedSentimentResult The response from the + * BatchDetectTargetedSentiment service method, as returned by + * Amazon Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws BatchSizeLimitExceededException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + BatchDetectTargetedSentimentResult batchDetectTargetedSentiment( + BatchDetectTargetedSentimentRequest batchDetectTargetedSentimentRequest) + throws AmazonClientException, AmazonServiceException; + /** *

* Creates a new document classification request to analyze a single @@ -283,8 +319,9 @@ ContainsPiiEntitiesResult containsPiiEntities( * documents. To create a classifier, you provide a set of training * documents that labeled with the categories that you want to use. After * the classifier is trained you can use it to categorize a set of labeled - * documents into the categories. For more information, see - * how-document-classification. + * documents into the categories. For more information, see Document Classification in the Comprehend Developer Guide. *

* * @param createDocumentClassifierRequest @@ -867,7 +904,9 @@ DetectDominantLanguageResult detectDominantLanguage( /** *

* Inspects text for named entities, and returns information about them. For - * more information, about named entities, see how-entities. + * more information, about named entities, see Entities in the Comprehend Developer Guide. *

* * @param detectEntitiesRequest @@ -964,7 +1003,9 @@ DetectSentimentResult detectSentiment(DetectSentimentRequest detectSentimentRequ /** *

* Inspects text for syntax and the part of speech of words in the document. - * For more information, how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param detectSyntaxRequest @@ -985,6 +1026,37 @@ DetectSentimentResult detectSentiment(DetectSentimentRequest detectSentimentRequ DetectSyntaxResult detectSyntax(DetectSyntaxRequest detectSyntaxRequest) throws AmazonClientException, AmazonServiceException; + /** + *

+ * Inspects the input text and returns a sentiment analysis for each entity + * identified in the text. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param detectTargetedSentimentRequest + * @return detectTargetedSentimentResult The response from the + * DetectTargetedSentiment service method, as returned by Amazon + * Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + DetectTargetedSentimentResult detectTargetedSentiment( + DetectTargetedSentimentRequest detectTargetedSentimentRequest) + throws AmazonClientException, AmazonServiceException; + /** *

* Creates a new custom model that replicates a source custom model that you diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsync.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsync.java index 31ab1387c8..51167a6c44 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsync.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsync.java @@ -98,8 +98,10 @@ Future batchDetectDominantLanguageAsync( /** *

* Inspects the text of a batch of documents for named entities and returns - * information about them. For more information about named entities, see - * how-entities + * information about them. For more information about named entities, see + * Entities in the Comprehend Developer Guide. *

* * @param batchDetectEntitiesRequest @@ -126,8 +128,10 @@ Future batchDetectEntitiesAsync( /** *

* Inspects the text of a batch of documents for named entities and returns - * information about them. For more information about named entities, see - * how-entities + * information about them. For more information about named entities, see + * Entities in the Comprehend Developer Guide. *

* * @param batchDetectEntitiesRequest @@ -278,7 +282,9 @@ Future batchDetectSentimentAsync( *

* Inspects the text of a batch of documents for the syntax and part of * speech of the words in the document and returns information about them. - * For more information, see how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param batchDetectSyntaxRequest @@ -306,7 +312,9 @@ Future batchDetectSyntaxAsync( *

* Inspects the text of a batch of documents for the syntax and part of * speech of the words in the document and returns information about them. - * For more information, see how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param batchDetectSyntaxRequest @@ -335,6 +343,75 @@ Future batchDetectSyntaxAsync( AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException; + /** + *

+ * Inspects a batch of documents and returns a sentiment analysis for each + * entity identified in the documents. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param batchDetectTargetedSentimentRequest + * @return A Java Future object containing the response from the + * BatchDetectTargetedSentiment service method, as returned by + * Amazon Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws BatchSizeLimitExceededException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + Future batchDetectTargetedSentimentAsync( + BatchDetectTargetedSentimentRequest batchDetectTargetedSentimentRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Inspects a batch of documents and returns a sentiment analysis for each + * entity identified in the documents. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param batchDetectTargetedSentimentRequest + * @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 + * BatchDetectTargetedSentiment service method, as returned by + * Amazon Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws BatchSizeLimitExceededException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + Future batchDetectTargetedSentimentAsync( + BatchDetectTargetedSentimentRequest batchDetectTargetedSentimentRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + /** *

* Creates a new document classification request to analyze a single @@ -459,8 +536,9 @@ Future containsPiiEntitiesAsync( * documents. To create a classifier, you provide a set of training * documents that labeled with the categories that you want to use. After * the classifier is trained you can use it to categorize a set of labeled - * documents into the categories. For more information, see - * how-document-classification. + * documents into the categories. For more information, see Document Classification in the Comprehend Developer Guide. *

* * @param createDocumentClassifierRequest @@ -493,8 +571,9 @@ Future createDocumentClassifierAsync( * documents. To create a classifier, you provide a set of training * documents that labeled with the categories that you want to use. After * the classifier is trained you can use it to categorize a set of labeled - * documents into the categories. For more information, see - * how-document-classification. + * documents into the categories. For more information, see Document Classification in the Comprehend Developer Guide. *

* * @param createDocumentClassifierRequest @@ -1739,7 +1818,9 @@ Future detectDominantLanguageAsync( /** *

* Inspects text for named entities, and returns information about them. For - * more information, about named entities, see how-entities. + * more information, about named entities, see Entities in the Comprehend Developer Guide. *

* * @param detectEntitiesRequest @@ -1764,7 +1845,9 @@ Future detectEntitiesAsync(DetectEntitiesRequest detectEnt /** *

* Inspects text for named entities, and returns information about them. For - * more information, about named entities, see how-entities. + * more information, about named entities, see Entities in the Comprehend Developer Guide. *

* * @param detectEntitiesRequest @@ -1962,7 +2045,9 @@ Future detectSentimentAsync( /** *

* Inspects text for syntax and the part of speech of words in the document. - * For more information, how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param detectSyntaxRequest @@ -1986,7 +2071,9 @@ Future detectSyntaxAsync(DetectSyntaxRequest detectSyntaxReq /** *

* Inspects text for syntax and the part of speech of words in the document. - * For more information, how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param detectSyntaxRequest @@ -2012,6 +2099,73 @@ Future detectSyntaxAsync(DetectSyntaxRequest detectSyntaxReq AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException; + /** + *

+ * Inspects the input text and returns a sentiment analysis for each entity + * identified in the text. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param detectTargetedSentimentRequest + * @return A Java Future object containing the response from the + * DetectTargetedSentiment service method, as returned by Amazon + * Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + Future detectTargetedSentimentAsync( + DetectTargetedSentimentRequest detectTargetedSentimentRequest) + throws AmazonServiceException, AmazonClientException; + + /** + *

+ * Inspects the input text and returns a sentiment analysis for each entity + * identified in the text. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param detectTargetedSentimentRequest + * @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 + * DetectTargetedSentiment service method, as returned by Amazon + * Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + Future detectTargetedSentimentAsync( + DetectTargetedSentimentRequest detectTargetedSentimentRequest, + AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException; + /** *

* Creates a new custom model that replicates a source custom model that you diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsyncClient.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsyncClient.java index aecd9ebe53..994485b75c 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsyncClient.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendAsyncClient.java @@ -342,8 +342,10 @@ public BatchDetectDominantLanguageResult call() throws Exception { /** *

* Inspects the text of a batch of documents for named entities and returns - * information about them. For more information about named entities, see - * how-entities + * information about them. For more information about named entities, see + * Entities in the Comprehend Developer Guide. *

* * @param batchDetectEntitiesRequest @@ -376,8 +378,10 @@ public BatchDetectEntitiesResult call() throws Exception { /** *

* Inspects the text of a batch of documents for named entities and returns - * information about them. For more information about named entities, see - * how-entities + * information about them. For more information about named entities, see + * Entities in the Comprehend Developer Guide. *

* * @param batchDetectEntitiesRequest @@ -570,7 +574,9 @@ public BatchDetectSentimentResult call() throws Exception { *

* Inspects the text of a batch of documents for the syntax and part of * speech of the words in the document and returns information about them. - * For more information, see how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param batchDetectSyntaxRequest @@ -604,7 +610,9 @@ public BatchDetectSyntaxResult call() throws Exception { *

* Inspects the text of a batch of documents for the syntax and part of * speech of the words in the document and returns information about them. - * For more information, see how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param batchDetectSyntaxRequest @@ -643,6 +651,91 @@ public BatchDetectSyntaxResult call() throws Exception { }); } + /** + *

+ * Inspects a batch of documents and returns a sentiment analysis for each + * entity identified in the documents. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param batchDetectTargetedSentimentRequest + * @return A Java Future object containing the response from the + * BatchDetectTargetedSentiment service method, as returned by + * Amazon Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws BatchSizeLimitExceededException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future batchDetectTargetedSentimentAsync( + final BatchDetectTargetedSentimentRequest batchDetectTargetedSentimentRequest) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public BatchDetectTargetedSentimentResult call() throws Exception { + return batchDetectTargetedSentiment(batchDetectTargetedSentimentRequest); + } + }); + } + + /** + *

+ * Inspects a batch of documents and returns a sentiment analysis for each + * entity identified in the documents. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param batchDetectTargetedSentimentRequest + * @return A Java Future object containing the response from the + * BatchDetectTargetedSentiment service method, as returned by + * Amazon Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws BatchSizeLimitExceededException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future batchDetectTargetedSentimentAsync( + final BatchDetectTargetedSentimentRequest batchDetectTargetedSentimentRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public BatchDetectTargetedSentimentResult call() throws Exception { + BatchDetectTargetedSentimentResult result = null; + try { + result = batchDetectTargetedSentiment(batchDetectTargetedSentimentRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(batchDetectTargetedSentimentRequest, result); + return result; + } + }); + } + /** *

* Creates a new document classification request to analyze a single @@ -799,8 +892,9 @@ public ContainsPiiEntitiesResult call() throws Exception { * documents. To create a classifier, you provide a set of training * documents that labeled with the categories that you want to use. After * the classifier is trained you can use it to categorize a set of labeled - * documents into the categories. For more information, see - * how-document-classification. + * documents into the categories. For more information, see Document Classification in the Comprehend Developer Guide. *

* * @param createDocumentClassifierRequest @@ -839,8 +933,9 @@ public CreateDocumentClassifierResult call() throws Exception { * documents. To create a classifier, you provide a set of training * documents that labeled with the categories that you want to use. After * the classifier is trained you can use it to categorize a set of labeled - * documents into the categories. For more information, see - * how-document-classification. + * documents into the categories. For more information, see Document Classification in the Comprehend Developer Guide. *

* * @param createDocumentClassifierRequest @@ -2419,7 +2514,9 @@ public DetectDominantLanguageResult call() throws Exception { /** *

* Inspects text for named entities, and returns information about them. For - * more information, about named entities, see how-entities. + * more information, about named entities, see Entities in the Comprehend Developer Guide. *

* * @param detectEntitiesRequest @@ -2451,7 +2548,9 @@ public DetectEntitiesResult call() throws Exception { /** *

* Inspects text for named entities, and returns information about them. For - * more information, about named entities, see how-entities. + * more information, about named entities, see Entities in the Comprehend Developer Guide. *

* * @param detectEntitiesRequest @@ -2709,7 +2808,9 @@ public DetectSentimentResult call() throws Exception { /** *

* Inspects text for syntax and the part of speech of words in the document. - * For more information, how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param detectSyntaxRequest @@ -2740,7 +2841,9 @@ public DetectSyntaxResult call() throws Exception { /** *

* Inspects text for syntax and the part of speech of words in the document. - * For more information, how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param detectSyntaxRequest @@ -2777,6 +2880,89 @@ public DetectSyntaxResult call() throws Exception { }); } + /** + *

+ * Inspects the input text and returns a sentiment analysis for each entity + * identified in the text. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param detectTargetedSentimentRequest + * @return A Java Future object containing the response from the + * DetectTargetedSentiment service method, as returned by Amazon + * Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future detectTargetedSentimentAsync( + final DetectTargetedSentimentRequest detectTargetedSentimentRequest) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public DetectTargetedSentimentResult call() throws Exception { + return detectTargetedSentiment(detectTargetedSentimentRequest); + } + }); + } + + /** + *

+ * Inspects the input text and returns a sentiment analysis for each entity + * identified in the text. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param detectTargetedSentimentRequest + * @return A Java Future object containing the response from the + * DetectTargetedSentiment service method, as returned by Amazon + * Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + public Future detectTargetedSentimentAsync( + final DetectTargetedSentimentRequest detectTargetedSentimentRequest, + final AsyncHandler asyncHandler) + throws AmazonServiceException, AmazonClientException { + return executorService.submit(new Callable() { + public DetectTargetedSentimentResult call() throws Exception { + DetectTargetedSentimentResult result = null; + try { + result = detectTargetedSentiment(detectTargetedSentimentRequest); + } catch (Exception ex) { + asyncHandler.onError(ex); + throw ex; + } + asyncHandler.onSuccess(detectTargetedSentimentRequest, result); + return result; + } + }); + } + /** *

* Creates a new custom model that replicates a source custom model that you diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendClient.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendClient.java index b00967fa62..09df1f8254 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendClient.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/AmazonComprehendClient.java @@ -422,8 +422,10 @@ public BatchDetectDominantLanguageResult batchDetectDominantLanguage( /** *

* Inspects the text of a batch of documents for named entities and returns - * information about them. For more information about named entities, see - * how-entities + * information about them. For more information about named entities, see + * Entities in the Comprehend Developer Guide. *

* * @param batchDetectEntitiesRequest @@ -586,7 +588,9 @@ public BatchDetectSentimentResult batchDetectSentiment( *

* Inspects the text of a batch of documents for the syntax and part of * speech of the words in the document and returns information about them. - * For more information, see how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param batchDetectSyntaxRequest @@ -636,6 +640,65 @@ public BatchDetectSyntaxResult batchDetectSyntax( } } + /** + *

+ * Inspects a batch of documents and returns a sentiment analysis for each + * entity identified in the documents. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param batchDetectTargetedSentimentRequest + * @return batchDetectTargetedSentimentResult The response from the + * BatchDetectTargetedSentiment service method, as returned by + * Amazon Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws BatchSizeLimitExceededException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + public BatchDetectTargetedSentimentResult batchDetectTargetedSentiment( + BatchDetectTargetedSentimentRequest batchDetectTargetedSentimentRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(batchDetectTargetedSentimentRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new BatchDetectTargetedSentimentRequestMarshaller() + .marshall(batchDetectTargetedSentimentRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new BatchDetectTargetedSentimentResultJsonUnmarshaller(); + 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 document classification request to analyze a single @@ -747,8 +810,9 @@ public ContainsPiiEntitiesResult containsPiiEntities( * documents. To create a classifier, you provide a set of training * documents that labeled with the categories that you want to use. After * the classifier is trained you can use it to categorize a set of labeled - * documents into the categories. For more information, see - * how-document-classification. + * documents into the categories. For more information, see Document Classification in the Comprehend Developer Guide. *

* * @param createDocumentClassifierRequest @@ -1895,7 +1959,9 @@ public DetectDominantLanguageResult detectDominantLanguage( /** *

* Inspects text for named entities, and returns information about them. For - * more information, about named entities, see how-entities. + * more information, about named entities, see Entities in the Comprehend Developer Guide. *

* * @param detectEntitiesRequest @@ -2098,7 +2164,9 @@ public DetectSentimentResult detectSentiment(DetectSentimentRequest detectSentim /** *

* Inspects text for syntax and the part of speech of words in the document. - * For more information, how-syntax. + * For more information, see Syntax in the Comprehend Developer Guide. *

* * @param detectSyntaxRequest @@ -2145,6 +2213,64 @@ public DetectSyntaxResult detectSyntax(DetectSyntaxRequest detectSyntaxRequest) } } + /** + *

+ * Inspects the input text and returns a sentiment analysis for each entity + * identified in the text. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

+ * + * @param detectTargetedSentimentRequest + * @return detectTargetedSentimentResult The response from the + * DetectTargetedSentiment service method, as returned by Amazon + * Comprehend. + * @throws InvalidRequestException + * @throws TextSizeLimitExceededException + * @throws UnsupportedLanguageException + * @throws InternalServerException + * @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 + * Comprehend indicating either a problem with the data in the + * request, or a server side issue. + */ + public DetectTargetedSentimentResult detectTargetedSentiment( + DetectTargetedSentimentRequest detectTargetedSentimentRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(detectTargetedSentimentRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DetectTargetedSentimentRequestMarshaller() + .marshall(detectTargetedSentimentRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DetectTargetedSentimentResultJsonUnmarshaller(); + 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 custom model that replicates a source custom model that you diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectDominantLanguageRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectDominantLanguageRequest.java index cc224037be..c0448efefc 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectDominantLanguageRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectDominantLanguageRequest.java @@ -31,27 +31,25 @@ public class BatchDetectDominantLanguageRequest extends AmazonWebServiceRequest Serializable { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document should contain at least 20 - * characters and must contain fewer than 5,000 bytes of UTF-8 encoded - * characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. Each document should contain at + * least 20 characters. The maximum size of each document is 5 KB. *

*/ private java.util.List textList; /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document should contain at least 20 - * characters and must contain fewer than 5,000 bytes of UTF-8 encoded - * characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. Each document should contain at + * least 20 characters. The maximum size of each document is 5 KB. *

* * @return

- * A list containing the text of the input documents. The list can - * contain a maximum of 25 documents. Each document should contain - * at least 20 characters and must contain fewer than 5,000 bytes of - * UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. + * The list can contain a maximum of 25 documents. Each document + * should contain at least 20 characters. The maximum size of each + * document is 5 KB. *

*/ public java.util.List getTextList() { @@ -60,17 +58,16 @@ public java.util.List getTextList() { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document should contain at least 20 - * characters and must contain fewer than 5,000 bytes of UTF-8 encoded - * characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. Each document should contain at + * least 20 characters. The maximum size of each document is 5 KB. *

* * @param textList

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document should - * contain at least 20 characters and must contain fewer than - * 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. + * Each document should contain at least 20 characters. The + * maximum size of each document is 5 KB. *

*/ public void setTextList(java.util.Collection textList) { @@ -84,20 +81,19 @@ public void setTextList(java.util.Collection textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document should contain at least 20 - * characters and must contain fewer than 5,000 bytes of UTF-8 encoded - * characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. Each document should contain at + * least 20 characters. The maximum size of each document is 5 KB. *

*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document should - * contain at least 20 characters and must contain fewer than - * 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. + * Each document should contain at least 20 characters. The + * maximum size of each document is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -114,20 +110,19 @@ public BatchDetectDominantLanguageRequest withTextList(String... textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document should contain at least 20 - * characters and must contain fewer than 5,000 bytes of UTF-8 encoded - * characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. Each document should contain at + * least 20 characters. The maximum size of each document is 5 KB. *

*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document should - * contain at least 20 characters and must contain fewer than - * 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. + * Each document should contain at least 20 characters. The + * maximum size of each document is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectEntitiesRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectEntitiesRequest.java index 9d8e2f918e..647532e0ab 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectEntitiesRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectEntitiesRequest.java @@ -22,16 +22,17 @@ /** *

* Inspects the text of a batch of documents for named entities and returns - * information about them. For more information about named entities, see - * how-entities + * information about them. For more information about named entities, see + * Entities in the Comprehend Developer Guide. *

*/ public class BatchDetectEntitiesRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

*/ private java.util.List textList; @@ -50,15 +51,15 @@ public class BatchDetectEntitiesRequest extends AmazonWebServiceRequest implemen /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

* * @return

- * A list containing the text of the input documents. The list can - * contain a maximum of 25 documents. Each document must contain - * fewer than 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. + * The list can contain a maximum of 25 documents. The maximum size + * of each document is 5 KB. *

*/ public java.util.List getTextList() { @@ -67,15 +68,15 @@ public java.util.List getTextList() { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

* * @param textList

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer than 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. *

*/ public void setTextList(java.util.Collection textList) { @@ -89,18 +90,18 @@ public void setTextList(java.util.Collection textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer than 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -117,18 +118,18 @@ public BatchDetectEntitiesRequest withTextList(String... textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer than 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectKeyPhrasesRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectKeyPhrasesRequest.java index 8fc7c7add0..1c7da67949 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectKeyPhrasesRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectKeyPhrasesRequest.java @@ -27,9 +27,9 @@ public class BatchDetectKeyPhrasesRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

*/ private java.util.List textList; @@ -48,15 +48,15 @@ public class BatchDetectKeyPhrasesRequest extends AmazonWebServiceRequest implem /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

* * @return

- * A list containing the text of the input documents. The list can - * contain a maximum of 25 documents. Each document must contain - * fewer than 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. + * The list can contain a maximum of 25 documents. The maximum size + * of each document is 5 KB. *

*/ public java.util.List getTextList() { @@ -65,15 +65,15 @@ public java.util.List getTextList() { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

* * @param textList

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer than 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. *

*/ public void setTextList(java.util.Collection textList) { @@ -87,18 +87,18 @@ public void setTextList(java.util.Collection textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer than 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -115,18 +115,18 @@ public BatchDetectKeyPhrasesRequest withTextList(String... textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer than 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer than 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSentimentRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSentimentRequest.java index d838d542b8..41d3d692ec 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSentimentRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSentimentRequest.java @@ -29,10 +29,17 @@ public class BatchDetectSentimentRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. + *

+ *
*/ private java.util.List textList; @@ -50,16 +57,30 @@ public class BatchDetectSentimentRequest extends AmazonWebServiceRequest impleme /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. *

+ *
* * @return

- * A list containing the text of the input documents. The list can - * contain a maximum of 25 documents. Each document must contain - * fewer that 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. + * The list can contain a maximum of 25 documents. The maximum size + * of each document is 5 KB. *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the + * first 500 characters of the input text and ignores any additional + * text in the input. + *

+ *
*/ public java.util.List getTextList() { return textList; @@ -67,16 +88,30 @@ public java.util.List getTextList() { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. *

+ *
* * @param textList

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the + * first 500 characters of the input text and ignores any + * additional text in the input. + *

+ *
*/ public void setTextList(java.util.Collection textList) { if (textList == null) { @@ -89,19 +124,33 @@ public void setTextList(java.util.Collection textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. *

+ *
*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the + * first 500 characters of the input text and ignores any + * additional text in the input. *

+ *
* @return A reference to this updated object so that method calls can be * chained together. */ @@ -117,19 +166,33 @@ public BatchDetectSentimentRequest withTextList(String... textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. + *

+ *
*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the + * first 500 characters of the input text and ignores any + * additional text in the input. *

+ *
* @return A reference to this updated object so that method calls can be * chained together. */ diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSyntaxRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSyntaxRequest.java index 31cb22cf22..976aa6ea48 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSyntaxRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectSyntaxRequest.java @@ -23,15 +23,17 @@ *

* Inspects the text of a batch of documents for the syntax and part of speech * of the words in the document and returns information about them. For more - * information, see how-syntax. + * information, see Syntax in the Comprehend Developer Guide. *

*/ public class BatchDetectSyntaxRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size for each document + * is 5 KB. *

*/ private java.util.List textList; @@ -51,15 +53,15 @@ public class BatchDetectSyntaxRequest extends AmazonWebServiceRequest implements /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size for each document + * is 5 KB. *

* * @return

- * A list containing the text of the input documents. The list can - * contain a maximum of 25 documents. Each document must contain - * fewer that 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. + * The list can contain a maximum of 25 documents. The maximum size + * for each document is 5 KB. *

*/ public java.util.List getTextList() { @@ -68,15 +70,15 @@ public java.util.List getTextList() { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size for each document + * is 5 KB. *

* * @param textList

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size for each document is 5 KB. *

*/ public void setTextList(java.util.Collection textList) { @@ -90,18 +92,18 @@ public void setTextList(java.util.Collection textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size for each document + * is 5 KB. *

*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size for each document is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -118,18 +120,18 @@ public BatchDetectSyntaxRequest withTextList(String... textList) { /** *

- * A list containing the text of the input documents. The list can contain a - * maximum of 25 documents. Each document must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size for each document + * is 5 KB. *

*

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

- * A list containing the text of the input documents. The list - * can contain a maximum of 25 documents. Each document must - * contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size for each document is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentItemResult.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentItemResult.java new file mode 100644 index 0000000000..ace1d11870 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentItemResult.java @@ -0,0 +1,210 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.io.Serializable; + +/** + *

+ * Analysis results for one of the documents in the batch. + *

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

+ * The zero-based index of this result in the input list. + *

+ */ + private Integer index; + + /** + *

+ * An array of targeted sentiment entities. + *

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

+ * The zero-based index of this result in the input list. + *

+ * + * @return

+ * The zero-based index of this result in the input list. + *

+ */ + public Integer getIndex() { + return index; + } + + /** + *

+ * The zero-based index of this result in the input list. + *

+ * + * @param index

+ * The zero-based index of this result in the input list. + *

+ */ + public void setIndex(Integer index) { + this.index = index; + } + + /** + *

+ * The zero-based index of this result in the input list. + *

+ *

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

+ * The zero-based index of this result in the input list. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public BatchDetectTargetedSentimentItemResult withIndex(Integer index) { + this.index = index; + return this; + } + + /** + *

+ * An array of targeted sentiment entities. + *

+ * + * @return

+ * An array of targeted sentiment entities. + *

+ */ + public java.util.List getEntities() { + return entities; + } + + /** + *

+ * An array of targeted sentiment entities. + *

+ * + * @param entities

+ * An array of targeted sentiment entities. + *

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

+ * An array of targeted sentiment entities. + *

+ *

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

+ * An array of targeted sentiment entities. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public BatchDetectTargetedSentimentItemResult withEntities(TargetedSentimentEntity... entities) { + if (getEntities() == null) { + this.entities = new java.util.ArrayList(entities.length); + } + for (TargetedSentimentEntity value : entities) { + this.entities.add(value); + } + return this; + } + + /** + *

+ * An array of targeted sentiment entities. + *

+ *

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

+ * An array of targeted sentiment entities. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public BatchDetectTargetedSentimentItemResult withEntities( + java.util.Collection entities) { + setEntities(entities); + 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 (getIndex() != null) + sb.append("Index: " + getIndex() + ","); + if (getEntities() != null) + sb.append("Entities: " + getEntities()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getIndex() == null) ? 0 : getIndex().hashCode()); + hashCode = prime * hashCode + ((getEntities() == null) ? 0 : getEntities().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof BatchDetectTargetedSentimentItemResult == false) + return false; + BatchDetectTargetedSentimentItemResult other = (BatchDetectTargetedSentimentItemResult) obj; + + if (other.getIndex() == null ^ this.getIndex() == null) + return false; + if (other.getIndex() != null && other.getIndex().equals(this.getIndex()) == false) + return false; + if (other.getEntities() == null ^ this.getEntities() == null) + return false; + if (other.getEntities() != null && other.getEntities().equals(this.getEntities()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentRequest.java new file mode 100644 index 0000000000..44abb2cd91 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentRequest.java @@ -0,0 +1,304 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

+ * Inspects a batch of documents and returns a sentiment analysis for each + * entity identified in the documents. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

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

+ * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. + *

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

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + */ + private String languageCode; + + /** + *

+ * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. + *

+ * + * @return

+ * A list containing the UTF-8 encoded text of the input documents. + * The list can contain a maximum of 25 documents. The maximum size + * of each document is 5 KB. + *

+ */ + public java.util.List getTextList() { + return textList; + } + + /** + *

+ * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. + *

+ * + * @param textList

+ * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. + *

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

+ * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. + *

+ *

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

+ * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. + *

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

+ * A list containing the UTF-8 encoded text of the input documents. The list + * can contain a maximum of 25 documents. The maximum size of each document + * is 5 KB. + *

+ *

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

+ * A list containing the UTF-8 encoded text of the input + * documents. The list can contain a maximum of 25 documents. The + * maximum size of each document is 5 KB. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public BatchDetectTargetedSentimentRequest withTextList(java.util.Collection textList) { + setTextList(textList); + return this; + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @return

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @see LanguageCode + */ + public String getLanguageCode() { + return languageCode; + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @param languageCode

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @see LanguageCode + */ + public void setLanguageCode(String languageCode) { + this.languageCode = languageCode; + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

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

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @param languageCode

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see LanguageCode + */ + public BatchDetectTargetedSentimentRequest withLanguageCode(String languageCode) { + this.languageCode = languageCode; + return this; + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @param languageCode

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @see LanguageCode + */ + public void setLanguageCode(LanguageCode languageCode) { + this.languageCode = languageCode.toString(); + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

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

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @param languageCode

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see LanguageCode + */ + public BatchDetectTargetedSentimentRequest withLanguageCode(LanguageCode languageCode) { + this.languageCode = languageCode.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 (getTextList() != null) + sb.append("TextList: " + getTextList() + ","); + if (getLanguageCode() != null) + sb.append("LanguageCode: " + getLanguageCode()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getTextList() == null) ? 0 : getTextList().hashCode()); + hashCode = prime * hashCode + + ((getLanguageCode() == null) ? 0 : getLanguageCode().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof BatchDetectTargetedSentimentRequest == false) + return false; + BatchDetectTargetedSentimentRequest other = (BatchDetectTargetedSentimentRequest) obj; + + if (other.getTextList() == null ^ this.getTextList() == null) + return false; + if (other.getTextList() != null && other.getTextList().equals(this.getTextList()) == false) + return false; + if (other.getLanguageCode() == null ^ this.getLanguageCode() == null) + return false; + if (other.getLanguageCode() != null + && other.getLanguageCode().equals(this.getLanguageCode()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentResult.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentResult.java new file mode 100644 index 0000000000..07bee38527 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/BatchDetectTargetedSentimentResult.java @@ -0,0 +1,272 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.io.Serializable; + +public class BatchDetectTargetedSentimentResult implements Serializable { + /** + *

+ * A list of objects containing the results of the operation. The results + * are sorted in ascending order by the Index field and match + * the order of the documents in the input list. If all of the documents + * contain an error, the ResultList is empty. + *

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

+ * List of errors that the operation can return. + *

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

+ * A list of objects containing the results of the operation. The results + * are sorted in ascending order by the Index field and match + * the order of the documents in the input list. If all of the documents + * contain an error, the ResultList is empty. + *

+ * + * @return

+ * A list of objects containing the results of the operation. The + * results are sorted in ascending order by the Index + * field and match the order of the documents in the input list. If + * all of the documents contain an error, the + * ResultList is empty. + *

+ */ + public java.util.List getResultList() { + return resultList; + } + + /** + *

+ * A list of objects containing the results of the operation. The results + * are sorted in ascending order by the Index field and match + * the order of the documents in the input list. If all of the documents + * contain an error, the ResultList is empty. + *

+ * + * @param resultList

+ * A list of objects containing the results of the operation. The + * results are sorted in ascending order by the + * Index field and match the order of the documents + * in the input list. If all of the documents contain an error, + * the ResultList is empty. + *

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

+ * A list of objects containing the results of the operation. The results + * are sorted in ascending order by the Index field and match + * the order of the documents in the input list. If all of the documents + * contain an error, the ResultList is empty. + *

+ *

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

+ * A list of objects containing the results of the operation. The + * results are sorted in ascending order by the + * Index field and match the order of the documents + * in the input list. If all of the documents contain an error, + * the ResultList is empty. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public BatchDetectTargetedSentimentResult withResultList( + BatchDetectTargetedSentimentItemResult... resultList) { + if (getResultList() == null) { + this.resultList = new java.util.ArrayList( + resultList.length); + } + for (BatchDetectTargetedSentimentItemResult value : resultList) { + this.resultList.add(value); + } + return this; + } + + /** + *

+ * A list of objects containing the results of the operation. The results + * are sorted in ascending order by the Index field and match + * the order of the documents in the input list. If all of the documents + * contain an error, the ResultList is empty. + *

+ *

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

+ * A list of objects containing the results of the operation. The + * results are sorted in ascending order by the + * Index field and match the order of the documents + * in the input list. If all of the documents contain an error, + * the ResultList is empty. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public BatchDetectTargetedSentimentResult withResultList( + java.util.Collection resultList) { + setResultList(resultList); + return this; + } + + /** + *

+ * List of errors that the operation can return. + *

+ * + * @return

+ * List of errors that the operation can return. + *

+ */ + public java.util.List getErrorList() { + return errorList; + } + + /** + *

+ * List of errors that the operation can return. + *

+ * + * @param errorList

+ * List of errors that the operation can return. + *

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

+ * List of errors that the operation can return. + *

+ *

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

+ * List of errors that the operation can return. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public BatchDetectTargetedSentimentResult withErrorList(BatchItemError... errorList) { + if (getErrorList() == null) { + this.errorList = new java.util.ArrayList(errorList.length); + } + for (BatchItemError value : errorList) { + this.errorList.add(value); + } + return this; + } + + /** + *

+ * List of errors that the operation can return. + *

+ *

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

+ * List of errors that the operation can return. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public BatchDetectTargetedSentimentResult withErrorList( + java.util.Collection errorList) { + setErrorList(errorList); + 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 (getResultList() != null) + sb.append("ResultList: " + getResultList() + ","); + if (getErrorList() != null) + sb.append("ErrorList: " + getErrorList()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getResultList() == null) ? 0 : getResultList().hashCode()); + hashCode = prime * hashCode + ((getErrorList() == null) ? 0 : getErrorList().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof BatchDetectTargetedSentimentResult == false) + return false; + BatchDetectTargetedSentimentResult other = (BatchDetectTargetedSentimentResult) obj; + + if (other.getResultList() == null ^ this.getResultList() == null) + return false; + if (other.getResultList() != null + && other.getResultList().equals(this.getResultList()) == false) + return false; + if (other.getErrorList() == null ^ this.getErrorList() == null) + return false; + if (other.getErrorList() != null + && other.getErrorList().equals(this.getErrorList()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/ContainsPiiEntitiesRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/ContainsPiiEntitiesRequest.java index 9b61da5630..aaa2ee615e 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/ContainsPiiEntitiesRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/ContainsPiiEntitiesRequest.java @@ -29,9 +29,7 @@ public class ContainsPiiEntitiesRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * Creates a new document classification request to analyze a single - * document in real-time, returning personally identifiable information - * (PII) entity labels. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Constraints:
@@ -52,18 +50,14 @@ public class ContainsPiiEntitiesRequest extends AmazonWebServiceRequest implemen /** *

- * Creates a new document classification request to analyze a single - * document in real-time, returning personally identifiable information - * (PII) entity labels. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

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

- * Creates a new document classification request to analyze a single - * document in real-time, returning personally identifiable - * information (PII) entity labels. + * A UTF-8 text string. The maximum string size is 100 KB. *

*/ public String getText() { @@ -72,18 +66,14 @@ public String getText() { /** *

- * Creates a new document classification request to analyze a single - * document in real-time, returning personally identifiable information - * (PII) entity labels. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Constraints:
* Length: 1 -
* * @param text

- * Creates a new document classification request to analyze a - * single document in real-time, returning personally - * identifiable information (PII) entity labels. + * A UTF-8 text string. The maximum string size is 100 KB. *

*/ public void setText(String text) { @@ -92,9 +82,7 @@ public void setText(String text) { /** *

- * Creates a new document classification request to analyze a single - * document in real-time, returning personally identifiable information - * (PII) entity labels. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Returns a reference to this object so that method calls can be chained @@ -104,9 +92,7 @@ public void setText(String text) { * Length: 1 -
* * @param text

- * Creates a new document classification request to analyze a - * single document in real-time, returning personally - * identifiable information (PII) entity labels. + * A UTF-8 text string. The maximum string size is 100 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/CreateDocumentClassifierRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/CreateDocumentClassifierRequest.java index 9cd4dfa578..8fb2f9901a 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/CreateDocumentClassifierRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/CreateDocumentClassifierRequest.java @@ -25,7 +25,9 @@ * To create a classifier, you provide a set of training documents that labeled * with the categories that you want to use. After the classifier is trained you * can use it to categorize a set of labeled documents into the categories. For - * more information, see how-document-classification. + * more information, see Document Classification in the Comprehend Developer Guide. *

*/ public class CreateDocumentClassifierRequest extends AmazonWebServiceRequest implements diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectDominantLanguageRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectDominantLanguageRequest.java index cd84e16900..78bbc99798 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectDominantLanguageRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectDominantLanguageRequest.java @@ -30,8 +30,8 @@ public class DetectDominantLanguageRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A UTF-8 text string. Each string should contain at least 20 characters - * and must contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A UTF-8 text string. The string must contain at least 20 characters. The + * maximum string size is 100 KB. *

*

* Constraints:
@@ -41,17 +41,16 @@ public class DetectDominantLanguageRequest extends AmazonWebServiceRequest imple /** *

- * A UTF-8 text string. Each string should contain at least 20 characters - * and must contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A UTF-8 text string. The string must contain at least 20 characters. The + * maximum string size is 100 KB. *

*

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

- * A UTF-8 text string. Each string should contain at least 20 - * characters and must contain fewer that 5,000 bytes of UTF-8 - * encoded characters. + * A UTF-8 text string. The string must contain at least 20 + * characters. The maximum string size is 100 KB. *

*/ public String getText() { @@ -60,17 +59,16 @@ public String getText() { /** *

- * A UTF-8 text string. Each string should contain at least 20 characters - * and must contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A UTF-8 text string. The string must contain at least 20 characters. The + * maximum string size is 100 KB. *

*

* Constraints:
* Length: 1 -
* * @param text

- * A UTF-8 text string. Each string should contain at least 20 - * characters and must contain fewer that 5,000 bytes of UTF-8 - * encoded characters. + * A UTF-8 text string. The string must contain at least 20 + * characters. The maximum string size is 100 KB. *

*/ public void setText(String text) { @@ -79,8 +77,8 @@ public void setText(String text) { /** *

- * A UTF-8 text string. Each string should contain at least 20 characters - * and must contain fewer that 5,000 bytes of UTF-8 encoded characters. + * A UTF-8 text string. The string must contain at least 20 characters. The + * maximum string size is 100 KB. *

*

* Returns a reference to this object so that method calls can be chained @@ -90,9 +88,8 @@ public void setText(String text) { * Length: 1 -
* * @param text

- * A UTF-8 text string. Each string should contain at least 20 - * characters and must contain fewer that 5,000 bytes of UTF-8 - * encoded characters. + * A UTF-8 text string. The string must contain at least 20 + * characters. The maximum string size is 100 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectEntitiesRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectEntitiesRequest.java index 9e531420b0..82c1e30743 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectEntitiesRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectEntitiesRequest.java @@ -22,14 +22,15 @@ /** *

* Inspects text for named entities, and returns information about them. For - * more information, about named entities, see how-entities. + * more information, about named entities, see Entities in the Comprehend Developer Guide. *

*/ public class DetectEntitiesRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Constraints:
@@ -82,16 +83,14 @@ public class DetectEntitiesRequest extends AmazonWebServiceRequest implements Se /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

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

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*/ public String getText() { @@ -100,16 +99,14 @@ public String getText() { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Constraints:
* Length: 1 -
* * @param text

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*/ public void setText(String text) { @@ -118,8 +115,7 @@ public void setText(String text) { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Returns a reference to this object so that method calls can be chained @@ -129,8 +125,7 @@ public void setText(String text) { * Length: 1 -
* * @param text

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectEntitiesResult.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectEntitiesResult.java index 3efe117a10..20c510b65a 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectEntitiesResult.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectEntitiesResult.java @@ -29,7 +29,9 @@ public class DetectEntitiesResult implements Serializable { * If your request uses a custom entity recognition model, Amazon Comprehend * detects the entities that the model is trained to recognize. Otherwise, * it detects the default entity types. For a list of default entity types, - * see how-entities. + * see Entities in the Comprehend Developer Guide. *

*/ private java.util.List entities; @@ -45,7 +47,9 @@ public class DetectEntitiesResult implements Serializable { * If your request uses a custom entity recognition model, Amazon Comprehend * detects the entities that the model is trained to recognize. Otherwise, * it detects the default entity types. For a list of default entity types, - * see how-entities. + * see Entities in the Comprehend Developer Guide. *

* * @return

@@ -58,7 +62,9 @@ public class DetectEntitiesResult implements Serializable { * If your request uses a custom entity recognition model, Amazon * Comprehend detects the entities that the model is trained to * recognize. Otherwise, it detects the default entity types. For a - * list of default entity types, see how-entities. + * list of default entity types, see Entities in the Comprehend Developer Guide. *

*/ public java.util.List getEntities() { @@ -76,7 +82,9 @@ public java.util.List getEntities() { * If your request uses a custom entity recognition model, Amazon Comprehend * detects the entities that the model is trained to recognize. Otherwise, * it detects the default entity types. For a list of default entity types, - * see how-entities. + * see Entities in the Comprehend Developer Guide. *

* * @param entities

@@ -89,7 +97,9 @@ public java.util.List getEntities() { * If your request uses a custom entity recognition model, Amazon * Comprehend detects the entities that the model is trained to * recognize. Otherwise, it detects the default entity types. For - * a list of default entity types, see how-entities. + * a list of default entity types, see Entities in the Comprehend Developer Guide. *

*/ public void setEntities(java.util.Collection entities) { @@ -112,7 +122,9 @@ public void setEntities(java.util.Collection entities) { * If your request uses a custom entity recognition model, Amazon Comprehend * detects the entities that the model is trained to recognize. Otherwise, * it detects the default entity types. For a list of default entity types, - * see how-entities. + * see Entities in the Comprehend Developer Guide. *

*

* Returns a reference to this object so that method calls can be chained @@ -128,7 +140,9 @@ public void setEntities(java.util.Collection entities) { * If your request uses a custom entity recognition model, Amazon * Comprehend detects the entities that the model is trained to * recognize. Otherwise, it detects the default entity types. For - * a list of default entity types, see how-entities. + * a list of default entity types, see Entities in the Comprehend Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -154,7 +168,9 @@ public DetectEntitiesResult withEntities(Entity... entities) { * If your request uses a custom entity recognition model, Amazon Comprehend * detects the entities that the model is trained to recognize. Otherwise, * it detects the default entity types. For a list of default entity types, - * see how-entities. + * see Entities in the Comprehend Developer Guide. *

*

* Returns a reference to this object so that method calls can be chained @@ -170,7 +186,9 @@ public DetectEntitiesResult withEntities(Entity... entities) { * If your request uses a custom entity recognition model, Amazon * Comprehend detects the entities that the model is trained to * recognize. Otherwise, it detects the default entity types. For - * a list of default entity types, see how-entities. + * a list of default entity types, see Entities in the Comprehend Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectKeyPhrasesRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectKeyPhrasesRequest.java index 399d55c4e5..c9160af079 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectKeyPhrasesRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectKeyPhrasesRequest.java @@ -27,8 +27,8 @@ public class DetectKeyPhrasesRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The string must contain less than 100 KB of UTF-8 + * encoded characters. *

*

* Constraints:
@@ -50,16 +50,16 @@ public class DetectKeyPhrasesRequest extends AmazonWebServiceRequest implements /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The string must contain less than 100 KB of UTF-8 + * encoded characters. *

*

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

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The string must contain less than 100 KB of + * UTF-8 encoded characters. *

*/ public String getText() { @@ -68,16 +68,16 @@ public String getText() { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The string must contain less than 100 KB of UTF-8 + * encoded characters. *

*

* Constraints:
* Length: 1 -
* * @param text

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The string must contain less than 100 KB + * of UTF-8 encoded characters. *

*/ public void setText(String text) { @@ -86,8 +86,8 @@ public void setText(String text) { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The string must contain less than 100 KB of UTF-8 + * encoded characters. *

*

* Returns a reference to this object so that method calls can be chained @@ -97,8 +97,8 @@ public void setText(String text) { * Length: 1 -
* * @param text

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The string must contain less than 100 KB + * of UTF-8 encoded characters. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectPiiEntitiesRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectPiiEntitiesRequest.java index bd74176995..2e755424c3 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectPiiEntitiesRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectPiiEntitiesRequest.java @@ -28,8 +28,7 @@ public class DetectPiiEntitiesRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Constraints:
@@ -50,16 +49,14 @@ public class DetectPiiEntitiesRequest extends AmazonWebServiceRequest implements /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

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

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*/ public String getText() { @@ -68,16 +65,14 @@ public String getText() { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Constraints:
* Length: 1 -
* * @param text

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*/ public void setText(String text) { @@ -86,8 +81,7 @@ public void setText(String text) { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

*

* Returns a reference to this object so that method calls can be chained @@ -97,8 +91,7 @@ public void setText(String text) { * Length: 1 -
* * @param text

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 100 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSentimentRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSentimentRequest.java index 291ed2c4bc..e49fed4665 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSentimentRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSentimentRequest.java @@ -29,9 +29,15 @@ public class DetectSentimentRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 5 KB. *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. + *

+ *
*

* Constraints:
* Length: 1 -
@@ -52,17 +58,29 @@ public class DetectSentimentRequest extends AmazonWebServiceRequest implements S /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. *

+ *
*

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

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the + * first 500 characters of the input text and ignores any additional + * text in the input. *

+ *
*/ public String getText() { return text; @@ -70,17 +88,29 @@ public String getText() { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 5 KB. *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. + *

+ *
*

* Constraints:
* Length: 1 -
* * @param text

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the + * first 500 characters of the input text and ignores any + * additional text in the input. *

+ *
*/ public void setText(String text) { this.text = text; @@ -88,9 +118,15 @@ public void setText(String text) { /** *

- * A UTF-8 text string. Each string must contain fewer that 5,000 bytes of - * UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 5 KB. *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the first 500 + * characters of the input text and ignores any additional text in the + * input. + *

+ *
*

* Returns a reference to this object so that method calls can be chained * together. @@ -99,9 +135,15 @@ public void setText(String text) { * Length: 1 -
* * @param text

- * A UTF-8 text string. Each string must contain fewer that 5,000 - * bytes of UTF-8 encoded characters. + * A UTF-8 text string. The maximum string size is 5 KB. + *

+ * + *

+ * Amazon Comprehend performs real-time sentiment analysis on the + * first 500 characters of the input text and ignores any + * additional text in the input. *

+ *
* @return A reference to this updated object so that method calls can be * chained together. */ diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSyntaxRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSyntaxRequest.java index bd1c9b6f57..318d52a164 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSyntaxRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSyntaxRequest.java @@ -22,14 +22,15 @@ /** *

* Inspects text for syntax and the part of speech of words in the document. For - * more information, how-syntax. + * more information, see Syntax in the Comprehend Developer Guide. *

*/ public class DetectSyntaxRequest extends AmazonWebServiceRequest implements Serializable { /** *

- * A UTF-8 string. Each string must contain fewer that 5,000 bytes of UTF - * encoded characters. + * A UTF-8 string. The maximum string size is 5 KB. *

*

* Constraints:
@@ -52,16 +53,14 @@ public class DetectSyntaxRequest extends AmazonWebServiceRequest implements Seri /** *

- * A UTF-8 string. Each string must contain fewer that 5,000 bytes of UTF - * encoded characters. + * A UTF-8 string. The maximum string size is 5 KB. *

*

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

- * A UTF-8 string. Each string must contain fewer that 5,000 bytes - * of UTF encoded characters. + * A UTF-8 string. The maximum string size is 5 KB. *

*/ public String getText() { @@ -70,16 +69,14 @@ public String getText() { /** *

- * A UTF-8 string. Each string must contain fewer that 5,000 bytes of UTF - * encoded characters. + * A UTF-8 string. The maximum string size is 5 KB. *

*

* Constraints:
* Length: 1 -
* * @param text

- * A UTF-8 string. Each string must contain fewer that 5,000 - * bytes of UTF encoded characters. + * A UTF-8 string. The maximum string size is 5 KB. *

*/ public void setText(String text) { @@ -88,8 +85,7 @@ public void setText(String text) { /** *

- * A UTF-8 string. Each string must contain fewer that 5,000 bytes of UTF - * encoded characters. + * A UTF-8 string. The maximum string size is 5 KB. *

*

* Returns a reference to this object so that method calls can be chained @@ -99,8 +95,7 @@ public void setText(String text) { * Length: 1 -
* * @param text

- * A UTF-8 string. Each string must contain fewer that 5,000 - * bytes of UTF encoded characters. + * A UTF-8 string. The maximum string size is 5 KB. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSyntaxResult.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSyntaxResult.java index 2a22ed1397..6981fe52b9 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSyntaxResult.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectSyntaxResult.java @@ -23,7 +23,9 @@ public class DetectSyntaxResult implements Serializable { * A collection of syntax tokens describing the text. For each token, the * response provides the text, the token type, where the text begins and * ends, and the level of confidence that Amazon Comprehend has that the - * token is correct. For a list of token types, see how-syntax. + * token is correct. For a list of token types, see Syntax in the Comprehend Developer Guide. *

*/ private java.util.List syntaxTokens; @@ -33,7 +35,9 @@ public class DetectSyntaxResult implements Serializable { * A collection of syntax tokens describing the text. For each token, the * response provides the text, the token type, where the text begins and * ends, and the level of confidence that Amazon Comprehend has that the - * token is correct. For a list of token types, see how-syntax. + * token is correct. For a list of token types, see Syntax in the Comprehend Developer Guide. *

* * @return

@@ -41,7 +45,9 @@ public class DetectSyntaxResult implements Serializable { * token, the response provides the text, the token type, where the * text begins and ends, and the level of confidence that Amazon * Comprehend has that the token is correct. For a list of token - * types, see how-syntax. + * types, see Syntax in the Comprehend Developer Guide. *

*/ public java.util.List getSyntaxTokens() { @@ -53,7 +59,9 @@ public java.util.List getSyntaxTokens() { * A collection of syntax tokens describing the text. For each token, the * response provides the text, the token type, where the text begins and * ends, and the level of confidence that Amazon Comprehend has that the - * token is correct. For a list of token types, see how-syntax. + * token is correct. For a list of token types, see Syntax in the Comprehend Developer Guide. *

* * @param syntaxTokens

@@ -61,7 +69,9 @@ public java.util.List getSyntaxTokens() { * token, the response provides the text, the token type, where * the text begins and ends, and the level of confidence that * Amazon Comprehend has that the token is correct. For a list of - * token types, see how-syntax. + * token types, see Syntax in the Comprehend Developer Guide. *

*/ public void setSyntaxTokens(java.util.Collection syntaxTokens) { @@ -78,7 +88,9 @@ public void setSyntaxTokens(java.util.Collection syntaxTokens) { * A collection of syntax tokens describing the text. For each token, the * response provides the text, the token type, where the text begins and * ends, and the level of confidence that Amazon Comprehend has that the - * token is correct. For a list of token types, see how-syntax. + * token is correct. For a list of token types, see Syntax in the Comprehend Developer Guide. *

*

* Returns a reference to this object so that method calls can be chained @@ -89,7 +101,9 @@ public void setSyntaxTokens(java.util.Collection syntaxTokens) { * token, the response provides the text, the token type, where * the text begins and ends, and the level of confidence that * Amazon Comprehend has that the token is correct. For a list of - * token types, see how-syntax. + * token types, see Syntax in the Comprehend Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -109,7 +123,9 @@ public DetectSyntaxResult withSyntaxTokens(SyntaxToken... syntaxTokens) { * A collection of syntax tokens describing the text. For each token, the * response provides the text, the token type, where the text begins and * ends, and the level of confidence that Amazon Comprehend has that the - * token is correct. For a list of token types, see how-syntax. + * token is correct. For a list of token types, see Syntax in the Comprehend Developer Guide. *

*

* Returns a reference to this object so that method calls can be chained @@ -120,7 +136,9 @@ public DetectSyntaxResult withSyntaxTokens(SyntaxToken... syntaxTokens) { * token, the response provides the text, the token type, where * the text begins and ends, and the level of confidence that * Amazon Comprehend has that the token is correct. For a list of - * token types, see how-syntax. + * token types, see Syntax in the Comprehend Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectTargetedSentimentRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectTargetedSentimentRequest.java new file mode 100644 index 0000000000..a94a76621b --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectTargetedSentimentRequest.java @@ -0,0 +1,268 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

+ * Inspects the input text and returns a sentiment analysis for each entity + * identified in the text. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

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

+ * A UTF-8 text string. The maximum string length is 5 KB. + *

+ *

+ * Constraints:
+ * Length: 1 -
+ */ + private String text; + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + */ + private String languageCode; + + /** + *

+ * A UTF-8 text string. The maximum string length is 5 KB. + *

+ *

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

+ * A UTF-8 text string. The maximum string length is 5 KB. + *

+ */ + public String getText() { + return text; + } + + /** + *

+ * A UTF-8 text string. The maximum string length is 5 KB. + *

+ *

+ * Constraints:
+ * Length: 1 -
+ * + * @param text

+ * A UTF-8 text string. The maximum string length is 5 KB. + *

+ */ + public void setText(String text) { + this.text = text; + } + + /** + *

+ * A UTF-8 text string. The maximum string length is 5 KB. + *

+ *

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

+ * Constraints:
+ * Length: 1 -
+ * + * @param text

+ * A UTF-8 text string. The maximum string length is 5 KB. + *

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

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @return

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @see LanguageCode + */ + public String getLanguageCode() { + return languageCode; + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @param languageCode

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @see LanguageCode + */ + public void setLanguageCode(String languageCode) { + this.languageCode = languageCode; + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

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

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @param languageCode

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see LanguageCode + */ + public DetectTargetedSentimentRequest withLanguageCode(String languageCode) { + this.languageCode = languageCode; + return this; + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @param languageCode

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @see LanguageCode + */ + public void setLanguageCode(LanguageCode languageCode) { + this.languageCode = languageCode.toString(); + } + + /** + *

+ * The language of the input documents. Currently, English is the only + * supported language. + *

+ *

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

+ * Constraints:
+ * Allowed Values: en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW + * + * @param languageCode

+ * The language of the input documents. Currently, English is the + * only supported language. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see LanguageCode + */ + public DetectTargetedSentimentRequest withLanguageCode(LanguageCode languageCode) { + this.languageCode = languageCode.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 (getText() != null) + sb.append("Text: " + getText() + ","); + if (getLanguageCode() != null) + sb.append("LanguageCode: " + getLanguageCode()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getText() == null) ? 0 : getText().hashCode()); + hashCode = prime * hashCode + + ((getLanguageCode() == null) ? 0 : getLanguageCode().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DetectTargetedSentimentRequest == false) + return false; + DetectTargetedSentimentRequest other = (DetectTargetedSentimentRequest) obj; + + if (other.getText() == null ^ this.getText() == null) + return false; + if (other.getText() != null && other.getText().equals(this.getText()) == false) + return false; + if (other.getLanguageCode() == null ^ this.getLanguageCode() == null) + return false; + if (other.getLanguageCode() != null + && other.getLanguageCode().equals(this.getLanguageCode()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectTargetedSentimentResult.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectTargetedSentimentResult.java new file mode 100644 index 0000000000..1c3a212b89 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DetectTargetedSentimentResult.java @@ -0,0 +1,155 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.io.Serializable; + +public class DetectTargetedSentimentResult implements Serializable { + /** + *

+ * Targeted sentiment analysis for each of the entities identified in the + * input text. + *

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

+ * Targeted sentiment analysis for each of the entities identified in the + * input text. + *

+ * + * @return

+ * Targeted sentiment analysis for each of the entities identified + * in the input text. + *

+ */ + public java.util.List getEntities() { + return entities; + } + + /** + *

+ * Targeted sentiment analysis for each of the entities identified in the + * input text. + *

+ * + * @param entities

+ * Targeted sentiment analysis for each of the entities + * identified in the input text. + *

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

+ * Targeted sentiment analysis for each of the entities identified in the + * input text. + *

+ *

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

+ * Targeted sentiment analysis for each of the entities + * identified in the input text. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DetectTargetedSentimentResult withEntities(TargetedSentimentEntity... entities) { + if (getEntities() == null) { + this.entities = new java.util.ArrayList(entities.length); + } + for (TargetedSentimentEntity value : entities) { + this.entities.add(value); + } + return this; + } + + /** + *

+ * Targeted sentiment analysis for each of the entities identified in the + * input text. + *

+ *

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

+ * Targeted sentiment analysis for each of the entities + * identified in the input text. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DetectTargetedSentimentResult withEntities( + java.util.Collection entities) { + setEntities(entities); + 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 (getEntities() != null) + sb.append("Entities: " + getEntities()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getEntities() == null) ? 0 : getEntities().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DetectTargetedSentimentResult == false) + return false; + DetectTargetedSentimentResult other = (DetectTargetedSentimentResult) obj; + + if (other.getEntities() == null ^ this.getEntities() == null) + return false; + if (other.getEntities() != null && other.getEntities().equals(this.getEntities()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DocumentClassifierInputDataConfig.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DocumentClassifierInputDataConfig.java index 156a750766..3a723a3e7d 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DocumentClassifierInputDataConfig.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/DocumentClassifierInputDataConfig.java @@ -22,8 +22,9 @@ * The input properties for training a document classifier. *

*

- * For more information on how the input file is formatted, see - * prep-classifier-data. + * For more information on how the input file is formatted, see Preparing training data in the Comprehend Developer Guide. *

*/ public class DocumentClassifierInputDataConfig implements Serializable { @@ -89,10 +90,9 @@ public class DocumentClassifierInputDataConfig implements Serializable { /** *

- * The Amazon S3 URI for the input data. The Amazon S3 bucket must be in the - * same AWS Region as the API endpoint that you are calling. The URI can - * point to a single input file or it can provide the prefix for a - * collection of input files. + * This specifies the Amazon S3 location where the test annotations for an + * entity recognizer are located. The URI must be in the same AWS Region as + * the API endpoint that you are calling. *

*

* Constraints:
@@ -628,10 +628,9 @@ public DocumentClassifierInputDataConfig withS3Uri(String s3Uri) { /** *

- * The Amazon S3 URI for the input data. The Amazon S3 bucket must be in the - * same AWS Region as the API endpoint that you are calling. The URI can - * point to a single input file or it can provide the prefix for a - * collection of input files. + * This specifies the Amazon S3 location where the test annotations for an + * entity recognizer are located. The URI must be in the same AWS Region as + * the API endpoint that you are calling. *

*

* Constraints:
@@ -639,10 +638,9 @@ public DocumentClassifierInputDataConfig withS3Uri(String s3Uri) { * Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
* * @return

- * The Amazon S3 URI for the input data. The Amazon S3 bucket must - * be in the same AWS Region as the API endpoint that you are - * calling. The URI can point to a single input file or it can - * provide the prefix for a collection of input files. + * This specifies the Amazon S3 location where the test annotations + * for an entity recognizer are located. The URI must be in the same + * AWS Region as the API endpoint that you are calling. *

*/ public String getTestS3Uri() { @@ -651,10 +649,9 @@ public String getTestS3Uri() { /** *

- * The Amazon S3 URI for the input data. The Amazon S3 bucket must be in the - * same AWS Region as the API endpoint that you are calling. The URI can - * point to a single input file or it can provide the prefix for a - * collection of input files. + * This specifies the Amazon S3 location where the test annotations for an + * entity recognizer are located. The URI must be in the same AWS Region as + * the API endpoint that you are calling. *

*

* Constraints:
@@ -662,10 +659,10 @@ public String getTestS3Uri() { * Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
* * @param testS3Uri

- * The Amazon S3 URI for the input data. The Amazon S3 bucket - * must be in the same AWS Region as the API endpoint that you - * are calling. The URI can point to a single input file or it - * can provide the prefix for a collection of input files. + * This specifies the Amazon S3 location where the test + * annotations for an entity recognizer are located. The URI must + * be in the same AWS Region as the API endpoint that you are + * calling. *

*/ public void setTestS3Uri(String testS3Uri) { @@ -674,10 +671,9 @@ public void setTestS3Uri(String testS3Uri) { /** *

- * The Amazon S3 URI for the input data. The Amazon S3 bucket must be in the - * same AWS Region as the API endpoint that you are calling. The URI can - * point to a single input file or it can provide the prefix for a - * collection of input files. + * This specifies the Amazon S3 location where the test annotations for an + * entity recognizer are located. The URI must be in the same AWS Region as + * the API endpoint that you are calling. *

*

* Returns a reference to this object so that method calls can be chained @@ -688,10 +684,10 @@ public void setTestS3Uri(String testS3Uri) { * Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
* * @param testS3Uri

- * The Amazon S3 URI for the input data. The Amazon S3 bucket - * must be in the same AWS Region as the API endpoint that you - * are calling. The URI can point to a single input file or it - * can provide the prefix for a collection of input files. + * This specifies the Amazon S3 location where the test + * annotations for an entity recognizer are located. The URI must + * be in the same AWS Region as the API endpoint that you are + * calling. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/Entity.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/Entity.java index 2d0be95151..534f7fdbd5 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/Entity.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/Entity.java @@ -56,22 +56,16 @@ public class Entity implements Serializable { /** *

- * A character offset in the input text that shows where the entity begins - * (the first character is at position 0). The offset returns the position - * of each UTF-8 code point in the string. A code point is the - * abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the entity. *

*/ private Integer beginOffset; /** *

- * A character offset in the input text that shows where the entity ends. - * The offset returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular graphical - * representation. For example, a multi-byte UTF-8 character maps to a - * single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the entity. *

*/ private Integer endOffset; @@ -285,20 +279,13 @@ public Entity withText(String text) { /** *

- * A character offset in the input text that shows where the entity begins - * (the first character is at position 0). The offset returns the position - * of each UTF-8 code point in the string. A code point is the - * abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the entity. *

* * @return

- * A character offset in the input text that shows where the entity - * begins (the first character is at position 0). The offset returns - * the position of each UTF-8 code point in the string. A code - * point is the abstract character from a particular graphical - * representation. For example, a multi-byte UTF-8 character maps to - * a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the entity. *

*/ public Integer getBeginOffset() { @@ -307,20 +294,13 @@ public Integer getBeginOffset() { /** *

- * A character offset in the input text that shows where the entity begins - * (the first character is at position 0). The offset returns the position - * of each UTF-8 code point in the string. A code point is the - * abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the entity. *

* * @param beginOffset

- * A character offset in the input text that shows where the - * entity begins (the first character is at position 0). The - * offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a - * particular graphical representation. For example, a multi-byte - * UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the entity. *

*/ public void setBeginOffset(Integer beginOffset) { @@ -329,23 +309,16 @@ public void setBeginOffset(Integer beginOffset) { /** *

- * A character offset in the input text that shows where the entity begins - * (the first character is at position 0). The offset returns the position - * of each UTF-8 code point in the string. A code point is the - * abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the entity. *

*

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

- * A character offset in the input text that shows where the - * entity begins (the first character is at position 0). The - * offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a - * particular graphical representation. For example, a multi-byte - * UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the entity. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -357,19 +330,13 @@ public Entity withBeginOffset(Integer beginOffset) { /** *

- * A character offset in the input text that shows where the entity ends. - * The offset returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular graphical - * representation. For example, a multi-byte UTF-8 character maps to a - * single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the entity. *

* * @return

- * A character offset in the input text that shows where the entity - * ends. The offset returns the position of each UTF-8 code point in - * the string. A code point is the abstract character from a - * particular graphical representation. For example, a multi-byte - * UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the last character in the entity. *

*/ public Integer getEndOffset() { @@ -378,20 +345,13 @@ public Integer getEndOffset() { /** *

- * A character offset in the input text that shows where the entity ends. - * The offset returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular graphical - * representation. For example, a multi-byte UTF-8 character maps to a - * single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the entity. *

* * @param endOffset

- * A character offset in the input text that shows where the - * entity ends. The offset returns the position of each UTF-8 - * code point in the string. A code point is the abstract - * character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code - * point. + * The zero-based offset from the beginning of the source text to + * the last character in the entity. *

*/ public void setEndOffset(Integer endOffset) { @@ -400,23 +360,16 @@ public void setEndOffset(Integer endOffset) { /** *

- * A character offset in the input text that shows where the entity ends. - * The offset returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular graphical - * representation. For example, a multi-byte UTF-8 character maps to a - * single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the entity. *

*

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

- * A character offset in the input text that shows where the - * entity ends. The offset returns the position of each UTF-8 - * code point in the string. A code point is the abstract - * character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code - * point. + * The zero-based offset from the beginning of the source text to + * the last character in the entity. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/EntityRecognizerAnnotations.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/EntityRecognizerAnnotations.java index 64e254ff2d..5aa246e35d 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/EntityRecognizerAnnotations.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/EntityRecognizerAnnotations.java @@ -38,9 +38,9 @@ public class EntityRecognizerAnnotations implements Serializable { /** *

- * This specifies the Amazon S3 location where the test annotations for an - * entity recognizer are located. The URI must be in the same AWS Region as - * the API endpoint that you are calling. + * Specifies the Amazon S3 location where the test annotations for an entity + * recognizer are located. The URI must be in the same region as the API + * endpoint that you are calling. *

*

* Constraints:
@@ -120,9 +120,9 @@ public EntityRecognizerAnnotations withS3Uri(String s3Uri) { /** *

- * This specifies the Amazon S3 location where the test annotations for an - * entity recognizer are located. The URI must be in the same AWS Region as - * the API endpoint that you are calling. + * Specifies the Amazon S3 location where the test annotations for an entity + * recognizer are located. The URI must be in the same region as the API + * endpoint that you are calling. *

*

* Constraints:
@@ -130,9 +130,9 @@ public EntityRecognizerAnnotations withS3Uri(String s3Uri) { * Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
* * @return

- * This specifies the Amazon S3 location where the test annotations - * for an entity recognizer are located. The URI must be in the same - * AWS Region as the API endpoint that you are calling. + * Specifies the Amazon S3 location where the test annotations for + * an entity recognizer are located. The URI must be in the same + * region as the API endpoint that you are calling. *

*/ public String getTestS3Uri() { @@ -141,9 +141,9 @@ public String getTestS3Uri() { /** *

- * This specifies the Amazon S3 location where the test annotations for an - * entity recognizer are located. The URI must be in the same AWS Region as - * the API endpoint that you are calling. + * Specifies the Amazon S3 location where the test annotations for an entity + * recognizer are located. The URI must be in the same region as the API + * endpoint that you are calling. *

*

* Constraints:
@@ -151,10 +151,9 @@ public String getTestS3Uri() { * Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
* * @param testS3Uri

- * This specifies the Amazon S3 location where the test - * annotations for an entity recognizer are located. The URI must - * be in the same AWS Region as the API endpoint that you are - * calling. + * Specifies the Amazon S3 location where the test annotations + * for an entity recognizer are located. The URI must be in the + * same region as the API endpoint that you are calling. *

*/ public void setTestS3Uri(String testS3Uri) { @@ -163,9 +162,9 @@ public void setTestS3Uri(String testS3Uri) { /** *

- * This specifies the Amazon S3 location where the test annotations for an - * entity recognizer are located. The URI must be in the same AWS Region as - * the API endpoint that you are calling. + * Specifies the Amazon S3 location where the test annotations for an entity + * recognizer are located. The URI must be in the same region as the API + * endpoint that you are calling. *

*

* Returns a reference to this object so that method calls can be chained @@ -176,10 +175,9 @@ public void setTestS3Uri(String testS3Uri) { * Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
* * @param testS3Uri

- * This specifies the Amazon S3 location where the test - * annotations for an entity recognizer are located. The URI must - * be in the same AWS Region as the API endpoint that you are - * calling. + * Specifies the Amazon S3 location where the test annotations + * for an entity recognizer are located. The URI must be in the + * same region as the API endpoint that you are calling. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/KeyPhrase.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/KeyPhrase.java index 21f6356eee..870c3d3fb5 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/KeyPhrase.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/KeyPhrase.java @@ -43,22 +43,16 @@ public class KeyPhrase implements Serializable { /** *

- * A character offset in the input text that shows where the key phrase - * begins (the first character is at position 0). The offset returns the - * position of each UTF-8 code point in the string. A code point is - * the abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the key phrase. *

*/ private Integer beginOffset; /** *

- * A character offset in the input text where the key phrase ends. The - * offset returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 character maps - * to a single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the key phrase. *

*/ private Integer endOffset; @@ -170,20 +164,13 @@ public KeyPhrase withText(String text) { /** *

- * A character offset in the input text that shows where the key phrase - * begins (the first character is at position 0). The offset returns the - * position of each UTF-8 code point in the string. A code point is - * the abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the key phrase. *

* * @return

- * A character offset in the input text that shows where the key - * phrase begins (the first character is at position 0). The offset - * returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 - * character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the key phrase. *

*/ public Integer getBeginOffset() { @@ -192,20 +179,13 @@ public Integer getBeginOffset() { /** *

- * A character offset in the input text that shows where the key phrase - * begins (the first character is at position 0). The offset returns the - * position of each UTF-8 code point in the string. A code point is - * the abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the key phrase. *

* * @param beginOffset

- * A character offset in the input text that shows where the key - * phrase begins (the first character is at position 0). The - * offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a - * particular graphical representation. For example, a multi-byte - * UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the key phrase. *

*/ public void setBeginOffset(Integer beginOffset) { @@ -214,23 +194,16 @@ public void setBeginOffset(Integer beginOffset) { /** *

- * A character offset in the input text that shows where the key phrase - * begins (the first character is at position 0). The offset returns the - * position of each UTF-8 code point in the string. A code point is - * the abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the key phrase. *

*

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

- * A character offset in the input text that shows where the key - * phrase begins (the first character is at position 0). The - * offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a - * particular graphical representation. For example, a multi-byte - * UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the key phrase. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -242,19 +215,13 @@ public KeyPhrase withBeginOffset(Integer beginOffset) { /** *

- * A character offset in the input text where the key phrase ends. The - * offset returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 character maps - * to a single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the key phrase. *

* * @return

- * A character offset in the input text where the key phrase ends. - * The offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from - * a particular graphical representation. For example, a multi-byte - * UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the last character in the key phrase. *

*/ public Integer getEndOffset() { @@ -263,20 +230,13 @@ public Integer getEndOffset() { /** *

- * A character offset in the input text where the key phrase ends. The - * offset returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 character maps - * to a single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the key phrase. *

* * @param endOffset

- * A character offset in the input text where the key phrase - * ends. The offset returns the position of each UTF-8 code point - * in the string. A code point is the abstract - * character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code - * point. + * The zero-based offset from the beginning of the source text to + * the last character in the key phrase. *

*/ public void setEndOffset(Integer endOffset) { @@ -285,23 +245,16 @@ public void setEndOffset(Integer endOffset) { /** *

- * A character offset in the input text where the key phrase ends. The - * offset returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 character maps - * to a single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the key phrase. *

*

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

- * A character offset in the input text where the key phrase - * ends. The offset returns the position of each UTF-8 code point - * in the string. A code point is the abstract - * character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code - * point. + * The zero-based offset from the beginning of the source text to + * the last character in the key phrase. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/MentionSentiment.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/MentionSentiment.java new file mode 100644 index 0000000000..5cc9f509d1 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/MentionSentiment.java @@ -0,0 +1,250 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.io.Serializable; + +/** + *

+ * Contains the sentiment and sentiment score for one mention of an entity. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

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

+ * The sentiment of the mention. + *

+ *

+ * Constraints:
+ * Allowed Values: POSITIVE, NEGATIVE, NEUTRAL, MIXED + */ + private String sentiment; + + /** + *

+ * Describes the level of confidence that Amazon Comprehend has in the + * accuracy of its detection of sentiments. + *

+ */ + private SentimentScore sentimentScore; + + /** + *

+ * The sentiment of the mention. + *

+ *

+ * Constraints:
+ * Allowed Values: POSITIVE, NEGATIVE, NEUTRAL, MIXED + * + * @return

+ * The sentiment of the mention. + *

+ * @see SentimentType + */ + public String getSentiment() { + return sentiment; + } + + /** + *

+ * The sentiment of the mention. + *

+ *

+ * Constraints:
+ * Allowed Values: POSITIVE, NEGATIVE, NEUTRAL, MIXED + * + * @param sentiment

+ * The sentiment of the mention. + *

+ * @see SentimentType + */ + public void setSentiment(String sentiment) { + this.sentiment = sentiment; + } + + /** + *

+ * The sentiment of the mention. + *

+ *

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

+ * Constraints:
+ * Allowed Values: POSITIVE, NEGATIVE, NEUTRAL, MIXED + * + * @param sentiment

+ * The sentiment of the mention. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see SentimentType + */ + public MentionSentiment withSentiment(String sentiment) { + this.sentiment = sentiment; + return this; + } + + /** + *

+ * The sentiment of the mention. + *

+ *

+ * Constraints:
+ * Allowed Values: POSITIVE, NEGATIVE, NEUTRAL, MIXED + * + * @param sentiment

+ * The sentiment of the mention. + *

+ * @see SentimentType + */ + public void setSentiment(SentimentType sentiment) { + this.sentiment = sentiment.toString(); + } + + /** + *

+ * The sentiment of the mention. + *

+ *

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

+ * Constraints:
+ * Allowed Values: POSITIVE, NEGATIVE, NEUTRAL, MIXED + * + * @param sentiment

+ * The sentiment of the mention. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see SentimentType + */ + public MentionSentiment withSentiment(SentimentType sentiment) { + this.sentiment = sentiment.toString(); + return this; + } + + /** + *

+ * Describes the level of confidence that Amazon Comprehend has in the + * accuracy of its detection of sentiments. + *

+ * + * @return

+ * Describes the level of confidence that Amazon Comprehend has in + * the accuracy of its detection of sentiments. + *

+ */ + public SentimentScore getSentimentScore() { + return sentimentScore; + } + + /** + *

+ * Describes the level of confidence that Amazon Comprehend has in the + * accuracy of its detection of sentiments. + *

+ * + * @param sentimentScore

+ * Describes the level of confidence that Amazon Comprehend has + * in the accuracy of its detection of sentiments. + *

+ */ + public void setSentimentScore(SentimentScore sentimentScore) { + this.sentimentScore = sentimentScore; + } + + /** + *

+ * Describes the level of confidence that Amazon Comprehend has in the + * accuracy of its detection of sentiments. + *

+ *

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

+ * Describes the level of confidence that Amazon Comprehend has + * in the accuracy of its detection of sentiments. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public MentionSentiment withSentimentScore(SentimentScore sentimentScore) { + this.sentimentScore = sentimentScore; + 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 (getSentiment() != null) + sb.append("Sentiment: " + getSentiment() + ","); + if (getSentimentScore() != null) + sb.append("SentimentScore: " + getSentimentScore()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getSentiment() == null) ? 0 : getSentiment().hashCode()); + hashCode = prime * hashCode + + ((getSentimentScore() == null) ? 0 : getSentimentScore().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof MentionSentiment == false) + return false; + MentionSentiment other = (MentionSentiment) obj; + + if (other.getSentiment() == null ^ this.getSentiment() == null) + return false; + if (other.getSentiment() != null + && other.getSentiment().equals(this.getSentiment()) == false) + return false; + if (other.getSentimentScore() == null ^ this.getSentimentScore() == null) + return false; + if (other.getSentimentScore() != null + && other.getSentimentScore().equals(this.getSentimentScore()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/PartOfSpeechTag.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/PartOfSpeechTag.java index c98f16621a..fa833c7ab3 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/PartOfSpeechTag.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/PartOfSpeechTag.java @@ -22,7 +22,9 @@ * Identifies the part of speech represented by the token and gives the * confidence that Amazon Comprehend has that the part of speech was correctly * identified. For more information about the parts of speech that Amazon - * Comprehend can identify, see how-syntax. + * Comprehend can identify, see Syntax in the Comprehend Developer Guide. *

*/ public class PartOfSpeechTag implements Serializable { diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/PiiEntity.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/PiiEntity.java index 82965cbbb2..73767bf6db 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/PiiEntity.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/PiiEntity.java @@ -53,22 +53,16 @@ public class PiiEntity implements Serializable { /** *

- * A character offset in the input text that shows where the PII entity - * begins (the first character is at position 0). The offset returns the - * position of each UTF-8 code point in the string. A code point is - * the abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the entity. *

*/ private Integer beginOffset; /** *

- * A character offset in the input text that shows where the PII entity - * ends. The offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 character maps - * to a single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the entity. *

*/ private Integer endOffset; @@ -273,20 +267,13 @@ public PiiEntity withType(PiiEntityType type) { /** *

- * A character offset in the input text that shows where the PII entity - * begins (the first character is at position 0). The offset returns the - * position of each UTF-8 code point in the string. A code point is - * the abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the entity. *

* * @return

- * A character offset in the input text that shows where the PII - * entity begins (the first character is at position 0). The offset - * returns the position of each UTF-8 code point in the string. A - * code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 - * character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the entity. *

*/ public Integer getBeginOffset() { @@ -295,20 +282,13 @@ public Integer getBeginOffset() { /** *

- * A character offset in the input text that shows where the PII entity - * begins (the first character is at position 0). The offset returns the - * position of each UTF-8 code point in the string. A code point is - * the abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the entity. *

* * @param beginOffset

- * A character offset in the input text that shows where the PII - * entity begins (the first character is at position 0). The - * offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a - * particular graphical representation. For example, a multi-byte - * UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the entity. *

*/ public void setBeginOffset(Integer beginOffset) { @@ -317,23 +297,16 @@ public void setBeginOffset(Integer beginOffset) { /** *

- * A character offset in the input text that shows where the PII entity - * begins (the first character is at position 0). The offset returns the - * position of each UTF-8 code point in the string. A code point is - * the abstract character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to the first + * character in the entity. *

*

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

- * A character offset in the input text that shows where the PII - * entity begins (the first character is at position 0). The - * offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a - * particular graphical representation. For example, a multi-byte - * UTF-8 character maps to a single code point. + * The zero-based offset from the beginning of the source text to + * the first character in the entity. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -345,20 +318,13 @@ public PiiEntity withBeginOffset(Integer beginOffset) { /** *

- * A character offset in the input text that shows where the PII entity - * ends. The offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 character maps - * to a single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the entity. *

* * @return

- * A character offset in the input text that shows where the PII - * entity ends. The offset returns the position of each UTF-8 code - * point in the string. A code point is the abstract - * character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code - * point. + * The zero-based offset from the beginning of the source text to + * the last character in the entity. *

*/ public Integer getEndOffset() { @@ -367,20 +333,13 @@ public Integer getEndOffset() { /** *

- * A character offset in the input text that shows where the PII entity - * ends. The offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 character maps - * to a single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the entity. *

* * @param endOffset

- * A character offset in the input text that shows where the PII - * entity ends. The offset returns the position of each UTF-8 - * code point in the string. A code point is the abstract - * character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code - * point. + * The zero-based offset from the beginning of the source text to + * the last character in the entity. *

*/ public void setEndOffset(Integer endOffset) { @@ -389,23 +348,16 @@ public void setEndOffset(Integer endOffset) { /** *

- * A character offset in the input text that shows where the PII entity - * ends. The offset returns the position of each UTF-8 code point in the - * string. A code point is the abstract character from a particular - * graphical representation. For example, a multi-byte UTF-8 character maps - * to a single code point. + * The zero-based offset from the beginning of the source text to the last + * character in the entity. *

*

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

- * A character offset in the input text that shows where the PII - * entity ends. The offset returns the position of each UTF-8 - * code point in the string. A code point is the abstract - * character from a particular graphical representation. For - * example, a multi-byte UTF-8 character maps to a single code - * point. + * The zero-based offset from the beginning of the source text to + * the last character in the entity. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/StartTargetedSentimentDetectionJobRequest.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/StartTargetedSentimentDetectionJobRequest.java index 383b8e0bc1..ccca6612c9 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/StartTargetedSentimentDetectionJobRequest.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/StartTargetedSentimentDetectionJobRequest.java @@ -69,8 +69,8 @@ public class StartTargetedSentimentDetectionJobRequest extends AmazonWebServiceR /** *

- * The language of the input documents. Currently, English is the only valid - * language. + * The language of the input documents. Currently, English is the only + * supported language. *

*

* Constraints:
@@ -369,8 +369,8 @@ public StartTargetedSentimentDetectionJobRequest withJobName(String jobName) { /** *

- * The language of the input documents. Currently, English is the only valid - * language. + * The language of the input documents. Currently, English is the only + * supported language. *

*

* Constraints:
@@ -378,7 +378,7 @@ public StartTargetedSentimentDetectionJobRequest withJobName(String jobName) { * * @return

* The language of the input documents. Currently, English is the - * only valid language. + * only supported language. *

* @see LanguageCode */ @@ -388,8 +388,8 @@ public String getLanguageCode() { /** *

- * The language of the input documents. Currently, English is the only valid - * language. + * The language of the input documents. Currently, English is the only + * supported language. *

*

* Constraints:
@@ -397,7 +397,7 @@ public String getLanguageCode() { * * @param languageCode

* The language of the input documents. Currently, English is the - * only valid language. + * only supported language. *

* @see LanguageCode */ @@ -407,8 +407,8 @@ public void setLanguageCode(String languageCode) { /** *

- * The language of the input documents. Currently, English is the only valid - * language. + * The language of the input documents. Currently, English is the only + * supported language. *

*

* Returns a reference to this object so that method calls can be chained @@ -419,7 +419,7 @@ public void setLanguageCode(String languageCode) { * * @param languageCode

* The language of the input documents. Currently, English is the - * only valid language. + * only supported language. *

* @return A reference to this updated object so that method calls can be * chained together. @@ -432,8 +432,8 @@ public StartTargetedSentimentDetectionJobRequest withLanguageCode(String languag /** *

- * The language of the input documents. Currently, English is the only valid - * language. + * The language of the input documents. Currently, English is the only + * supported language. *

*

* Constraints:
@@ -441,7 +441,7 @@ public StartTargetedSentimentDetectionJobRequest withLanguageCode(String languag * * @param languageCode

* The language of the input documents. Currently, English is the - * only valid language. + * only supported language. *

* @see LanguageCode */ @@ -451,8 +451,8 @@ public void setLanguageCode(LanguageCode languageCode) { /** *

- * The language of the input documents. Currently, English is the only valid - * language. + * The language of the input documents. Currently, English is the only + * supported language. *

*

* Returns a reference to this object so that method calls can be chained @@ -463,7 +463,7 @@ public void setLanguageCode(LanguageCode languageCode) { * * @param languageCode

* The language of the input documents. Currently, English is the - * only valid language. + * only supported language. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/SyntaxToken.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/SyntaxToken.java index fde22089c9..39c7e54f18 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/SyntaxToken.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/SyntaxToken.java @@ -61,7 +61,9 @@ public class SyntaxToken implements Serializable { *

* Provides the part of speech label and the confidence level that Amazon * Comprehend has that the part of speech was correctly identified. For more - * information, see how-syntax. + * information, see Syntax in the Comprehend Developer Guide. *

*/ private PartOfSpeechTag partOfSpeech; @@ -271,13 +273,17 @@ public SyntaxToken withEndOffset(Integer endOffset) { *

* Provides the part of speech label and the confidence level that Amazon * Comprehend has that the part of speech was correctly identified. For more - * information, see how-syntax. + * information, see Syntax in the Comprehend Developer Guide. *

* * @return

* Provides the part of speech label and the confidence level that * Amazon Comprehend has that the part of speech was correctly - * identified. For more information, see how-syntax. + * identified. For more information, see Syntax in the Comprehend Developer Guide. *

*/ public PartOfSpeechTag getPartOfSpeech() { @@ -288,14 +294,17 @@ public PartOfSpeechTag getPartOfSpeech() { *

* Provides the part of speech label and the confidence level that Amazon * Comprehend has that the part of speech was correctly identified. For more - * information, see how-syntax. + * information, see Syntax in the Comprehend Developer Guide. *

* * @param partOfSpeech

* Provides the part of speech label and the confidence level * that Amazon Comprehend has that the part of speech was - * correctly identified. For more information, see - * how-syntax. + * correctly identified. For more information, see Syntax in the Comprehend Developer Guide. *

*/ public void setPartOfSpeech(PartOfSpeechTag partOfSpeech) { @@ -306,7 +315,9 @@ public void setPartOfSpeech(PartOfSpeechTag partOfSpeech) { *

* Provides the part of speech label and the confidence level that Amazon * Comprehend has that the part of speech was correctly identified. For more - * information, see how-syntax. + * information, see Syntax in the Comprehend Developer Guide. *

*

* Returns a reference to this object so that method calls can be chained @@ -315,8 +326,9 @@ public void setPartOfSpeech(PartOfSpeechTag partOfSpeech) { * @param partOfSpeech

* Provides the part of speech label and the confidence level * that Amazon Comprehend has that the part of speech was - * correctly identified. For more information, see - * how-syntax. + * correctly identified. For more information, see Syntax in the Comprehend Developer Guide. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentEntity.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentEntity.java new file mode 100644 index 0000000000..403abb00ca --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentEntity.java @@ -0,0 +1,286 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.io.Serializable; + +/** + *

+ * Information about one of the entities found by targeted sentiment analysis. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

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

+ * One or more index into the Mentions array that provides the best name for + * the entity group. + *

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

+ * An array of mentions of the entity in the document. The array represents + * a co-reference group. See Co-reference group for an example. + *

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

+ * One or more index into the Mentions array that provides the best name for + * the entity group. + *

+ * + * @return

+ * One or more index into the Mentions array that provides the best + * name for the entity group. + *

+ */ + public java.util.List getDescriptiveMentionIndex() { + return descriptiveMentionIndex; + } + + /** + *

+ * One or more index into the Mentions array that provides the best name for + * the entity group. + *

+ * + * @param descriptiveMentionIndex

+ * One or more index into the Mentions array that provides the + * best name for the entity group. + *

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

+ * One or more index into the Mentions array that provides the best name for + * the entity group. + *

+ *

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

+ * One or more index into the Mentions array that provides the + * best name for the entity group. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentEntity withDescriptiveMentionIndex(Integer... descriptiveMentionIndex) { + if (getDescriptiveMentionIndex() == null) { + this.descriptiveMentionIndex = new java.util.ArrayList( + descriptiveMentionIndex.length); + } + for (Integer value : descriptiveMentionIndex) { + this.descriptiveMentionIndex.add(value); + } + return this; + } + + /** + *

+ * One or more index into the Mentions array that provides the best name for + * the entity group. + *

+ *

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

+ * One or more index into the Mentions array that provides the + * best name for the entity group. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentEntity withDescriptiveMentionIndex( + java.util.Collection descriptiveMentionIndex) { + setDescriptiveMentionIndex(descriptiveMentionIndex); + return this; + } + + /** + *

+ * An array of mentions of the entity in the document. The array represents + * a co-reference group. See Co-reference group for an example. + *

+ * + * @return

+ * An array of mentions of the entity in the document. The array + * represents a co-reference group. See Co-reference group for an example. + *

+ */ + public java.util.List getMentions() { + return mentions; + } + + /** + *

+ * An array of mentions of the entity in the document. The array represents + * a co-reference group. See Co-reference group for an example. + *

+ * + * @param mentions

+ * An array of mentions of the entity in the document. The array + * represents a co-reference group. See Co-reference group for an example. + *

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

+ * An array of mentions of the entity in the document. The array represents + * a co-reference group. See Co-reference group for an example. + *

+ *

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

+ * An array of mentions of the entity in the document. The array + * represents a co-reference group. See Co-reference group for an example. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentEntity withMentions(TargetedSentimentMention... mentions) { + if (getMentions() == null) { + this.mentions = new java.util.ArrayList(mentions.length); + } + for (TargetedSentimentMention value : mentions) { + this.mentions.add(value); + } + return this; + } + + /** + *

+ * An array of mentions of the entity in the document. The array represents + * a co-reference group. See Co-reference group for an example. + *

+ *

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

+ * An array of mentions of the entity in the document. The array + * represents a co-reference group. See Co-reference group for an example. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentEntity withMentions( + java.util.Collection mentions) { + setMentions(mentions); + 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 (getDescriptiveMentionIndex() != null) + sb.append("DescriptiveMentionIndex: " + getDescriptiveMentionIndex() + ","); + if (getMentions() != null) + sb.append("Mentions: " + getMentions()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime + * hashCode + + ((getDescriptiveMentionIndex() == null) ? 0 : getDescriptiveMentionIndex() + .hashCode()); + hashCode = prime * hashCode + ((getMentions() == null) ? 0 : getMentions().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof TargetedSentimentEntity == false) + return false; + TargetedSentimentEntity other = (TargetedSentimentEntity) obj; + + if (other.getDescriptiveMentionIndex() == null ^ this.getDescriptiveMentionIndex() == null) + return false; + if (other.getDescriptiveMentionIndex() != null + && other.getDescriptiveMentionIndex().equals(this.getDescriptiveMentionIndex()) == false) + return false; + if (other.getMentions() == null ^ this.getMentions() == null) + return false; + if (other.getMentions() != null && other.getMentions().equals(this.getMentions()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentEntityType.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentEntityType.java new file mode 100644 index 0000000000..8f9ef1bf16 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentEntityType.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Targeted Sentiment Entity Type + */ +public enum TargetedSentimentEntityType { + + PERSON("PERSON"), + LOCATION("LOCATION"), + ORGANIZATION("ORGANIZATION"), + FACILITY("FACILITY"), + BRAND("BRAND"), + COMMERCIAL_ITEM("COMMERCIAL_ITEM"), + MOVIE("MOVIE"), + MUSIC("MUSIC"), + BOOK("BOOK"), + SOFTWARE("SOFTWARE"), + GAME("GAME"), + PERSONAL_TITLE("PERSONAL_TITLE"), + EVENT("EVENT"), + DATE("DATE"), + QUANTITY("QUANTITY"), + ATTRIBUTE("ATTRIBUTE"), + OTHER("OTHER"); + + private String value; + + private TargetedSentimentEntityType(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("PERSON", PERSON); + enumMap.put("LOCATION", LOCATION); + enumMap.put("ORGANIZATION", ORGANIZATION); + enumMap.put("FACILITY", FACILITY); + enumMap.put("BRAND", BRAND); + enumMap.put("COMMERCIAL_ITEM", COMMERCIAL_ITEM); + enumMap.put("MOVIE", MOVIE); + enumMap.put("MUSIC", MUSIC); + enumMap.put("BOOK", BOOK); + enumMap.put("SOFTWARE", SOFTWARE); + enumMap.put("GAME", GAME); + enumMap.put("PERSONAL_TITLE", PERSONAL_TITLE); + enumMap.put("EVENT", EVENT); + enumMap.put("DATE", DATE); + enumMap.put("QUANTITY", QUANTITY); + enumMap.put("ATTRIBUTE", ATTRIBUTE); + enumMap.put("OTHER", OTHER); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return TargetedSentimentEntityType corresponding to the value + */ + public static TargetedSentimentEntityType 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-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentMention.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentMention.java new file mode 100644 index 0000000000..a57bade9cb --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/TargetedSentimentMention.java @@ -0,0 +1,607 @@ +/* + * Copyright 2010-2022 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.comprehend.model; + +import java.io.Serializable; + +/** + *

+ * Information about one mention of an entity. The mention information includes + * the location of the mention in the text and the sentiment of the mention. + *

+ *

+ * For more information about targeted sentiment, see Targeted sentiment. + *

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

+ * Model confidence that the entity is relevant. Value range is zero to one, + * where one is highest confidence. + *

+ */ + private Float score; + + /** + *

+ * The confidence that all the entities mentioned in the group relate to the + * same entity. + *

+ */ + private Float groupScore; + + /** + *

+ * The text in the document that identifies the entity. + *

+ *

+ * Constraints:
+ * Length: 1 -
+ */ + private String text; + + /** + *

+ * The type of the entity. Amazon Comprehend supports a variety of entity types. + *

+ *

+ * Constraints:
+ * Allowed Values: PERSON, LOCATION, ORGANIZATION, FACILITY, BRAND, + * COMMERCIAL_ITEM, MOVIE, MUSIC, BOOK, SOFTWARE, GAME, PERSONAL_TITLE, + * EVENT, DATE, QUANTITY, ATTRIBUTE, OTHER + */ + private String type; + + /** + *

+ * Contains the sentiment and sentiment score for the mention. + *

+ */ + private MentionSentiment mentionSentiment; + + /** + *

+ * The offset into the document text where the mention begins. + *

+ */ + private Integer beginOffset; + + /** + *

+ * The offset into the document text where the mention ends. + *

+ */ + private Integer endOffset; + + /** + *

+ * Model confidence that the entity is relevant. Value range is zero to one, + * where one is highest confidence. + *

+ * + * @return

+ * Model confidence that the entity is relevant. Value range is zero + * to one, where one is highest confidence. + *

+ */ + public Float getScore() { + return score; + } + + /** + *

+ * Model confidence that the entity is relevant. Value range is zero to one, + * where one is highest confidence. + *

+ * + * @param score

+ * Model confidence that the entity is relevant. Value range is + * zero to one, where one is highest confidence. + *

+ */ + public void setScore(Float score) { + this.score = score; + } + + /** + *

+ * Model confidence that the entity is relevant. Value range is zero to one, + * where one is highest confidence. + *

+ *

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

+ * Model confidence that the entity is relevant. Value range is + * zero to one, where one is highest confidence. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentMention withScore(Float score) { + this.score = score; + return this; + } + + /** + *

+ * The confidence that all the entities mentioned in the group relate to the + * same entity. + *

+ * + * @return

+ * The confidence that all the entities mentioned in the group + * relate to the same entity. + *

+ */ + public Float getGroupScore() { + return groupScore; + } + + /** + *

+ * The confidence that all the entities mentioned in the group relate to the + * same entity. + *

+ * + * @param groupScore

+ * The confidence that all the entities mentioned in the group + * relate to the same entity. + *

+ */ + public void setGroupScore(Float groupScore) { + this.groupScore = groupScore; + } + + /** + *

+ * The confidence that all the entities mentioned in the group relate to the + * same entity. + *

+ *

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

+ * The confidence that all the entities mentioned in the group + * relate to the same entity. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentMention withGroupScore(Float groupScore) { + this.groupScore = groupScore; + return this; + } + + /** + *

+ * The text in the document that identifies the entity. + *

+ *

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

+ * The text in the document that identifies the entity. + *

+ */ + public String getText() { + return text; + } + + /** + *

+ * The text in the document that identifies the entity. + *

+ *

+ * Constraints:
+ * Length: 1 -
+ * + * @param text

+ * The text in the document that identifies the entity. + *

+ */ + public void setText(String text) { + this.text = text; + } + + /** + *

+ * The text in the document that identifies the entity. + *

+ *

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

+ * Constraints:
+ * Length: 1 -
+ * + * @param text

+ * The text in the document that identifies the entity. + *

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

+ * The type of the entity. Amazon Comprehend supports a variety of entity types. + *

+ *

+ * Constraints:
+ * Allowed Values: PERSON, LOCATION, ORGANIZATION, FACILITY, BRAND, + * COMMERCIAL_ITEM, MOVIE, MUSIC, BOOK, SOFTWARE, GAME, PERSONAL_TITLE, + * EVENT, DATE, QUANTITY, ATTRIBUTE, OTHER + * + * @return

+ * The type of the entity. Amazon Comprehend supports a variety of + * entity types. + *

+ * @see TargetedSentimentEntityType + */ + public String getType() { + return type; + } + + /** + *

+ * The type of the entity. Amazon Comprehend supports a variety of entity types. + *

+ *

+ * Constraints:
+ * Allowed Values: PERSON, LOCATION, ORGANIZATION, FACILITY, BRAND, + * COMMERCIAL_ITEM, MOVIE, MUSIC, BOOK, SOFTWARE, GAME, PERSONAL_TITLE, + * EVENT, DATE, QUANTITY, ATTRIBUTE, OTHER + * + * @param type

+ * The type of the entity. Amazon Comprehend supports a variety + * of entity types. + *

+ * @see TargetedSentimentEntityType + */ + public void setType(String type) { + this.type = type; + } + + /** + *

+ * The type of the entity. Amazon Comprehend supports a variety of entity types. + *

+ *

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

+ * Constraints:
+ * Allowed Values: PERSON, LOCATION, ORGANIZATION, FACILITY, BRAND, + * COMMERCIAL_ITEM, MOVIE, MUSIC, BOOK, SOFTWARE, GAME, PERSONAL_TITLE, + * EVENT, DATE, QUANTITY, ATTRIBUTE, OTHER + * + * @param type

+ * The type of the entity. Amazon Comprehend supports a variety + * of entity types. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see TargetedSentimentEntityType + */ + public TargetedSentimentMention withType(String type) { + this.type = type; + return this; + } + + /** + *

+ * The type of the entity. Amazon Comprehend supports a variety of entity types. + *

+ *

+ * Constraints:
+ * Allowed Values: PERSON, LOCATION, ORGANIZATION, FACILITY, BRAND, + * COMMERCIAL_ITEM, MOVIE, MUSIC, BOOK, SOFTWARE, GAME, PERSONAL_TITLE, + * EVENT, DATE, QUANTITY, ATTRIBUTE, OTHER + * + * @param type

+ * The type of the entity. Amazon Comprehend supports a variety + * of entity types. + *

+ * @see TargetedSentimentEntityType + */ + public void setType(TargetedSentimentEntityType type) { + this.type = type.toString(); + } + + /** + *

+ * The type of the entity. Amazon Comprehend supports a variety of entity types. + *

+ *

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

+ * Constraints:
+ * Allowed Values: PERSON, LOCATION, ORGANIZATION, FACILITY, BRAND, + * COMMERCIAL_ITEM, MOVIE, MUSIC, BOOK, SOFTWARE, GAME, PERSONAL_TITLE, + * EVENT, DATE, QUANTITY, ATTRIBUTE, OTHER + * + * @param type

+ * The type of the entity. Amazon Comprehend supports a variety + * of entity types. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + * @see TargetedSentimentEntityType + */ + public TargetedSentimentMention withType(TargetedSentimentEntityType type) { + this.type = type.toString(); + return this; + } + + /** + *

+ * Contains the sentiment and sentiment score for the mention. + *

+ * + * @return

+ * Contains the sentiment and sentiment score for the mention. + *

+ */ + public MentionSentiment getMentionSentiment() { + return mentionSentiment; + } + + /** + *

+ * Contains the sentiment and sentiment score for the mention. + *

+ * + * @param mentionSentiment

+ * Contains the sentiment and sentiment score for the mention. + *

+ */ + public void setMentionSentiment(MentionSentiment mentionSentiment) { + this.mentionSentiment = mentionSentiment; + } + + /** + *

+ * Contains the sentiment and sentiment score for the mention. + *

+ *

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

+ * Contains the sentiment and sentiment score for the mention. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentMention withMentionSentiment(MentionSentiment mentionSentiment) { + this.mentionSentiment = mentionSentiment; + return this; + } + + /** + *

+ * The offset into the document text where the mention begins. + *

+ * + * @return

+ * The offset into the document text where the mention begins. + *

+ */ + public Integer getBeginOffset() { + return beginOffset; + } + + /** + *

+ * The offset into the document text where the mention begins. + *

+ * + * @param beginOffset

+ * The offset into the document text where the mention begins. + *

+ */ + public void setBeginOffset(Integer beginOffset) { + this.beginOffset = beginOffset; + } + + /** + *

+ * The offset into the document text where the mention begins. + *

+ *

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

+ * The offset into the document text where the mention begins. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentMention withBeginOffset(Integer beginOffset) { + this.beginOffset = beginOffset; + return this; + } + + /** + *

+ * The offset into the document text where the mention ends. + *

+ * + * @return

+ * The offset into the document text where the mention ends. + *

+ */ + public Integer getEndOffset() { + return endOffset; + } + + /** + *

+ * The offset into the document text where the mention ends. + *

+ * + * @param endOffset

+ * The offset into the document text where the mention ends. + *

+ */ + public void setEndOffset(Integer endOffset) { + this.endOffset = endOffset; + } + + /** + *

+ * The offset into the document text where the mention ends. + *

+ *

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

+ * The offset into the document text where the mention ends. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public TargetedSentimentMention withEndOffset(Integer endOffset) { + this.endOffset = endOffset; + 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 (getScore() != null) + sb.append("Score: " + getScore() + ","); + if (getGroupScore() != null) + sb.append("GroupScore: " + getGroupScore() + ","); + if (getText() != null) + sb.append("Text: " + getText() + ","); + if (getType() != null) + sb.append("Type: " + getType() + ","); + if (getMentionSentiment() != null) + sb.append("MentionSentiment: " + getMentionSentiment() + ","); + if (getBeginOffset() != null) + sb.append("BeginOffset: " + getBeginOffset() + ","); + if (getEndOffset() != null) + sb.append("EndOffset: " + getEndOffset()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getScore() == null) ? 0 : getScore().hashCode()); + hashCode = prime * hashCode + ((getGroupScore() == null) ? 0 : getGroupScore().hashCode()); + hashCode = prime * hashCode + ((getText() == null) ? 0 : getText().hashCode()); + hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); + hashCode = prime * hashCode + + ((getMentionSentiment() == null) ? 0 : getMentionSentiment().hashCode()); + hashCode = prime * hashCode + + ((getBeginOffset() == null) ? 0 : getBeginOffset().hashCode()); + hashCode = prime * hashCode + ((getEndOffset() == null) ? 0 : getEndOffset().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof TargetedSentimentMention == false) + return false; + TargetedSentimentMention other = (TargetedSentimentMention) obj; + + if (other.getScore() == null ^ this.getScore() == null) + return false; + if (other.getScore() != null && other.getScore().equals(this.getScore()) == false) + return false; + if (other.getGroupScore() == null ^ this.getGroupScore() == null) + return false; + if (other.getGroupScore() != null + && other.getGroupScore().equals(this.getGroupScore()) == false) + return false; + if (other.getText() == null ^ this.getText() == null) + return false; + if (other.getText() != null && other.getText().equals(this.getText()) == false) + return false; + if (other.getType() == null ^ this.getType() == null) + return false; + if (other.getType() != null && other.getType().equals(this.getType()) == false) + return false; + if (other.getMentionSentiment() == null ^ this.getMentionSentiment() == null) + return false; + if (other.getMentionSentiment() != null + && other.getMentionSentiment().equals(this.getMentionSentiment()) == false) + return false; + if (other.getBeginOffset() == null ^ this.getBeginOffset() == null) + return false; + if (other.getBeginOffset() != null + && other.getBeginOffset().equals(this.getBeginOffset()) == false) + return false; + if (other.getEndOffset() == null ^ this.getEndOffset() == null) + return false; + if (other.getEndOffset() != null + && other.getEndOffset().equals(this.getEndOffset()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/UnsupportedLanguageException.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/UnsupportedLanguageException.java index ac42798b05..7f3487338c 100644 --- a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/UnsupportedLanguageException.java +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/UnsupportedLanguageException.java @@ -21,8 +21,9 @@ *

* Amazon Comprehend can't process the language of the input text. For custom * entity recognition APIs, only English, Spanish, French, Italian, German, or - * Portuguese are accepted. For a list of supported languages, see - * supported-languages. + * Portuguese are accepted. For a list of supported languages, Supported languages in the Comprehend Developer Guide. *

*/ public class UnsupportedLanguageException extends AmazonServiceException { diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentItemResultJsonMarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentItemResultJsonMarshaller.java new file mode 100644 index 0000000000..19a44cc01f --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentItemResultJsonMarshaller.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO BatchDetectTargetedSentimentItemResult + */ +class BatchDetectTargetedSentimentItemResultJsonMarshaller { + + public void marshall( + BatchDetectTargetedSentimentItemResult batchDetectTargetedSentimentItemResult, + AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (batchDetectTargetedSentimentItemResult.getIndex() != null) { + Integer index = batchDetectTargetedSentimentItemResult.getIndex(); + jsonWriter.name("Index"); + jsonWriter.value(index); + } + if (batchDetectTargetedSentimentItemResult.getEntities() != null) { + java.util.List entities = batchDetectTargetedSentimentItemResult + .getEntities(); + jsonWriter.name("Entities"); + jsonWriter.beginArray(); + for (TargetedSentimentEntity entitiesItem : entities) { + if (entitiesItem != null) { + TargetedSentimentEntityJsonMarshaller.getInstance().marshall(entitiesItem, + jsonWriter); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static BatchDetectTargetedSentimentItemResultJsonMarshaller instance; + + public static BatchDetectTargetedSentimentItemResultJsonMarshaller getInstance() { + if (instance == null) + instance = new BatchDetectTargetedSentimentItemResultJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentItemResultJsonUnmarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentItemResultJsonUnmarshaller.java new file mode 100644 index 0000000000..cd05afaea1 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentItemResultJsonUnmarshaller.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO BatchDetectTargetedSentimentItemResult + */ +class BatchDetectTargetedSentimentItemResultJsonUnmarshaller implements + Unmarshaller { + + public BatchDetectTargetedSentimentItemResult unmarshall(JsonUnmarshallerContext context) + throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + BatchDetectTargetedSentimentItemResult batchDetectTargetedSentimentItemResult = new BatchDetectTargetedSentimentItemResult(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Index")) { + batchDetectTargetedSentimentItemResult.setIndex(IntegerJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else if (name.equals("Entities")) { + batchDetectTargetedSentimentItemResult + .setEntities(new ListUnmarshaller( + TargetedSentimentEntityJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return batchDetectTargetedSentimentItemResult; + } + + private static BatchDetectTargetedSentimentItemResultJsonUnmarshaller instance; + + public static BatchDetectTargetedSentimentItemResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new BatchDetectTargetedSentimentItemResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentRequestMarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentRequestMarshaller.java new file mode 100644 index 0000000000..f36c9aff35 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentRequestMarshaller.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010-2022 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.comprehend.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.comprehend.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 BatchDetectTargetedSentimentRequest + */ +public class BatchDetectTargetedSentimentRequestMarshaller + implements + Marshaller, BatchDetectTargetedSentimentRequest> { + + public Request marshall( + BatchDetectTargetedSentimentRequest batchDetectTargetedSentimentRequest) { + if (batchDetectTargetedSentimentRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(BatchDetectTargetedSentimentRequest)"); + } + + Request request = new DefaultRequest( + batchDetectTargetedSentimentRequest, "AmazonComprehend"); + String target = "Comprehend_20171127.BatchDetectTargetedSentiment"; + 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 (batchDetectTargetedSentimentRequest.getTextList() != null) { + java.util.List textList = batchDetectTargetedSentimentRequest.getTextList(); + jsonWriter.name("TextList"); + jsonWriter.beginArray(); + for (String textListItem : textList) { + if (textListItem != null) { + jsonWriter.value(textListItem); + } + } + jsonWriter.endArray(); + } + if (batchDetectTargetedSentimentRequest.getLanguageCode() != null) { + String languageCode = batchDetectTargetedSentimentRequest.getLanguageCode(); + jsonWriter.name("LanguageCode"); + jsonWriter.value(languageCode); + } + + 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-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentResultJsonUnmarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentResultJsonUnmarshaller.java new file mode 100644 index 0000000000..0be8150ca7 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/BatchDetectTargetedSentimentResultJsonUnmarshaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response BatchDetectTargetedSentimentResult + */ +public class BatchDetectTargetedSentimentResultJsonUnmarshaller implements + Unmarshaller { + + public BatchDetectTargetedSentimentResult unmarshall(JsonUnmarshallerContext context) + throws Exception { + BatchDetectTargetedSentimentResult batchDetectTargetedSentimentResult = new BatchDetectTargetedSentimentResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("ResultList")) { + batchDetectTargetedSentimentResult + .setResultList(new ListUnmarshaller( + BatchDetectTargetedSentimentItemResultJsonUnmarshaller + .getInstance() + ) + .unmarshall(context)); + } else if (name.equals("ErrorList")) { + batchDetectTargetedSentimentResult + .setErrorList(new ListUnmarshaller( + BatchItemErrorJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return batchDetectTargetedSentimentResult; + } + + private static BatchDetectTargetedSentimentResultJsonUnmarshaller instance; + + public static BatchDetectTargetedSentimentResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new BatchDetectTargetedSentimentResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/DetectTargetedSentimentRequestMarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/DetectTargetedSentimentRequestMarshaller.java new file mode 100644 index 0000000000..82fc8e7c3a --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/DetectTargetedSentimentRequestMarshaller.java @@ -0,0 +1,93 @@ +/* + * Copyright 2010-2022 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.comprehend.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.comprehend.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 DetectTargetedSentimentRequest + */ +public class DetectTargetedSentimentRequestMarshaller implements + Marshaller, DetectTargetedSentimentRequest> { + + public Request marshall( + DetectTargetedSentimentRequest detectTargetedSentimentRequest) { + if (detectTargetedSentimentRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DetectTargetedSentimentRequest)"); + } + + Request request = new DefaultRequest( + detectTargetedSentimentRequest, "AmazonComprehend"); + String target = "Comprehend_20171127.DetectTargetedSentiment"; + 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 (detectTargetedSentimentRequest.getText() != null) { + String text = detectTargetedSentimentRequest.getText(); + jsonWriter.name("Text"); + jsonWriter.value(text); + } + if (detectTargetedSentimentRequest.getLanguageCode() != null) { + String languageCode = detectTargetedSentimentRequest.getLanguageCode(); + jsonWriter.name("LanguageCode"); + jsonWriter.value(languageCode); + } + + 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-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/DetectTargetedSentimentResultJsonUnmarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/DetectTargetedSentimentResultJsonUnmarshaller.java new file mode 100644 index 0000000000..393e2fdc48 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/DetectTargetedSentimentResultJsonUnmarshaller.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DetectTargetedSentimentResult + */ +public class DetectTargetedSentimentResultJsonUnmarshaller implements + Unmarshaller { + + public DetectTargetedSentimentResult unmarshall(JsonUnmarshallerContext context) + throws Exception { + DetectTargetedSentimentResult detectTargetedSentimentResult = new DetectTargetedSentimentResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Entities")) { + detectTargetedSentimentResult + .setEntities(new ListUnmarshaller( + TargetedSentimentEntityJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return detectTargetedSentimentResult; + } + + private static DetectTargetedSentimentResultJsonUnmarshaller instance; + + public static DetectTargetedSentimentResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DetectTargetedSentimentResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/MentionSentimentJsonMarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/MentionSentimentJsonMarshaller.java new file mode 100644 index 0000000000..2e1b2c42b2 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/MentionSentimentJsonMarshaller.java @@ -0,0 +1,50 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO MentionSentiment + */ +class MentionSentimentJsonMarshaller { + + public void marshall(MentionSentiment mentionSentiment, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (mentionSentiment.getSentiment() != null) { + String sentiment = mentionSentiment.getSentiment(); + jsonWriter.name("Sentiment"); + jsonWriter.value(sentiment); + } + if (mentionSentiment.getSentimentScore() != null) { + SentimentScore sentimentScore = mentionSentiment.getSentimentScore(); + jsonWriter.name("SentimentScore"); + SentimentScoreJsonMarshaller.getInstance().marshall(sentimentScore, jsonWriter); + } + jsonWriter.endObject(); + } + + private static MentionSentimentJsonMarshaller instance; + + public static MentionSentimentJsonMarshaller getInstance() { + if (instance == null) + instance = new MentionSentimentJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/MentionSentimentJsonUnmarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/MentionSentimentJsonUnmarshaller.java new file mode 100644 index 0000000000..17da172d13 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/MentionSentimentJsonUnmarshaller.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO MentionSentiment + */ +class MentionSentimentJsonUnmarshaller implements + Unmarshaller { + + public MentionSentiment unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + MentionSentiment mentionSentiment = new MentionSentiment(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Sentiment")) { + mentionSentiment.setSentiment(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("SentimentScore")) { + mentionSentiment.setSentimentScore(SentimentScoreJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return mentionSentiment; + } + + private static MentionSentimentJsonUnmarshaller instance; + + public static MentionSentimentJsonUnmarshaller getInstance() { + if (instance == null) + instance = new MentionSentimentJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentEntityJsonMarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentEntityJsonMarshaller.java new file mode 100644 index 0000000000..4a540a4cb6 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentEntityJsonMarshaller.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO TargetedSentimentEntity + */ +class TargetedSentimentEntityJsonMarshaller { + + public void marshall(TargetedSentimentEntity targetedSentimentEntity, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (targetedSentimentEntity.getDescriptiveMentionIndex() != null) { + java.util.List descriptiveMentionIndex = targetedSentimentEntity + .getDescriptiveMentionIndex(); + jsonWriter.name("DescriptiveMentionIndex"); + jsonWriter.beginArray(); + for (Integer descriptiveMentionIndexItem : descriptiveMentionIndex) { + if (descriptiveMentionIndexItem != null) { + jsonWriter.value(descriptiveMentionIndexItem); + } + } + jsonWriter.endArray(); + } + if (targetedSentimentEntity.getMentions() != null) { + java.util.List mentions = targetedSentimentEntity + .getMentions(); + jsonWriter.name("Mentions"); + jsonWriter.beginArray(); + for (TargetedSentimentMention mentionsItem : mentions) { + if (mentionsItem != null) { + TargetedSentimentMentionJsonMarshaller.getInstance().marshall(mentionsItem, + jsonWriter); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static TargetedSentimentEntityJsonMarshaller instance; + + public static TargetedSentimentEntityJsonMarshaller getInstance() { + if (instance == null) + instance = new TargetedSentimentEntityJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentEntityJsonUnmarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentEntityJsonUnmarshaller.java new file mode 100644 index 0000000000..33fdfb12c5 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentEntityJsonUnmarshaller.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO TargetedSentimentEntity + */ +class TargetedSentimentEntityJsonUnmarshaller implements + Unmarshaller { + + public TargetedSentimentEntity unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + TargetedSentimentEntity targetedSentimentEntity = new TargetedSentimentEntity(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("DescriptiveMentionIndex")) { + targetedSentimentEntity.setDescriptiveMentionIndex(new ListUnmarshaller( + IntegerJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("Mentions")) { + targetedSentimentEntity.setMentions(new ListUnmarshaller( + TargetedSentimentMentionJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return targetedSentimentEntity; + } + + private static TargetedSentimentEntityJsonUnmarshaller instance; + + public static TargetedSentimentEntityJsonUnmarshaller getInstance() { + if (instance == null) + instance = new TargetedSentimentEntityJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentMentionJsonMarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentMentionJsonMarshaller.java new file mode 100644 index 0000000000..475eec473e --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentMentionJsonMarshaller.java @@ -0,0 +1,75 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO TargetedSentimentMention + */ +class TargetedSentimentMentionJsonMarshaller { + + public void marshall(TargetedSentimentMention targetedSentimentMention, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (targetedSentimentMention.getScore() != null) { + Float score = targetedSentimentMention.getScore(); + jsonWriter.name("Score"); + jsonWriter.value(score); + } + if (targetedSentimentMention.getGroupScore() != null) { + Float groupScore = targetedSentimentMention.getGroupScore(); + jsonWriter.name("GroupScore"); + jsonWriter.value(groupScore); + } + if (targetedSentimentMention.getText() != null) { + String text = targetedSentimentMention.getText(); + jsonWriter.name("Text"); + jsonWriter.value(text); + } + if (targetedSentimentMention.getType() != null) { + String type = targetedSentimentMention.getType(); + jsonWriter.name("Type"); + jsonWriter.value(type); + } + if (targetedSentimentMention.getMentionSentiment() != null) { + MentionSentiment mentionSentiment = targetedSentimentMention.getMentionSentiment(); + jsonWriter.name("MentionSentiment"); + MentionSentimentJsonMarshaller.getInstance().marshall(mentionSentiment, jsonWriter); + } + if (targetedSentimentMention.getBeginOffset() != null) { + Integer beginOffset = targetedSentimentMention.getBeginOffset(); + jsonWriter.name("BeginOffset"); + jsonWriter.value(beginOffset); + } + if (targetedSentimentMention.getEndOffset() != null) { + Integer endOffset = targetedSentimentMention.getEndOffset(); + jsonWriter.name("EndOffset"); + jsonWriter.value(endOffset); + } + jsonWriter.endObject(); + } + + private static TargetedSentimentMentionJsonMarshaller instance; + + public static TargetedSentimentMentionJsonMarshaller getInstance() { + if (instance == null) + instance = new TargetedSentimentMentionJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentMentionJsonUnmarshaller.java b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentMentionJsonUnmarshaller.java new file mode 100644 index 0000000000..f10d4ba6b7 --- /dev/null +++ b/aws-android-sdk-comprehend/src/main/java/com/amazonaws/services/comprehend/model/transform/TargetedSentimentMentionJsonUnmarshaller.java @@ -0,0 +1,76 @@ +/* + * Copyright 2010-2022 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.comprehend.model.transform; + +import com.amazonaws.services.comprehend.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO TargetedSentimentMention + */ +class TargetedSentimentMentionJsonUnmarshaller implements + Unmarshaller { + + public TargetedSentimentMention unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + TargetedSentimentMention targetedSentimentMention = new TargetedSentimentMention(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Score")) { + targetedSentimentMention.setScore(FloatJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("GroupScore")) { + targetedSentimentMention.setGroupScore(FloatJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Text")) { + targetedSentimentMention.setText(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Type")) { + targetedSentimentMention.setType(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("MentionSentiment")) { + targetedSentimentMention.setMentionSentiment(MentionSentimentJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else if (name.equals("BeginOffset")) { + targetedSentimentMention.setBeginOffset(IntegerJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("EndOffset")) { + targetedSentimentMention.setEndOffset(IntegerJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return targetedSentimentMention; + } + + private static TargetedSentimentMentionJsonUnmarshaller instance; + + public static TargetedSentimentMentionJsonUnmarshaller getInstance() { + if (instance == null) + instance = new TargetedSentimentMentionJsonUnmarshaller(); + return instance; + } +}