@aws-sdk/client-comprehend 3.441.0 → 3.448.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +8 -0
  2. package/dist-cjs/Comprehend.js +2 -0
  3. package/dist-cjs/commands/DetectToxicContentCommand.js +52 -0
  4. package/dist-cjs/commands/index.js +1 -0
  5. package/dist-cjs/models/models_0.js +21 -2
  6. package/dist-cjs/protocols/Aws_json1_1.js +86 -4
  7. package/dist-es/Comprehend.js +2 -0
  8. package/dist-es/commands/DetectToxicContentCommand.js +48 -0
  9. package/dist-es/commands/index.js +1 -0
  10. package/dist-es/models/models_0.js +17 -0
  11. package/dist-es/protocols/Aws_json1_1.js +80 -0
  12. package/dist-types/Comprehend.d.ts +7 -0
  13. package/dist-types/ComprehendClient.d.ts +3 -2
  14. package/dist-types/commands/BatchDetectTargetedSentimentCommand.d.ts +1 -1
  15. package/dist-types/commands/ClassifyDocumentCommand.d.ts +15 -3
  16. package/dist-types/commands/DetectTargetedSentimentCommand.d.ts +1 -1
  17. package/dist-types/commands/DetectToxicContentCommand.d.ts +108 -0
  18. package/dist-types/commands/StopEntitiesDetectionJobCommand.d.ts +1 -1
  19. package/dist-types/commands/StopEventsDetectionJobCommand.d.ts +1 -1
  20. package/dist-types/commands/StopKeyPhrasesDetectionJobCommand.d.ts +1 -1
  21. package/dist-types/commands/index.d.ts +1 -0
  22. package/dist-types/index.d.ts +2 -0
  23. package/dist-types/models/models_0.d.ts +136 -106
  24. package/dist-types/models/models_1.d.ts +79 -0
  25. package/dist-types/protocols/Aws_json1_1.d.ts +9 -0
  26. package/dist-types/ts3.4/Comprehend.d.ts +17 -0
  27. package/dist-types/ts3.4/ComprehendClient.d.ts +6 -0
  28. package/dist-types/ts3.4/commands/DetectToxicContentCommand.d.ts +39 -0
  29. package/dist-types/ts3.4/commands/StopEntitiesDetectionJobCommand.d.ts +1 -1
  30. package/dist-types/ts3.4/commands/StopEventsDetectionJobCommand.d.ts +1 -1
  31. package/dist-types/ts3.4/commands/StopKeyPhrasesDetectionJobCommand.d.ts +1 -1
  32. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  33. package/dist-types/ts3.4/index.d.ts +2 -0
  34. package/dist-types/ts3.4/models/models_0.d.ts +33 -21
  35. package/dist-types/ts3.4/models/models_1.d.ts +21 -0
  36. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +12 -0
  37. package/package.json +4 -4
package/README.md CHANGED
@@ -533,6 +533,14 @@ DetectTargetedSentiment
533
533
 
534
534
  [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-comprehend/classes/detecttargetedsentimentcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-comprehend/interfaces/detecttargetedsentimentcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-comprehend/interfaces/detecttargetedsentimentcommandoutput.html)
535
535
 
536
+ </details>
537
+ <details>
538
+ <summary>
539
+ DetectToxicContent
540
+ </summary>
541
+
542
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-comprehend/classes/detecttoxiccontentcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-comprehend/interfaces/detecttoxiccontentcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-comprehend/interfaces/detecttoxiccontentcommandoutput.html)
543
+
536
544
  </details>
537
545
  <details>
538
546
  <summary>
@@ -43,6 +43,7 @@ const DetectPiiEntitiesCommand_1 = require("./commands/DetectPiiEntitiesCommand"
43
43
  const DetectSentimentCommand_1 = require("./commands/DetectSentimentCommand");
44
44
  const DetectSyntaxCommand_1 = require("./commands/DetectSyntaxCommand");
45
45
  const DetectTargetedSentimentCommand_1 = require("./commands/DetectTargetedSentimentCommand");
46
+ const DetectToxicContentCommand_1 = require("./commands/DetectToxicContentCommand");
46
47
  const ImportModelCommand_1 = require("./commands/ImportModelCommand");
47
48
  const ListDatasetsCommand_1 = require("./commands/ListDatasetsCommand");
48
49
  const ListDocumentClassificationJobsCommand_1 = require("./commands/ListDocumentClassificationJobsCommand");
@@ -129,6 +130,7 @@ const commands = {
129
130
  DetectSentimentCommand: DetectSentimentCommand_1.DetectSentimentCommand,
130
131
  DetectSyntaxCommand: DetectSyntaxCommand_1.DetectSyntaxCommand,
131
132
  DetectTargetedSentimentCommand: DetectTargetedSentimentCommand_1.DetectTargetedSentimentCommand,
133
+ DetectToxicContentCommand: DetectToxicContentCommand_1.DetectToxicContentCommand,
132
134
  ImportModelCommand: ImportModelCommand_1.ImportModelCommand,
133
135
  ListDatasetsCommand: ListDatasetsCommand_1.ListDatasetsCommand,
134
136
  ListDocumentClassificationJobsCommand: ListDocumentClassificationJobsCommand_1.ListDocumentClassificationJobsCommand,
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DetectToxicContentCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const models_0_1 = require("../models/models_0");
10
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
11
+ class DetectToxicContentCommand extends smithy_client_1.Command {
12
+ static getEndpointParameterInstructions() {
13
+ return {
14
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
15
+ Endpoint: { type: "builtInParams", name: "endpoint" },
16
+ Region: { type: "builtInParams", name: "region" },
17
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
18
+ };
19
+ }
20
+ constructor(input) {
21
+ super();
22
+ this.input = input;
23
+ }
24
+ resolveMiddleware(clientStack, configuration, options) {
25
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
26
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, DetectToxicContentCommand.getEndpointParameterInstructions()));
27
+ const stack = clientStack.concat(this.middlewareStack);
28
+ const { logger } = configuration;
29
+ const clientName = "ComprehendClient";
30
+ const commandName = "DetectToxicContentCommand";
31
+ const handlerExecutionContext = {
32
+ logger,
33
+ clientName,
34
+ commandName,
35
+ inputFilterSensitiveLog: models_0_1.DetectToxicContentRequestFilterSensitiveLog,
36
+ outputFilterSensitiveLog: (_) => _,
37
+ [types_1.SMITHY_CONTEXT_KEY]: {
38
+ service: "Comprehend_20171127",
39
+ operation: "DetectToxicContent",
40
+ },
41
+ };
42
+ const { requestHandler } = configuration;
43
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
44
+ }
45
+ serialize(input, context) {
46
+ return (0, Aws_json1_1_1.se_DetectToxicContentCommand)(input, context);
47
+ }
48
+ deserialize(output, context) {
49
+ return (0, Aws_json1_1_1.de_DetectToxicContentCommand)(output, context);
50
+ }
51
+ }
52
+ exports.DetectToxicContentCommand = DetectToxicContentCommand;
@@ -42,6 +42,7 @@ tslib_1.__exportStar(require("./DetectPiiEntitiesCommand"), exports);
42
42
  tslib_1.__exportStar(require("./DetectSentimentCommand"), exports);
43
43
  tslib_1.__exportStar(require("./DetectSyntaxCommand"), exports);
44
44
  tslib_1.__exportStar(require("./DetectTargetedSentimentCommand"), exports);
45
+ tslib_1.__exportStar(require("./DetectToxicContentCommand"), exports);
45
46
  tslib_1.__exportStar(require("./ImportModelCommand"), exports);
46
47
  tslib_1.__exportStar(require("./ListDatasetsCommand"), exports);
47
48
  tslib_1.__exportStar(require("./ListDocumentClassificationJobsCommand"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BatchDetectDominantLanguageRequestFilterSensitiveLog = exports.InvalidFilterException = exports.PiiEntitiesDetectionMaskMode = exports.PiiEntitiesDetectionMode = exports.FlywheelIterationStatus = exports.FlywheelStatus = exports.EndpointStatus = exports.ModelStatus = exports.JobNotFoundException = exports.JobStatus = exports.DatasetStatus = exports.ModelType = exports.EntityRecognizerDataFormat = exports.KmsKeyValidationException = exports.DocumentClassifierMode = exports.DocumentClassifierDocumentTypeFormat = exports.DocumentClassifierDataFormat = exports.TooManyTagsException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.ResourceLimitExceededException = exports.ResourceInUseException = exports.InputFormat = exports.DatasetDataFormat = exports.DatasetType = exports.PiiEntityType = exports.ResourceUnavailableException = exports.PageBasedWarningCode = exports.PageBasedErrorCode = exports.DocumentType = exports.DocumentReadFeatureTypes = exports.DocumentReadMode = exports.DocumentReadAction = exports.RelationshipType = exports.BlockType = exports.TargetedSentimentEntityType = exports.PartOfSpeechTagType = exports.SyntaxLanguageCode = exports.SentimentType = exports.UnsupportedLanguageException = exports.EntityType = exports.LanguageCode = exports.TextSizeLimitExceededException = exports.InvalidRequestException = exports.InvalidRequestReason = exports.InvalidRequestDetailReason = exports.InternalServerException = exports.BatchSizeLimitExceededException = exports.Split = exports.AugmentedManifestsDocumentTypeFormat = void 0;
4
- exports.ListEntityRecognizersResponseFilterSensitiveLog = exports.ListDocumentClassifiersResponseFilterSensitiveLog = exports.DetectTargetedSentimentResponseFilterSensitiveLog = exports.DetectTargetedSentimentRequestFilterSensitiveLog = exports.DetectSyntaxResponseFilterSensitiveLog = exports.DetectSyntaxRequestFilterSensitiveLog = exports.DetectSentimentResponseFilterSensitiveLog = exports.DetectSentimentRequestFilterSensitiveLog = exports.DetectKeyPhrasesResponseFilterSensitiveLog = exports.DetectKeyPhrasesRequestFilterSensitiveLog = exports.DetectEntitiesResponseFilterSensitiveLog = exports.DetectEntitiesRequestFilterSensitiveLog = exports.DetectDominantLanguageResponseFilterSensitiveLog = exports.DetectDominantLanguageRequestFilterSensitiveLog = exports.DescribeEntityRecognizerResponseFilterSensitiveLog = exports.EntityRecognizerPropertiesFilterSensitiveLog = exports.EntityRecognizerMetadataFilterSensitiveLog = exports.DescribeDocumentClassifierResponseFilterSensitiveLog = exports.DocumentClassifierPropertiesFilterSensitiveLog = exports.ClassifyDocumentResponseFilterSensitiveLog = exports.ClassifyDocumentRequestFilterSensitiveLog = exports.ClassifierMetadataFilterSensitiveLog = exports.BatchDetectTargetedSentimentResponseFilterSensitiveLog = exports.BatchDetectTargetedSentimentRequestFilterSensitiveLog = exports.BatchDetectSyntaxResponseFilterSensitiveLog = exports.BatchDetectSyntaxRequestFilterSensitiveLog = exports.BatchDetectSentimentResponseFilterSensitiveLog = exports.BatchDetectSentimentRequestFilterSensitiveLog = exports.BatchDetectKeyPhrasesResponseFilterSensitiveLog = exports.BatchDetectKeyPhrasesRequestFilterSensitiveLog = exports.BatchDetectEntitiesResponseFilterSensitiveLog = exports.BatchDetectEntitiesRequestFilterSensitiveLog = exports.BatchDetectDominantLanguageResponseFilterSensitiveLog = void 0;
3
+ exports.InvalidFilterException = exports.ToxicContentType = exports.PiiEntitiesDetectionMaskMode = exports.PiiEntitiesDetectionMode = exports.FlywheelIterationStatus = exports.FlywheelStatus = exports.EndpointStatus = exports.ModelStatus = exports.JobNotFoundException = exports.JobStatus = exports.DatasetStatus = exports.ModelType = exports.EntityRecognizerDataFormat = exports.KmsKeyValidationException = exports.DocumentClassifierMode = exports.DocumentClassifierDocumentTypeFormat = exports.DocumentClassifierDataFormat = exports.TooManyTagsException = exports.TooManyRequestsException = exports.ResourceNotFoundException = exports.ResourceLimitExceededException = exports.ResourceInUseException = exports.InputFormat = exports.DatasetDataFormat = exports.DatasetType = exports.PiiEntityType = exports.ResourceUnavailableException = exports.PageBasedWarningCode = exports.PageBasedErrorCode = exports.DocumentType = exports.DocumentReadFeatureTypes = exports.DocumentReadMode = exports.DocumentReadAction = exports.RelationshipType = exports.BlockType = exports.TargetedSentimentEntityType = exports.PartOfSpeechTagType = exports.SyntaxLanguageCode = exports.SentimentType = exports.UnsupportedLanguageException = exports.EntityType = exports.LanguageCode = exports.TextSizeLimitExceededException = exports.InvalidRequestException = exports.InvalidRequestReason = exports.InvalidRequestDetailReason = exports.InternalServerException = exports.BatchSizeLimitExceededException = exports.Split = exports.AugmentedManifestsDocumentTypeFormat = void 0;
4
+ exports.ListEntityRecognizersResponseFilterSensitiveLog = exports.ListDocumentClassifiersResponseFilterSensitiveLog = exports.DetectToxicContentRequestFilterSensitiveLog = exports.TextSegmentFilterSensitiveLog = exports.DetectTargetedSentimentResponseFilterSensitiveLog = exports.DetectTargetedSentimentRequestFilterSensitiveLog = exports.DetectSyntaxResponseFilterSensitiveLog = exports.DetectSyntaxRequestFilterSensitiveLog = exports.DetectSentimentResponseFilterSensitiveLog = exports.DetectSentimentRequestFilterSensitiveLog = exports.DetectKeyPhrasesResponseFilterSensitiveLog = exports.DetectKeyPhrasesRequestFilterSensitiveLog = exports.DetectEntitiesResponseFilterSensitiveLog = exports.DetectEntitiesRequestFilterSensitiveLog = exports.DetectDominantLanguageResponseFilterSensitiveLog = exports.DetectDominantLanguageRequestFilterSensitiveLog = exports.DescribeEntityRecognizerResponseFilterSensitiveLog = exports.EntityRecognizerPropertiesFilterSensitiveLog = exports.EntityRecognizerMetadataFilterSensitiveLog = exports.DescribeDocumentClassifierResponseFilterSensitiveLog = exports.DocumentClassifierPropertiesFilterSensitiveLog = exports.ClassifyDocumentResponseFilterSensitiveLog = exports.ClassifyDocumentRequestFilterSensitiveLog = exports.ClassifierMetadataFilterSensitiveLog = exports.BatchDetectTargetedSentimentResponseFilterSensitiveLog = exports.BatchDetectTargetedSentimentRequestFilterSensitiveLog = exports.BatchDetectSyntaxResponseFilterSensitiveLog = exports.BatchDetectSyntaxRequestFilterSensitiveLog = exports.BatchDetectSentimentResponseFilterSensitiveLog = exports.BatchDetectSentimentRequestFilterSensitiveLog = exports.BatchDetectKeyPhrasesResponseFilterSensitiveLog = exports.BatchDetectKeyPhrasesRequestFilterSensitiveLog = exports.BatchDetectEntitiesResponseFilterSensitiveLog = exports.BatchDetectEntitiesRequestFilterSensitiveLog = exports.BatchDetectDominantLanguageResponseFilterSensitiveLog = exports.BatchDetectDominantLanguageRequestFilterSensitiveLog = void 0;
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const ComprehendServiceException_1 = require("./ComprehendServiceException");
7
7
  exports.AugmentedManifestsDocumentTypeFormat = {
@@ -446,6 +446,15 @@ exports.PiiEntitiesDetectionMaskMode = {
446
446
  MASK: "MASK",
447
447
  REPLACE_WITH_PII_ENTITY_TYPE: "REPLACE_WITH_PII_ENTITY_TYPE",
448
448
  };
449
+ exports.ToxicContentType = {
450
+ GRAPHIC: "GRAPHIC",
451
+ HARASSMENT_OR_ABUSE: "HARASSMENT_OR_ABUSE",
452
+ HATE_SPEECH: "HATE_SPEECH",
453
+ INSULT: "INSULT",
454
+ PROFANITY: "PROFANITY",
455
+ SEXUAL: "SEXUAL",
456
+ VIOLENCE_OR_THREAT: "VIOLENCE_OR_THREAT",
457
+ };
449
458
  class InvalidFilterException extends ComprehendServiceException_1.ComprehendServiceException {
450
459
  constructor(opts) {
451
460
  super({
@@ -609,6 +618,16 @@ const DetectTargetedSentimentResponseFilterSensitiveLog = (obj) => ({
609
618
  ...obj,
610
619
  });
611
620
  exports.DetectTargetedSentimentResponseFilterSensitiveLog = DetectTargetedSentimentResponseFilterSensitiveLog;
621
+ const TextSegmentFilterSensitiveLog = (obj) => ({
622
+ ...obj,
623
+ ...(obj.Text && { Text: smithy_client_1.SENSITIVE_STRING }),
624
+ });
625
+ exports.TextSegmentFilterSensitiveLog = TextSegmentFilterSensitiveLog;
626
+ const DetectToxicContentRequestFilterSensitiveLog = (obj) => ({
627
+ ...obj,
628
+ ...(obj.TextSegments && { TextSegments: smithy_client_1.SENSITIVE_STRING }),
629
+ });
630
+ exports.DetectToxicContentRequestFilterSensitiveLog = DetectToxicContentRequestFilterSensitiveLog;
612
631
  const ListDocumentClassifiersResponseFilterSensitiveLog = (obj) => ({
613
632
  ...obj,
614
633
  ...(obj.DocumentClassifierPropertiesList && {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.se_ListEntityRecognizersCommand = exports.se_ListEntitiesDetectionJobsCommand = exports.se_ListEndpointsCommand = exports.se_ListDominantLanguageDetectionJobsCommand = exports.se_ListDocumentClassifierSummariesCommand = exports.se_ListDocumentClassifiersCommand = exports.se_ListDocumentClassificationJobsCommand = exports.se_ListDatasetsCommand = exports.se_ImportModelCommand = exports.se_DetectTargetedSentimentCommand = exports.se_DetectSyntaxCommand = exports.se_DetectSentimentCommand = exports.se_DetectPiiEntitiesCommand = exports.se_DetectKeyPhrasesCommand = exports.se_DetectEntitiesCommand = exports.se_DetectDominantLanguageCommand = exports.se_DescribeTopicsDetectionJobCommand = exports.se_DescribeTargetedSentimentDetectionJobCommand = exports.se_DescribeSentimentDetectionJobCommand = exports.se_DescribeResourcePolicyCommand = exports.se_DescribePiiEntitiesDetectionJobCommand = exports.se_DescribeKeyPhrasesDetectionJobCommand = exports.se_DescribeFlywheelIterationCommand = exports.se_DescribeFlywheelCommand = exports.se_DescribeEventsDetectionJobCommand = exports.se_DescribeEntityRecognizerCommand = exports.se_DescribeEntitiesDetectionJobCommand = exports.se_DescribeEndpointCommand = exports.se_DescribeDominantLanguageDetectionJobCommand = exports.se_DescribeDocumentClassifierCommand = exports.se_DescribeDocumentClassificationJobCommand = exports.se_DescribeDatasetCommand = exports.se_DeleteResourcePolicyCommand = exports.se_DeleteFlywheelCommand = exports.se_DeleteEntityRecognizerCommand = exports.se_DeleteEndpointCommand = exports.se_DeleteDocumentClassifierCommand = exports.se_CreateFlywheelCommand = exports.se_CreateEntityRecognizerCommand = exports.se_CreateEndpointCommand = exports.se_CreateDocumentClassifierCommand = exports.se_CreateDatasetCommand = exports.se_ContainsPiiEntitiesCommand = exports.se_ClassifyDocumentCommand = exports.se_BatchDetectTargetedSentimentCommand = exports.se_BatchDetectSyntaxCommand = exports.se_BatchDetectSentimentCommand = exports.se_BatchDetectKeyPhrasesCommand = exports.se_BatchDetectEntitiesCommand = exports.se_BatchDetectDominantLanguageCommand = void 0;
4
- exports.de_DeleteEntityRecognizerCommand = exports.de_DeleteEndpointCommand = exports.de_DeleteDocumentClassifierCommand = exports.de_CreateFlywheelCommand = exports.de_CreateEntityRecognizerCommand = exports.de_CreateEndpointCommand = exports.de_CreateDocumentClassifierCommand = exports.de_CreateDatasetCommand = exports.de_ContainsPiiEntitiesCommand = exports.de_ClassifyDocumentCommand = exports.de_BatchDetectTargetedSentimentCommand = exports.de_BatchDetectSyntaxCommand = exports.de_BatchDetectSentimentCommand = exports.de_BatchDetectKeyPhrasesCommand = exports.de_BatchDetectEntitiesCommand = exports.de_BatchDetectDominantLanguageCommand = exports.se_UpdateFlywheelCommand = exports.se_UpdateEndpointCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StopTrainingEntityRecognizerCommand = exports.se_StopTrainingDocumentClassifierCommand = exports.se_StopTargetedSentimentDetectionJobCommand = exports.se_StopSentimentDetectionJobCommand = exports.se_StopPiiEntitiesDetectionJobCommand = exports.se_StopKeyPhrasesDetectionJobCommand = exports.se_StopEventsDetectionJobCommand = exports.se_StopEntitiesDetectionJobCommand = exports.se_StopDominantLanguageDetectionJobCommand = exports.se_StartTopicsDetectionJobCommand = exports.se_StartTargetedSentimentDetectionJobCommand = exports.se_StartSentimentDetectionJobCommand = exports.se_StartPiiEntitiesDetectionJobCommand = exports.se_StartKeyPhrasesDetectionJobCommand = exports.se_StartFlywheelIterationCommand = exports.se_StartEventsDetectionJobCommand = exports.se_StartEntitiesDetectionJobCommand = exports.se_StartDominantLanguageDetectionJobCommand = exports.se_StartDocumentClassificationJobCommand = exports.se_PutResourcePolicyCommand = exports.se_ListTopicsDetectionJobsCommand = exports.se_ListTargetedSentimentDetectionJobsCommand = exports.se_ListTagsForResourceCommand = exports.se_ListSentimentDetectionJobsCommand = exports.se_ListPiiEntitiesDetectionJobsCommand = exports.se_ListKeyPhrasesDetectionJobsCommand = exports.se_ListFlywheelsCommand = exports.se_ListFlywheelIterationHistoryCommand = exports.se_ListEventsDetectionJobsCommand = exports.se_ListEntityRecognizerSummariesCommand = void 0;
5
- exports.de_StartFlywheelIterationCommand = exports.de_StartEventsDetectionJobCommand = exports.de_StartEntitiesDetectionJobCommand = exports.de_StartDominantLanguageDetectionJobCommand = exports.de_StartDocumentClassificationJobCommand = exports.de_PutResourcePolicyCommand = exports.de_ListTopicsDetectionJobsCommand = exports.de_ListTargetedSentimentDetectionJobsCommand = exports.de_ListTagsForResourceCommand = exports.de_ListSentimentDetectionJobsCommand = exports.de_ListPiiEntitiesDetectionJobsCommand = exports.de_ListKeyPhrasesDetectionJobsCommand = exports.de_ListFlywheelsCommand = exports.de_ListFlywheelIterationHistoryCommand = exports.de_ListEventsDetectionJobsCommand = exports.de_ListEntityRecognizerSummariesCommand = exports.de_ListEntityRecognizersCommand = exports.de_ListEntitiesDetectionJobsCommand = exports.de_ListEndpointsCommand = exports.de_ListDominantLanguageDetectionJobsCommand = exports.de_ListDocumentClassifierSummariesCommand = exports.de_ListDocumentClassifiersCommand = exports.de_ListDocumentClassificationJobsCommand = exports.de_ListDatasetsCommand = exports.de_ImportModelCommand = exports.de_DetectTargetedSentimentCommand = exports.de_DetectSyntaxCommand = exports.de_DetectSentimentCommand = exports.de_DetectPiiEntitiesCommand = exports.de_DetectKeyPhrasesCommand = exports.de_DetectEntitiesCommand = exports.de_DetectDominantLanguageCommand = exports.de_DescribeTopicsDetectionJobCommand = exports.de_DescribeTargetedSentimentDetectionJobCommand = exports.de_DescribeSentimentDetectionJobCommand = exports.de_DescribeResourcePolicyCommand = exports.de_DescribePiiEntitiesDetectionJobCommand = exports.de_DescribeKeyPhrasesDetectionJobCommand = exports.de_DescribeFlywheelIterationCommand = exports.de_DescribeFlywheelCommand = exports.de_DescribeEventsDetectionJobCommand = exports.de_DescribeEntityRecognizerCommand = exports.de_DescribeEntitiesDetectionJobCommand = exports.de_DescribeEndpointCommand = exports.de_DescribeDominantLanguageDetectionJobCommand = exports.de_DescribeDocumentClassifierCommand = exports.de_DescribeDocumentClassificationJobCommand = exports.de_DescribeDatasetCommand = exports.de_DeleteResourcePolicyCommand = exports.de_DeleteFlywheelCommand = void 0;
6
- exports.de_UpdateFlywheelCommand = exports.de_UpdateEndpointCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StopTrainingEntityRecognizerCommand = exports.de_StopTrainingDocumentClassifierCommand = exports.de_StopTargetedSentimentDetectionJobCommand = exports.de_StopSentimentDetectionJobCommand = exports.de_StopPiiEntitiesDetectionJobCommand = exports.de_StopKeyPhrasesDetectionJobCommand = exports.de_StopEventsDetectionJobCommand = exports.de_StopEntitiesDetectionJobCommand = exports.de_StopDominantLanguageDetectionJobCommand = exports.de_StartTopicsDetectionJobCommand = exports.de_StartTargetedSentimentDetectionJobCommand = exports.de_StartSentimentDetectionJobCommand = exports.de_StartPiiEntitiesDetectionJobCommand = exports.de_StartKeyPhrasesDetectionJobCommand = void 0;
3
+ exports.se_ListEntitiesDetectionJobsCommand = exports.se_ListEndpointsCommand = exports.se_ListDominantLanguageDetectionJobsCommand = exports.se_ListDocumentClassifierSummariesCommand = exports.se_ListDocumentClassifiersCommand = exports.se_ListDocumentClassificationJobsCommand = exports.se_ListDatasetsCommand = exports.se_ImportModelCommand = exports.se_DetectToxicContentCommand = exports.se_DetectTargetedSentimentCommand = exports.se_DetectSyntaxCommand = exports.se_DetectSentimentCommand = exports.se_DetectPiiEntitiesCommand = exports.se_DetectKeyPhrasesCommand = exports.se_DetectEntitiesCommand = exports.se_DetectDominantLanguageCommand = exports.se_DescribeTopicsDetectionJobCommand = exports.se_DescribeTargetedSentimentDetectionJobCommand = exports.se_DescribeSentimentDetectionJobCommand = exports.se_DescribeResourcePolicyCommand = exports.se_DescribePiiEntitiesDetectionJobCommand = exports.se_DescribeKeyPhrasesDetectionJobCommand = exports.se_DescribeFlywheelIterationCommand = exports.se_DescribeFlywheelCommand = exports.se_DescribeEventsDetectionJobCommand = exports.se_DescribeEntityRecognizerCommand = exports.se_DescribeEntitiesDetectionJobCommand = exports.se_DescribeEndpointCommand = exports.se_DescribeDominantLanguageDetectionJobCommand = exports.se_DescribeDocumentClassifierCommand = exports.se_DescribeDocumentClassificationJobCommand = exports.se_DescribeDatasetCommand = exports.se_DeleteResourcePolicyCommand = exports.se_DeleteFlywheelCommand = exports.se_DeleteEntityRecognizerCommand = exports.se_DeleteEndpointCommand = exports.se_DeleteDocumentClassifierCommand = exports.se_CreateFlywheelCommand = exports.se_CreateEntityRecognizerCommand = exports.se_CreateEndpointCommand = exports.se_CreateDocumentClassifierCommand = exports.se_CreateDatasetCommand = exports.se_ContainsPiiEntitiesCommand = exports.se_ClassifyDocumentCommand = exports.se_BatchDetectTargetedSentimentCommand = exports.se_BatchDetectSyntaxCommand = exports.se_BatchDetectSentimentCommand = exports.se_BatchDetectKeyPhrasesCommand = exports.se_BatchDetectEntitiesCommand = exports.se_BatchDetectDominantLanguageCommand = void 0;
4
+ exports.de_DeleteEndpointCommand = exports.de_DeleteDocumentClassifierCommand = exports.de_CreateFlywheelCommand = exports.de_CreateEntityRecognizerCommand = exports.de_CreateEndpointCommand = exports.de_CreateDocumentClassifierCommand = exports.de_CreateDatasetCommand = exports.de_ContainsPiiEntitiesCommand = exports.de_ClassifyDocumentCommand = exports.de_BatchDetectTargetedSentimentCommand = exports.de_BatchDetectSyntaxCommand = exports.de_BatchDetectSentimentCommand = exports.de_BatchDetectKeyPhrasesCommand = exports.de_BatchDetectEntitiesCommand = exports.de_BatchDetectDominantLanguageCommand = exports.se_UpdateFlywheelCommand = exports.se_UpdateEndpointCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StopTrainingEntityRecognizerCommand = exports.se_StopTrainingDocumentClassifierCommand = exports.se_StopTargetedSentimentDetectionJobCommand = exports.se_StopSentimentDetectionJobCommand = exports.se_StopPiiEntitiesDetectionJobCommand = exports.se_StopKeyPhrasesDetectionJobCommand = exports.se_StopEventsDetectionJobCommand = exports.se_StopEntitiesDetectionJobCommand = exports.se_StopDominantLanguageDetectionJobCommand = exports.se_StartTopicsDetectionJobCommand = exports.se_StartTargetedSentimentDetectionJobCommand = exports.se_StartSentimentDetectionJobCommand = exports.se_StartPiiEntitiesDetectionJobCommand = exports.se_StartKeyPhrasesDetectionJobCommand = exports.se_StartFlywheelIterationCommand = exports.se_StartEventsDetectionJobCommand = exports.se_StartEntitiesDetectionJobCommand = exports.se_StartDominantLanguageDetectionJobCommand = exports.se_StartDocumentClassificationJobCommand = exports.se_PutResourcePolicyCommand = exports.se_ListTopicsDetectionJobsCommand = exports.se_ListTargetedSentimentDetectionJobsCommand = exports.se_ListTagsForResourceCommand = exports.se_ListSentimentDetectionJobsCommand = exports.se_ListPiiEntitiesDetectionJobsCommand = exports.se_ListKeyPhrasesDetectionJobsCommand = exports.se_ListFlywheelsCommand = exports.se_ListFlywheelIterationHistoryCommand = exports.se_ListEventsDetectionJobsCommand = exports.se_ListEntityRecognizerSummariesCommand = exports.se_ListEntityRecognizersCommand = void 0;
5
+ exports.de_StartEntitiesDetectionJobCommand = exports.de_StartDominantLanguageDetectionJobCommand = exports.de_StartDocumentClassificationJobCommand = exports.de_PutResourcePolicyCommand = exports.de_ListTopicsDetectionJobsCommand = exports.de_ListTargetedSentimentDetectionJobsCommand = exports.de_ListTagsForResourceCommand = exports.de_ListSentimentDetectionJobsCommand = exports.de_ListPiiEntitiesDetectionJobsCommand = exports.de_ListKeyPhrasesDetectionJobsCommand = exports.de_ListFlywheelsCommand = exports.de_ListFlywheelIterationHistoryCommand = exports.de_ListEventsDetectionJobsCommand = exports.de_ListEntityRecognizerSummariesCommand = exports.de_ListEntityRecognizersCommand = exports.de_ListEntitiesDetectionJobsCommand = exports.de_ListEndpointsCommand = exports.de_ListDominantLanguageDetectionJobsCommand = exports.de_ListDocumentClassifierSummariesCommand = exports.de_ListDocumentClassifiersCommand = exports.de_ListDocumentClassificationJobsCommand = exports.de_ListDatasetsCommand = exports.de_ImportModelCommand = exports.de_DetectToxicContentCommand = exports.de_DetectTargetedSentimentCommand = exports.de_DetectSyntaxCommand = exports.de_DetectSentimentCommand = exports.de_DetectPiiEntitiesCommand = exports.de_DetectKeyPhrasesCommand = exports.de_DetectEntitiesCommand = exports.de_DetectDominantLanguageCommand = exports.de_DescribeTopicsDetectionJobCommand = exports.de_DescribeTargetedSentimentDetectionJobCommand = exports.de_DescribeSentimentDetectionJobCommand = exports.de_DescribeResourcePolicyCommand = exports.de_DescribePiiEntitiesDetectionJobCommand = exports.de_DescribeKeyPhrasesDetectionJobCommand = exports.de_DescribeFlywheelIterationCommand = exports.de_DescribeFlywheelCommand = exports.de_DescribeEventsDetectionJobCommand = exports.de_DescribeEntityRecognizerCommand = exports.de_DescribeEntitiesDetectionJobCommand = exports.de_DescribeEndpointCommand = exports.de_DescribeDominantLanguageDetectionJobCommand = exports.de_DescribeDocumentClassifierCommand = exports.de_DescribeDocumentClassificationJobCommand = exports.de_DescribeDatasetCommand = exports.de_DeleteResourcePolicyCommand = exports.de_DeleteFlywheelCommand = exports.de_DeleteEntityRecognizerCommand = void 0;
6
+ exports.de_UpdateFlywheelCommand = exports.de_UpdateEndpointCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StopTrainingEntityRecognizerCommand = exports.de_StopTrainingDocumentClassifierCommand = exports.de_StopTargetedSentimentDetectionJobCommand = exports.de_StopSentimentDetectionJobCommand = exports.de_StopPiiEntitiesDetectionJobCommand = exports.de_StopKeyPhrasesDetectionJobCommand = exports.de_StopEventsDetectionJobCommand = exports.de_StopEntitiesDetectionJobCommand = exports.de_StopDominantLanguageDetectionJobCommand = exports.de_StartTopicsDetectionJobCommand = exports.de_StartTargetedSentimentDetectionJobCommand = exports.de_StartSentimentDetectionJobCommand = exports.de_StartPiiEntitiesDetectionJobCommand = exports.de_StartKeyPhrasesDetectionJobCommand = exports.de_StartFlywheelIterationCommand = exports.de_StartEventsDetectionJobCommand = void 0;
7
7
  const protocol_http_1 = require("@smithy/protocol-http");
8
8
  const smithy_client_1 = require("@smithy/smithy-client");
9
9
  const uuid_1 = require("uuid");
@@ -297,6 +297,13 @@ const se_DetectTargetedSentimentCommand = async (input, context) => {
297
297
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
298
298
  };
299
299
  exports.se_DetectTargetedSentimentCommand = se_DetectTargetedSentimentCommand;
300
+ const se_DetectToxicContentCommand = async (input, context) => {
301
+ const headers = sharedHeaders("DetectToxicContent");
302
+ let body;
303
+ body = JSON.stringify((0, smithy_client_1._json)(input));
304
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
305
+ };
306
+ exports.se_DetectToxicContentCommand = se_DetectToxicContentCommand;
300
307
  const se_ImportModelCommand = async (input, context) => {
301
308
  const headers = sharedHeaders("ImportModel");
302
309
  let body;
@@ -2413,6 +2420,48 @@ const de_DetectTargetedSentimentCommandError = async (output, context) => {
2413
2420
  });
2414
2421
  }
2415
2422
  };
2423
+ const de_DetectToxicContentCommand = async (output, context) => {
2424
+ if (output.statusCode >= 300) {
2425
+ return de_DetectToxicContentCommandError(output, context);
2426
+ }
2427
+ const data = await parseBody(output.body, context);
2428
+ let contents = {};
2429
+ contents = de_DetectToxicContentResponse(data, context);
2430
+ const response = {
2431
+ $metadata: deserializeMetadata(output),
2432
+ ...contents,
2433
+ };
2434
+ return response;
2435
+ };
2436
+ exports.de_DetectToxicContentCommand = de_DetectToxicContentCommand;
2437
+ const de_DetectToxicContentCommandError = async (output, context) => {
2438
+ const parsedOutput = {
2439
+ ...output,
2440
+ body: await parseErrorBody(output.body, context),
2441
+ };
2442
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2443
+ switch (errorCode) {
2444
+ case "InternalServerException":
2445
+ case "com.amazonaws.comprehend#InternalServerException":
2446
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
2447
+ case "InvalidRequestException":
2448
+ case "com.amazonaws.comprehend#InvalidRequestException":
2449
+ throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2450
+ case "TextSizeLimitExceededException":
2451
+ case "com.amazonaws.comprehend#TextSizeLimitExceededException":
2452
+ throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context);
2453
+ case "UnsupportedLanguageException":
2454
+ case "com.amazonaws.comprehend#UnsupportedLanguageException":
2455
+ throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context);
2456
+ default:
2457
+ const parsedBody = parsedOutput.body;
2458
+ return throwDefaultError({
2459
+ output,
2460
+ parsedBody,
2461
+ errorCode,
2462
+ });
2463
+ }
2464
+ };
2416
2465
  const de_ImportModelCommand = async (output, context) => {
2417
2466
  if (output.statusCode >= 300) {
2418
2467
  return de_ImportModelCommandError(output, context);
@@ -5132,6 +5181,11 @@ const de_DetectTargetedSentimentResponse = (output, context) => {
5132
5181
  Entities: (_) => de_ListOfTargetedSentimentEntities(_, context),
5133
5182
  });
5134
5183
  };
5184
+ const de_DetectToxicContentResponse = (output, context) => {
5185
+ return (0, smithy_client_1.take)(output, {
5186
+ ResultList: (_) => de_ListOfToxicLabels(_, context),
5187
+ });
5188
+ };
5135
5189
  const de_DocumentClass = (output, context) => {
5136
5190
  return (0, smithy_client_1.take)(output, {
5137
5191
  Name: smithy_client_1.expectString,
@@ -5746,6 +5800,22 @@ const de_ListOfTargetedSentimentEntities = (output, context) => {
5746
5800
  });
5747
5801
  return retVal;
5748
5802
  };
5803
+ const de_ListOfToxicContent = (output, context) => {
5804
+ const retVal = (output || [])
5805
+ .filter((e) => e != null)
5806
+ .map((entry) => {
5807
+ return de_ToxicContent(entry, context);
5808
+ });
5809
+ return retVal;
5810
+ };
5811
+ const de_ListOfToxicLabels = (output, context) => {
5812
+ const retVal = (output || [])
5813
+ .filter((e) => e != null)
5814
+ .map((entry) => {
5815
+ return de_ToxicLabels(entry, context);
5816
+ });
5817
+ return retVal;
5818
+ };
5749
5819
  const de_ListPiiEntitiesDetectionJobsResponse = (output, context) => {
5750
5820
  return (0, smithy_client_1.take)(output, {
5751
5821
  NextToken: smithy_client_1.expectString,
@@ -5938,6 +6008,18 @@ const de_TopicsDetectionJobPropertiesList = (output, context) => {
5938
6008
  });
5939
6009
  return retVal;
5940
6010
  };
6011
+ const de_ToxicContent = (output, context) => {
6012
+ return (0, smithy_client_1.take)(output, {
6013
+ Name: smithy_client_1.expectString,
6014
+ Score: smithy_client_1.limitedParseFloat32,
6015
+ });
6016
+ };
6017
+ const de_ToxicLabels = (output, context) => {
6018
+ return (0, smithy_client_1.take)(output, {
6019
+ Labels: (_) => de_ListOfToxicContent(_, context),
6020
+ Toxicity: smithy_client_1.limitedParseFloat32,
6021
+ });
6022
+ };
5941
6023
  const de_UpdateFlywheelResponse = (output, context) => {
5942
6024
  return (0, smithy_client_1.take)(output, {
5943
6025
  FlywheelProperties: (_) => de_FlywheelProperties(_, context),
@@ -40,6 +40,7 @@ import { DetectPiiEntitiesCommand, } from "./commands/DetectPiiEntitiesCommand";
40
40
  import { DetectSentimentCommand, } from "./commands/DetectSentimentCommand";
41
41
  import { DetectSyntaxCommand, } from "./commands/DetectSyntaxCommand";
42
42
  import { DetectTargetedSentimentCommand, } from "./commands/DetectTargetedSentimentCommand";
43
+ import { DetectToxicContentCommand, } from "./commands/DetectToxicContentCommand";
43
44
  import { ImportModelCommand } from "./commands/ImportModelCommand";
44
45
  import { ListDatasetsCommand, } from "./commands/ListDatasetsCommand";
45
46
  import { ListDocumentClassificationJobsCommand, } from "./commands/ListDocumentClassificationJobsCommand";
@@ -126,6 +127,7 @@ const commands = {
126
127
  DetectSentimentCommand,
127
128
  DetectSyntaxCommand,
128
129
  DetectTargetedSentimentCommand,
130
+ DetectToxicContentCommand,
129
131
  ImportModelCommand,
130
132
  ListDatasetsCommand,
131
133
  ListDocumentClassificationJobsCommand,
@@ -0,0 +1,48 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { DetectToxicContentRequestFilterSensitiveLog, } from "../models/models_0";
6
+ import { de_DetectToxicContentCommand, se_DetectToxicContentCommand } from "../protocols/Aws_json1_1";
7
+ export { $Command };
8
+ export class DetectToxicContentCommand extends $Command {
9
+ static getEndpointParameterInstructions() {
10
+ return {
11
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
12
+ Endpoint: { type: "builtInParams", name: "endpoint" },
13
+ Region: { type: "builtInParams", name: "region" },
14
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
15
+ };
16
+ }
17
+ constructor(input) {
18
+ super();
19
+ this.input = input;
20
+ }
21
+ resolveMiddleware(clientStack, configuration, options) {
22
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
23
+ this.middlewareStack.use(getEndpointPlugin(configuration, DetectToxicContentCommand.getEndpointParameterInstructions()));
24
+ const stack = clientStack.concat(this.middlewareStack);
25
+ const { logger } = configuration;
26
+ const clientName = "ComprehendClient";
27
+ const commandName = "DetectToxicContentCommand";
28
+ const handlerExecutionContext = {
29
+ logger,
30
+ clientName,
31
+ commandName,
32
+ inputFilterSensitiveLog: DetectToxicContentRequestFilterSensitiveLog,
33
+ outputFilterSensitiveLog: (_) => _,
34
+ [SMITHY_CONTEXT_KEY]: {
35
+ service: "Comprehend_20171127",
36
+ operation: "DetectToxicContent",
37
+ },
38
+ };
39
+ const { requestHandler } = configuration;
40
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
41
+ }
42
+ serialize(input, context) {
43
+ return se_DetectToxicContentCommand(input, context);
44
+ }
45
+ deserialize(output, context) {
46
+ return de_DetectToxicContentCommand(output, context);
47
+ }
48
+ }
@@ -39,6 +39,7 @@ export * from "./DetectPiiEntitiesCommand";
39
39
  export * from "./DetectSentimentCommand";
40
40
  export * from "./DetectSyntaxCommand";
41
41
  export * from "./DetectTargetedSentimentCommand";
42
+ export * from "./DetectToxicContentCommand";
42
43
  export * from "./ImportModelCommand";
43
44
  export * from "./ListDatasetsCommand";
44
45
  export * from "./ListDocumentClassificationJobsCommand";
@@ -429,6 +429,15 @@ export const PiiEntitiesDetectionMaskMode = {
429
429
  MASK: "MASK",
430
430
  REPLACE_WITH_PII_ENTITY_TYPE: "REPLACE_WITH_PII_ENTITY_TYPE",
431
431
  };
432
+ export const ToxicContentType = {
433
+ GRAPHIC: "GRAPHIC",
434
+ HARASSMENT_OR_ABUSE: "HARASSMENT_OR_ABUSE",
435
+ HATE_SPEECH: "HATE_SPEECH",
436
+ INSULT: "INSULT",
437
+ PROFANITY: "PROFANITY",
438
+ SEXUAL: "SEXUAL",
439
+ VIOLENCE_OR_THREAT: "VIOLENCE_OR_THREAT",
440
+ };
432
441
  export class InvalidFilterException extends __BaseException {
433
442
  constructor(opts) {
434
443
  super({
@@ -559,6 +568,14 @@ export const DetectTargetedSentimentRequestFilterSensitiveLog = (obj) => ({
559
568
  export const DetectTargetedSentimentResponseFilterSensitiveLog = (obj) => ({
560
569
  ...obj,
561
570
  });
571
+ export const TextSegmentFilterSensitiveLog = (obj) => ({
572
+ ...obj,
573
+ ...(obj.Text && { Text: SENSITIVE_STRING }),
574
+ });
575
+ export const DetectToxicContentRequestFilterSensitiveLog = (obj) => ({
576
+ ...obj,
577
+ ...(obj.TextSegments && { TextSegments: SENSITIVE_STRING }),
578
+ });
562
579
  export const ListDocumentClassifiersResponseFilterSensitiveLog = (obj) => ({
563
580
  ...obj,
564
581
  ...(obj.DocumentClassifierPropertiesList && {
@@ -250,6 +250,12 @@ export const se_DetectTargetedSentimentCommand = async (input, context) => {
250
250
  body = JSON.stringify(_json(input));
251
251
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
252
252
  };
253
+ export const se_DetectToxicContentCommand = async (input, context) => {
254
+ const headers = sharedHeaders("DetectToxicContent");
255
+ let body;
256
+ body = JSON.stringify(_json(input));
257
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
258
+ };
253
259
  export const se_ImportModelCommand = async (input, context) => {
254
260
  const headers = sharedHeaders("ImportModel");
255
261
  let body;
@@ -2282,6 +2288,47 @@ const de_DetectTargetedSentimentCommandError = async (output, context) => {
2282
2288
  });
2283
2289
  }
2284
2290
  };
2291
+ export const de_DetectToxicContentCommand = async (output, context) => {
2292
+ if (output.statusCode >= 300) {
2293
+ return de_DetectToxicContentCommandError(output, context);
2294
+ }
2295
+ const data = await parseBody(output.body, context);
2296
+ let contents = {};
2297
+ contents = de_DetectToxicContentResponse(data, context);
2298
+ const response = {
2299
+ $metadata: deserializeMetadata(output),
2300
+ ...contents,
2301
+ };
2302
+ return response;
2303
+ };
2304
+ const de_DetectToxicContentCommandError = async (output, context) => {
2305
+ const parsedOutput = {
2306
+ ...output,
2307
+ body: await parseErrorBody(output.body, context),
2308
+ };
2309
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2310
+ switch (errorCode) {
2311
+ case "InternalServerException":
2312
+ case "com.amazonaws.comprehend#InternalServerException":
2313
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
2314
+ case "InvalidRequestException":
2315
+ case "com.amazonaws.comprehend#InvalidRequestException":
2316
+ throw await de_InvalidRequestExceptionRes(parsedOutput, context);
2317
+ case "TextSizeLimitExceededException":
2318
+ case "com.amazonaws.comprehend#TextSizeLimitExceededException":
2319
+ throw await de_TextSizeLimitExceededExceptionRes(parsedOutput, context);
2320
+ case "UnsupportedLanguageException":
2321
+ case "com.amazonaws.comprehend#UnsupportedLanguageException":
2322
+ throw await de_UnsupportedLanguageExceptionRes(parsedOutput, context);
2323
+ default:
2324
+ const parsedBody = parsedOutput.body;
2325
+ return throwDefaultError({
2326
+ output,
2327
+ parsedBody,
2328
+ errorCode,
2329
+ });
2330
+ }
2331
+ };
2285
2332
  export const de_ImportModelCommand = async (output, context) => {
2286
2333
  if (output.statusCode >= 300) {
2287
2334
  return de_ImportModelCommandError(output, context);
@@ -4958,6 +5005,11 @@ const de_DetectTargetedSentimentResponse = (output, context) => {
4958
5005
  Entities: (_) => de_ListOfTargetedSentimentEntities(_, context),
4959
5006
  });
4960
5007
  };
5008
+ const de_DetectToxicContentResponse = (output, context) => {
5009
+ return take(output, {
5010
+ ResultList: (_) => de_ListOfToxicLabels(_, context),
5011
+ });
5012
+ };
4961
5013
  const de_DocumentClass = (output, context) => {
4962
5014
  return take(output, {
4963
5015
  Name: __expectString,
@@ -5572,6 +5624,22 @@ const de_ListOfTargetedSentimentEntities = (output, context) => {
5572
5624
  });
5573
5625
  return retVal;
5574
5626
  };
5627
+ const de_ListOfToxicContent = (output, context) => {
5628
+ const retVal = (output || [])
5629
+ .filter((e) => e != null)
5630
+ .map((entry) => {
5631
+ return de_ToxicContent(entry, context);
5632
+ });
5633
+ return retVal;
5634
+ };
5635
+ const de_ListOfToxicLabels = (output, context) => {
5636
+ const retVal = (output || [])
5637
+ .filter((e) => e != null)
5638
+ .map((entry) => {
5639
+ return de_ToxicLabels(entry, context);
5640
+ });
5641
+ return retVal;
5642
+ };
5575
5643
  const de_ListPiiEntitiesDetectionJobsResponse = (output, context) => {
5576
5644
  return take(output, {
5577
5645
  NextToken: __expectString,
@@ -5764,6 +5832,18 @@ const de_TopicsDetectionJobPropertiesList = (output, context) => {
5764
5832
  });
5765
5833
  return retVal;
5766
5834
  };
5835
+ const de_ToxicContent = (output, context) => {
5836
+ return take(output, {
5837
+ Name: __expectString,
5838
+ Score: __limitedParseFloat32,
5839
+ });
5840
+ };
5841
+ const de_ToxicLabels = (output, context) => {
5842
+ return take(output, {
5843
+ Labels: (_) => de_ListOfToxicContent(_, context),
5844
+ Toxicity: __limitedParseFloat32,
5845
+ });
5846
+ };
5767
5847
  const de_UpdateFlywheelResponse = (output, context) => {
5768
5848
  return take(output, {
5769
5849
  FlywheelProperties: (_) => de_FlywheelProperties(_, context),
@@ -40,6 +40,7 @@ import { DetectPiiEntitiesCommandInput, DetectPiiEntitiesCommandOutput } from ".
40
40
  import { DetectSentimentCommandInput, DetectSentimentCommandOutput } from "./commands/DetectSentimentCommand";
41
41
  import { DetectSyntaxCommandInput, DetectSyntaxCommandOutput } from "./commands/DetectSyntaxCommand";
42
42
  import { DetectTargetedSentimentCommandInput, DetectTargetedSentimentCommandOutput } from "./commands/DetectTargetedSentimentCommand";
43
+ import { DetectToxicContentCommandInput, DetectToxicContentCommandOutput } from "./commands/DetectToxicContentCommand";
43
44
  import { ImportModelCommandInput, ImportModelCommandOutput } from "./commands/ImportModelCommand";
44
45
  import { ListDatasetsCommandInput, ListDatasetsCommandOutput } from "./commands/ListDatasetsCommand";
45
46
  import { ListDocumentClassificationJobsCommandInput, ListDocumentClassificationJobsCommandOutput } from "./commands/ListDocumentClassificationJobsCommand";
@@ -331,6 +332,12 @@ export interface Comprehend {
331
332
  detectTargetedSentiment(args: DetectTargetedSentimentCommandInput, options?: __HttpHandlerOptions): Promise<DetectTargetedSentimentCommandOutput>;
332
333
  detectTargetedSentiment(args: DetectTargetedSentimentCommandInput, cb: (err: any, data?: DetectTargetedSentimentCommandOutput) => void): void;
333
334
  detectTargetedSentiment(args: DetectTargetedSentimentCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DetectTargetedSentimentCommandOutput) => void): void;
335
+ /**
336
+ * @see {@link DetectToxicContentCommand}
337
+ */
338
+ detectToxicContent(args: DetectToxicContentCommandInput, options?: __HttpHandlerOptions): Promise<DetectToxicContentCommandOutput>;
339
+ detectToxicContent(args: DetectToxicContentCommandInput, cb: (err: any, data?: DetectToxicContentCommandOutput) => void): void;
340
+ detectToxicContent(args: DetectToxicContentCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DetectToxicContentCommandOutput) => void): void;
334
341
  /**
335
342
  * @see {@link ImportModelCommand}
336
343
  */
@@ -49,6 +49,7 @@ import { DetectPiiEntitiesCommandInput, DetectPiiEntitiesCommandOutput } from ".
49
49
  import { DetectSentimentCommandInput, DetectSentimentCommandOutput } from "./commands/DetectSentimentCommand";
50
50
  import { DetectSyntaxCommandInput, DetectSyntaxCommandOutput } from "./commands/DetectSyntaxCommand";
51
51
  import { DetectTargetedSentimentCommandInput, DetectTargetedSentimentCommandOutput } from "./commands/DetectTargetedSentimentCommand";
52
+ import { DetectToxicContentCommandInput, DetectToxicContentCommandOutput } from "./commands/DetectToxicContentCommand";
52
53
  import { ImportModelCommandInput, ImportModelCommandOutput } from "./commands/ImportModelCommand";
53
54
  import { ListDatasetsCommandInput, ListDatasetsCommandOutput } from "./commands/ListDatasetsCommand";
54
55
  import { ListDocumentClassificationJobsCommandInput, ListDocumentClassificationJobsCommandOutput } from "./commands/ListDocumentClassificationJobsCommand";
@@ -98,11 +99,11 @@ export { __Client };
98
99
  /**
99
100
  * @public
100
101
  */
101
- export type ServiceInputTypes = BatchDetectDominantLanguageCommandInput | BatchDetectEntitiesCommandInput | BatchDetectKeyPhrasesCommandInput | BatchDetectSentimentCommandInput | BatchDetectSyntaxCommandInput | BatchDetectTargetedSentimentCommandInput | ClassifyDocumentCommandInput | ContainsPiiEntitiesCommandInput | CreateDatasetCommandInput | CreateDocumentClassifierCommandInput | CreateEndpointCommandInput | CreateEntityRecognizerCommandInput | CreateFlywheelCommandInput | DeleteDocumentClassifierCommandInput | DeleteEndpointCommandInput | DeleteEntityRecognizerCommandInput | DeleteFlywheelCommandInput | DeleteResourcePolicyCommandInput | DescribeDatasetCommandInput | DescribeDocumentClassificationJobCommandInput | DescribeDocumentClassifierCommandInput | DescribeDominantLanguageDetectionJobCommandInput | DescribeEndpointCommandInput | DescribeEntitiesDetectionJobCommandInput | DescribeEntityRecognizerCommandInput | DescribeEventsDetectionJobCommandInput | DescribeFlywheelCommandInput | DescribeFlywheelIterationCommandInput | DescribeKeyPhrasesDetectionJobCommandInput | DescribePiiEntitiesDetectionJobCommandInput | DescribeResourcePolicyCommandInput | DescribeSentimentDetectionJobCommandInput | DescribeTargetedSentimentDetectionJobCommandInput | DescribeTopicsDetectionJobCommandInput | DetectDominantLanguageCommandInput | DetectEntitiesCommandInput | DetectKeyPhrasesCommandInput | DetectPiiEntitiesCommandInput | DetectSentimentCommandInput | DetectSyntaxCommandInput | DetectTargetedSentimentCommandInput | ImportModelCommandInput | ListDatasetsCommandInput | ListDocumentClassificationJobsCommandInput | ListDocumentClassifierSummariesCommandInput | ListDocumentClassifiersCommandInput | ListDominantLanguageDetectionJobsCommandInput | ListEndpointsCommandInput | ListEntitiesDetectionJobsCommandInput | ListEntityRecognizerSummariesCommandInput | ListEntityRecognizersCommandInput | ListEventsDetectionJobsCommandInput | ListFlywheelIterationHistoryCommandInput | ListFlywheelsCommandInput | ListKeyPhrasesDetectionJobsCommandInput | ListPiiEntitiesDetectionJobsCommandInput | ListSentimentDetectionJobsCommandInput | ListTagsForResourceCommandInput | ListTargetedSentimentDetectionJobsCommandInput | ListTopicsDetectionJobsCommandInput | PutResourcePolicyCommandInput | StartDocumentClassificationJobCommandInput | StartDominantLanguageDetectionJobCommandInput | StartEntitiesDetectionJobCommandInput | StartEventsDetectionJobCommandInput | StartFlywheelIterationCommandInput | StartKeyPhrasesDetectionJobCommandInput | StartPiiEntitiesDetectionJobCommandInput | StartSentimentDetectionJobCommandInput | StartTargetedSentimentDetectionJobCommandInput | StartTopicsDetectionJobCommandInput | StopDominantLanguageDetectionJobCommandInput | StopEntitiesDetectionJobCommandInput | StopEventsDetectionJobCommandInput | StopKeyPhrasesDetectionJobCommandInput | StopPiiEntitiesDetectionJobCommandInput | StopSentimentDetectionJobCommandInput | StopTargetedSentimentDetectionJobCommandInput | StopTrainingDocumentClassifierCommandInput | StopTrainingEntityRecognizerCommandInput | TagResourceCommandInput | UntagResourceCommandInput | UpdateEndpointCommandInput | UpdateFlywheelCommandInput;
102
+ export type ServiceInputTypes = BatchDetectDominantLanguageCommandInput | BatchDetectEntitiesCommandInput | BatchDetectKeyPhrasesCommandInput | BatchDetectSentimentCommandInput | BatchDetectSyntaxCommandInput | BatchDetectTargetedSentimentCommandInput | ClassifyDocumentCommandInput | ContainsPiiEntitiesCommandInput | CreateDatasetCommandInput | CreateDocumentClassifierCommandInput | CreateEndpointCommandInput | CreateEntityRecognizerCommandInput | CreateFlywheelCommandInput | DeleteDocumentClassifierCommandInput | DeleteEndpointCommandInput | DeleteEntityRecognizerCommandInput | DeleteFlywheelCommandInput | DeleteResourcePolicyCommandInput | DescribeDatasetCommandInput | DescribeDocumentClassificationJobCommandInput | DescribeDocumentClassifierCommandInput | DescribeDominantLanguageDetectionJobCommandInput | DescribeEndpointCommandInput | DescribeEntitiesDetectionJobCommandInput | DescribeEntityRecognizerCommandInput | DescribeEventsDetectionJobCommandInput | DescribeFlywheelCommandInput | DescribeFlywheelIterationCommandInput | DescribeKeyPhrasesDetectionJobCommandInput | DescribePiiEntitiesDetectionJobCommandInput | DescribeResourcePolicyCommandInput | DescribeSentimentDetectionJobCommandInput | DescribeTargetedSentimentDetectionJobCommandInput | DescribeTopicsDetectionJobCommandInput | DetectDominantLanguageCommandInput | DetectEntitiesCommandInput | DetectKeyPhrasesCommandInput | DetectPiiEntitiesCommandInput | DetectSentimentCommandInput | DetectSyntaxCommandInput | DetectTargetedSentimentCommandInput | DetectToxicContentCommandInput | ImportModelCommandInput | ListDatasetsCommandInput | ListDocumentClassificationJobsCommandInput | ListDocumentClassifierSummariesCommandInput | ListDocumentClassifiersCommandInput | ListDominantLanguageDetectionJobsCommandInput | ListEndpointsCommandInput | ListEntitiesDetectionJobsCommandInput | ListEntityRecognizerSummariesCommandInput | ListEntityRecognizersCommandInput | ListEventsDetectionJobsCommandInput | ListFlywheelIterationHistoryCommandInput | ListFlywheelsCommandInput | ListKeyPhrasesDetectionJobsCommandInput | ListPiiEntitiesDetectionJobsCommandInput | ListSentimentDetectionJobsCommandInput | ListTagsForResourceCommandInput | ListTargetedSentimentDetectionJobsCommandInput | ListTopicsDetectionJobsCommandInput | PutResourcePolicyCommandInput | StartDocumentClassificationJobCommandInput | StartDominantLanguageDetectionJobCommandInput | StartEntitiesDetectionJobCommandInput | StartEventsDetectionJobCommandInput | StartFlywheelIterationCommandInput | StartKeyPhrasesDetectionJobCommandInput | StartPiiEntitiesDetectionJobCommandInput | StartSentimentDetectionJobCommandInput | StartTargetedSentimentDetectionJobCommandInput | StartTopicsDetectionJobCommandInput | StopDominantLanguageDetectionJobCommandInput | StopEntitiesDetectionJobCommandInput | StopEventsDetectionJobCommandInput | StopKeyPhrasesDetectionJobCommandInput | StopPiiEntitiesDetectionJobCommandInput | StopSentimentDetectionJobCommandInput | StopTargetedSentimentDetectionJobCommandInput | StopTrainingDocumentClassifierCommandInput | StopTrainingEntityRecognizerCommandInput | TagResourceCommandInput | UntagResourceCommandInput | UpdateEndpointCommandInput | UpdateFlywheelCommandInput;
102
103
  /**
103
104
  * @public
104
105
  */
105
- export type ServiceOutputTypes = BatchDetectDominantLanguageCommandOutput | BatchDetectEntitiesCommandOutput | BatchDetectKeyPhrasesCommandOutput | BatchDetectSentimentCommandOutput | BatchDetectSyntaxCommandOutput | BatchDetectTargetedSentimentCommandOutput | ClassifyDocumentCommandOutput | ContainsPiiEntitiesCommandOutput | CreateDatasetCommandOutput | CreateDocumentClassifierCommandOutput | CreateEndpointCommandOutput | CreateEntityRecognizerCommandOutput | CreateFlywheelCommandOutput | DeleteDocumentClassifierCommandOutput | DeleteEndpointCommandOutput | DeleteEntityRecognizerCommandOutput | DeleteFlywheelCommandOutput | DeleteResourcePolicyCommandOutput | DescribeDatasetCommandOutput | DescribeDocumentClassificationJobCommandOutput | DescribeDocumentClassifierCommandOutput | DescribeDominantLanguageDetectionJobCommandOutput | DescribeEndpointCommandOutput | DescribeEntitiesDetectionJobCommandOutput | DescribeEntityRecognizerCommandOutput | DescribeEventsDetectionJobCommandOutput | DescribeFlywheelCommandOutput | DescribeFlywheelIterationCommandOutput | DescribeKeyPhrasesDetectionJobCommandOutput | DescribePiiEntitiesDetectionJobCommandOutput | DescribeResourcePolicyCommandOutput | DescribeSentimentDetectionJobCommandOutput | DescribeTargetedSentimentDetectionJobCommandOutput | DescribeTopicsDetectionJobCommandOutput | DetectDominantLanguageCommandOutput | DetectEntitiesCommandOutput | DetectKeyPhrasesCommandOutput | DetectPiiEntitiesCommandOutput | DetectSentimentCommandOutput | DetectSyntaxCommandOutput | DetectTargetedSentimentCommandOutput | ImportModelCommandOutput | ListDatasetsCommandOutput | ListDocumentClassificationJobsCommandOutput | ListDocumentClassifierSummariesCommandOutput | ListDocumentClassifiersCommandOutput | ListDominantLanguageDetectionJobsCommandOutput | ListEndpointsCommandOutput | ListEntitiesDetectionJobsCommandOutput | ListEntityRecognizerSummariesCommandOutput | ListEntityRecognizersCommandOutput | ListEventsDetectionJobsCommandOutput | ListFlywheelIterationHistoryCommandOutput | ListFlywheelsCommandOutput | ListKeyPhrasesDetectionJobsCommandOutput | ListPiiEntitiesDetectionJobsCommandOutput | ListSentimentDetectionJobsCommandOutput | ListTagsForResourceCommandOutput | ListTargetedSentimentDetectionJobsCommandOutput | ListTopicsDetectionJobsCommandOutput | PutResourcePolicyCommandOutput | StartDocumentClassificationJobCommandOutput | StartDominantLanguageDetectionJobCommandOutput | StartEntitiesDetectionJobCommandOutput | StartEventsDetectionJobCommandOutput | StartFlywheelIterationCommandOutput | StartKeyPhrasesDetectionJobCommandOutput | StartPiiEntitiesDetectionJobCommandOutput | StartSentimentDetectionJobCommandOutput | StartTargetedSentimentDetectionJobCommandOutput | StartTopicsDetectionJobCommandOutput | StopDominantLanguageDetectionJobCommandOutput | StopEntitiesDetectionJobCommandOutput | StopEventsDetectionJobCommandOutput | StopKeyPhrasesDetectionJobCommandOutput | StopPiiEntitiesDetectionJobCommandOutput | StopSentimentDetectionJobCommandOutput | StopTargetedSentimentDetectionJobCommandOutput | StopTrainingDocumentClassifierCommandOutput | StopTrainingEntityRecognizerCommandOutput | TagResourceCommandOutput | UntagResourceCommandOutput | UpdateEndpointCommandOutput | UpdateFlywheelCommandOutput;
106
+ export type ServiceOutputTypes = BatchDetectDominantLanguageCommandOutput | BatchDetectEntitiesCommandOutput | BatchDetectKeyPhrasesCommandOutput | BatchDetectSentimentCommandOutput | BatchDetectSyntaxCommandOutput | BatchDetectTargetedSentimentCommandOutput | ClassifyDocumentCommandOutput | ContainsPiiEntitiesCommandOutput | CreateDatasetCommandOutput | CreateDocumentClassifierCommandOutput | CreateEndpointCommandOutput | CreateEntityRecognizerCommandOutput | CreateFlywheelCommandOutput | DeleteDocumentClassifierCommandOutput | DeleteEndpointCommandOutput | DeleteEntityRecognizerCommandOutput | DeleteFlywheelCommandOutput | DeleteResourcePolicyCommandOutput | DescribeDatasetCommandOutput | DescribeDocumentClassificationJobCommandOutput | DescribeDocumentClassifierCommandOutput | DescribeDominantLanguageDetectionJobCommandOutput | DescribeEndpointCommandOutput | DescribeEntitiesDetectionJobCommandOutput | DescribeEntityRecognizerCommandOutput | DescribeEventsDetectionJobCommandOutput | DescribeFlywheelCommandOutput | DescribeFlywheelIterationCommandOutput | DescribeKeyPhrasesDetectionJobCommandOutput | DescribePiiEntitiesDetectionJobCommandOutput | DescribeResourcePolicyCommandOutput | DescribeSentimentDetectionJobCommandOutput | DescribeTargetedSentimentDetectionJobCommandOutput | DescribeTopicsDetectionJobCommandOutput | DetectDominantLanguageCommandOutput | DetectEntitiesCommandOutput | DetectKeyPhrasesCommandOutput | DetectPiiEntitiesCommandOutput | DetectSentimentCommandOutput | DetectSyntaxCommandOutput | DetectTargetedSentimentCommandOutput | DetectToxicContentCommandOutput | ImportModelCommandOutput | ListDatasetsCommandOutput | ListDocumentClassificationJobsCommandOutput | ListDocumentClassifierSummariesCommandOutput | ListDocumentClassifiersCommandOutput | ListDominantLanguageDetectionJobsCommandOutput | ListEndpointsCommandOutput | ListEntitiesDetectionJobsCommandOutput | ListEntityRecognizerSummariesCommandOutput | ListEntityRecognizersCommandOutput | ListEventsDetectionJobsCommandOutput | ListFlywheelIterationHistoryCommandOutput | ListFlywheelsCommandOutput | ListKeyPhrasesDetectionJobsCommandOutput | ListPiiEntitiesDetectionJobsCommandOutput | ListSentimentDetectionJobsCommandOutput | ListTagsForResourceCommandOutput | ListTargetedSentimentDetectionJobsCommandOutput | ListTopicsDetectionJobsCommandOutput | PutResourcePolicyCommandOutput | StartDocumentClassificationJobCommandOutput | StartDominantLanguageDetectionJobCommandOutput | StartEntitiesDetectionJobCommandOutput | StartEventsDetectionJobCommandOutput | StartFlywheelIterationCommandOutput | StartKeyPhrasesDetectionJobCommandOutput | StartPiiEntitiesDetectionJobCommandOutput | StartSentimentDetectionJobCommandOutput | StartTargetedSentimentDetectionJobCommandOutput | StartTopicsDetectionJobCommandOutput | StopDominantLanguageDetectionJobCommandOutput | StopEntitiesDetectionJobCommandOutput | StopEventsDetectionJobCommandOutput | StopKeyPhrasesDetectionJobCommandOutput | StopPiiEntitiesDetectionJobCommandOutput | StopSentimentDetectionJobCommandOutput | StopTargetedSentimentDetectionJobCommandOutput | StopTrainingDocumentClassifierCommandOutput | StopTrainingEntityRecognizerCommandOutput | TagResourceCommandOutput | UntagResourceCommandOutput | UpdateEndpointCommandOutput | UpdateFlywheelCommandOutput;
106
107
  /**
107
108
  * @public
108
109
  */
@@ -25,7 +25,7 @@ export interface BatchDetectTargetedSentimentCommandOutput extends BatchDetectTa
25
25
  * @public
26
26
  * <p>Inspects a batch of documents and returns a sentiment analysis
27
27
  * for each entity identified in the documents.</p>
28
- * <p>For more information about targeted sentiment, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html">Targeted sentiment</a>.</p>
28
+ * <p>For more information about targeted sentiment, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html">Targeted sentiment</a> in the <i>Amazon Comprehend Developer Guide</i>.</p>
29
29
  * @example
30
30
  * Use a bare-bones client and the command you need to make an API call.
31
31
  * ```javascript
@@ -23,9 +23,21 @@ export interface ClassifyDocumentCommandOutput extends ClassifyDocumentResponse,
23
23
  }
24
24
  /**
25
25
  * @public
26
- * <p>Creates a new document classification request to analyze a single document in real-time,
27
- * using a previously created and trained custom model and an endpoint.</p>
28
- * <p>You can input plain text or you can upload a single-page input document (text, PDF, Word, or image). </p>
26
+ * <p>Creates a classification request to analyze a single document in real-time. <code>ClassifyDocument</code>
27
+ * supports the following model types:</p>
28
+ * <ul>
29
+ * <li>
30
+ * <p>Custom classifier - a custom model that you have created and trained.
31
+ * For input, you can provide plain text, a single-page document (PDF, Word, or image), or Textract API output.
32
+ * For more information, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/how-document-classification.html">Custom classification</a> in the <i>Amazon Comprehend Developer Guide</i>.</p>
33
+ * </li>
34
+ * <li>
35
+ * <p>Prompt classifier - Amazon Comprehend provides a model for classifying prompts.
36
+ * For input, you provide English plain text input.
37
+ * For prompt classification, the response includes only the <code>Classes</code> field.
38
+ * For more information about prompt classifiers, see <a href="https://docs.aws.amazon.com/comprehend/latest/dg/prompt-classification.html">Prompt classifiers</a> in the <i>Amazon Comprehend Developer Guide</i>.</p>
39
+ * </li>
40
+ * </ul>
29
41
  * <p>If the system detects errors while processing a page in the input document,
30
42
  * the API response includes an entry in <code>Errors</code> that describes the errors.</p>
31
43
  * <p>If the system detects a document-level error in your input document, the API returns an