diff --git a/clients/client-comprehend/.gitignore b/clients/client-comprehend/.gitignore new file mode 100644 index 000000000000..b41c05b597c4 --- /dev/null +++ b/clients/client-comprehend/.gitignore @@ -0,0 +1,14 @@ +/node_modules/ +/build/ +/coverage/ +/docs/ +/types/ +/dist/ +*.tsbuildinfo +*.tgz +*.log +package-lock.json + +*.d.ts +*.js +*.js.map diff --git a/clients/client-comprehend/.npmignore b/clients/client-comprehend/.npmignore new file mode 100644 index 000000000000..b7ff81137c4a --- /dev/null +++ b/clients/client-comprehend/.npmignore @@ -0,0 +1,4 @@ +/coverage/ +/docs/ +tsconfig.test.json +*.tsbuildinfo diff --git a/clients/client-comprehend/Comprehend.ts b/clients/client-comprehend/Comprehend.ts new file mode 100644 index 000000000000..062369693d2c --- /dev/null +++ b/clients/client-comprehend/Comprehend.ts @@ -0,0 +1,2320 @@ +import { ComprehendClient } from "./ComprehendClient"; +import { + BatchDetectDominantLanguageCommand, + BatchDetectDominantLanguageCommandInput, + BatchDetectDominantLanguageCommandOutput +} from "./commands/BatchDetectDominantLanguageCommand"; +import { + BatchDetectEntitiesCommand, + BatchDetectEntitiesCommandInput, + BatchDetectEntitiesCommandOutput +} from "./commands/BatchDetectEntitiesCommand"; +import { + BatchDetectKeyPhrasesCommand, + BatchDetectKeyPhrasesCommandInput, + BatchDetectKeyPhrasesCommandOutput +} from "./commands/BatchDetectKeyPhrasesCommand"; +import { + BatchDetectSentimentCommand, + BatchDetectSentimentCommandInput, + BatchDetectSentimentCommandOutput +} from "./commands/BatchDetectSentimentCommand"; +import { + BatchDetectSyntaxCommand, + BatchDetectSyntaxCommandInput, + BatchDetectSyntaxCommandOutput +} from "./commands/BatchDetectSyntaxCommand"; +import { + ClassifyDocumentCommand, + ClassifyDocumentCommandInput, + ClassifyDocumentCommandOutput +} from "./commands/ClassifyDocumentCommand"; +import { + CreateDocumentClassifierCommand, + CreateDocumentClassifierCommandInput, + CreateDocumentClassifierCommandOutput +} from "./commands/CreateDocumentClassifierCommand"; +import { + CreateEndpointCommand, + CreateEndpointCommandInput, + CreateEndpointCommandOutput +} from "./commands/CreateEndpointCommand"; +import { + CreateEntityRecognizerCommand, + CreateEntityRecognizerCommandInput, + CreateEntityRecognizerCommandOutput +} from "./commands/CreateEntityRecognizerCommand"; +import { + DeleteDocumentClassifierCommand, + DeleteDocumentClassifierCommandInput, + DeleteDocumentClassifierCommandOutput +} from "./commands/DeleteDocumentClassifierCommand"; +import { + DeleteEndpointCommand, + DeleteEndpointCommandInput, + DeleteEndpointCommandOutput +} from "./commands/DeleteEndpointCommand"; +import { + DeleteEntityRecognizerCommand, + DeleteEntityRecognizerCommandInput, + DeleteEntityRecognizerCommandOutput +} from "./commands/DeleteEntityRecognizerCommand"; +import { + DescribeDocumentClassificationJobCommand, + DescribeDocumentClassificationJobCommandInput, + DescribeDocumentClassificationJobCommandOutput +} from "./commands/DescribeDocumentClassificationJobCommand"; +import { + DescribeDocumentClassifierCommand, + DescribeDocumentClassifierCommandInput, + DescribeDocumentClassifierCommandOutput +} from "./commands/DescribeDocumentClassifierCommand"; +import { + DescribeDominantLanguageDetectionJobCommand, + DescribeDominantLanguageDetectionJobCommandInput, + DescribeDominantLanguageDetectionJobCommandOutput +} from "./commands/DescribeDominantLanguageDetectionJobCommand"; +import { + DescribeEndpointCommand, + DescribeEndpointCommandInput, + DescribeEndpointCommandOutput +} from "./commands/DescribeEndpointCommand"; +import { + DescribeEntitiesDetectionJobCommand, + DescribeEntitiesDetectionJobCommandInput, + DescribeEntitiesDetectionJobCommandOutput +} from "./commands/DescribeEntitiesDetectionJobCommand"; +import { + DescribeEntityRecognizerCommand, + DescribeEntityRecognizerCommandInput, + DescribeEntityRecognizerCommandOutput +} from "./commands/DescribeEntityRecognizerCommand"; +import { + DescribeKeyPhrasesDetectionJobCommand, + DescribeKeyPhrasesDetectionJobCommandInput, + DescribeKeyPhrasesDetectionJobCommandOutput +} from "./commands/DescribeKeyPhrasesDetectionJobCommand"; +import { + DescribeSentimentDetectionJobCommand, + DescribeSentimentDetectionJobCommandInput, + DescribeSentimentDetectionJobCommandOutput +} from "./commands/DescribeSentimentDetectionJobCommand"; +import { + DescribeTopicsDetectionJobCommand, + DescribeTopicsDetectionJobCommandInput, + DescribeTopicsDetectionJobCommandOutput +} from "./commands/DescribeTopicsDetectionJobCommand"; +import { + DetectDominantLanguageCommand, + DetectDominantLanguageCommandInput, + DetectDominantLanguageCommandOutput +} from "./commands/DetectDominantLanguageCommand"; +import { + DetectEntitiesCommand, + DetectEntitiesCommandInput, + DetectEntitiesCommandOutput +} from "./commands/DetectEntitiesCommand"; +import { + DetectKeyPhrasesCommand, + DetectKeyPhrasesCommandInput, + DetectKeyPhrasesCommandOutput +} from "./commands/DetectKeyPhrasesCommand"; +import { + DetectSentimentCommand, + DetectSentimentCommandInput, + DetectSentimentCommandOutput +} from "./commands/DetectSentimentCommand"; +import { + DetectSyntaxCommand, + DetectSyntaxCommandInput, + DetectSyntaxCommandOutput +} from "./commands/DetectSyntaxCommand"; +import { + ListDocumentClassificationJobsCommand, + ListDocumentClassificationJobsCommandInput, + ListDocumentClassificationJobsCommandOutput +} from "./commands/ListDocumentClassificationJobsCommand"; +import { + ListDocumentClassifiersCommand, + ListDocumentClassifiersCommandInput, + ListDocumentClassifiersCommandOutput +} from "./commands/ListDocumentClassifiersCommand"; +import { + ListDominantLanguageDetectionJobsCommand, + ListDominantLanguageDetectionJobsCommandInput, + ListDominantLanguageDetectionJobsCommandOutput +} from "./commands/ListDominantLanguageDetectionJobsCommand"; +import { + ListEndpointsCommand, + ListEndpointsCommandInput, + ListEndpointsCommandOutput +} from "./commands/ListEndpointsCommand"; +import { + ListEntitiesDetectionJobsCommand, + ListEntitiesDetectionJobsCommandInput, + ListEntitiesDetectionJobsCommandOutput +} from "./commands/ListEntitiesDetectionJobsCommand"; +import { + ListEntityRecognizersCommand, + ListEntityRecognizersCommandInput, + ListEntityRecognizersCommandOutput +} from "./commands/ListEntityRecognizersCommand"; +import { + ListKeyPhrasesDetectionJobsCommand, + ListKeyPhrasesDetectionJobsCommandInput, + ListKeyPhrasesDetectionJobsCommandOutput +} from "./commands/ListKeyPhrasesDetectionJobsCommand"; +import { + ListSentimentDetectionJobsCommand, + ListSentimentDetectionJobsCommandInput, + ListSentimentDetectionJobsCommandOutput +} from "./commands/ListSentimentDetectionJobsCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput +} from "./commands/ListTagsForResourceCommand"; +import { + ListTopicsDetectionJobsCommand, + ListTopicsDetectionJobsCommandInput, + ListTopicsDetectionJobsCommandOutput +} from "./commands/ListTopicsDetectionJobsCommand"; +import { + StartDocumentClassificationJobCommand, + StartDocumentClassificationJobCommandInput, + StartDocumentClassificationJobCommandOutput +} from "./commands/StartDocumentClassificationJobCommand"; +import { + StartDominantLanguageDetectionJobCommand, + StartDominantLanguageDetectionJobCommandInput, + StartDominantLanguageDetectionJobCommandOutput +} from "./commands/StartDominantLanguageDetectionJobCommand"; +import { + StartEntitiesDetectionJobCommand, + StartEntitiesDetectionJobCommandInput, + StartEntitiesDetectionJobCommandOutput +} from "./commands/StartEntitiesDetectionJobCommand"; +import { + StartKeyPhrasesDetectionJobCommand, + StartKeyPhrasesDetectionJobCommandInput, + StartKeyPhrasesDetectionJobCommandOutput +} from "./commands/StartKeyPhrasesDetectionJobCommand"; +import { + StartSentimentDetectionJobCommand, + StartSentimentDetectionJobCommandInput, + StartSentimentDetectionJobCommandOutput +} from "./commands/StartSentimentDetectionJobCommand"; +import { + StartTopicsDetectionJobCommand, + StartTopicsDetectionJobCommandInput, + StartTopicsDetectionJobCommandOutput +} from "./commands/StartTopicsDetectionJobCommand"; +import { + StopDominantLanguageDetectionJobCommand, + StopDominantLanguageDetectionJobCommandInput, + StopDominantLanguageDetectionJobCommandOutput +} from "./commands/StopDominantLanguageDetectionJobCommand"; +import { + StopEntitiesDetectionJobCommand, + StopEntitiesDetectionJobCommandInput, + StopEntitiesDetectionJobCommandOutput +} from "./commands/StopEntitiesDetectionJobCommand"; +import { + StopKeyPhrasesDetectionJobCommand, + StopKeyPhrasesDetectionJobCommandInput, + StopKeyPhrasesDetectionJobCommandOutput +} from "./commands/StopKeyPhrasesDetectionJobCommand"; +import { + StopSentimentDetectionJobCommand, + StopSentimentDetectionJobCommandInput, + StopSentimentDetectionJobCommandOutput +} from "./commands/StopSentimentDetectionJobCommand"; +import { + StopTrainingDocumentClassifierCommand, + StopTrainingDocumentClassifierCommandInput, + StopTrainingDocumentClassifierCommandOutput +} from "./commands/StopTrainingDocumentClassifierCommand"; +import { + StopTrainingEntityRecognizerCommand, + StopTrainingEntityRecognizerCommandInput, + StopTrainingEntityRecognizerCommandOutput +} from "./commands/StopTrainingEntityRecognizerCommand"; +import { + TagResourceCommand, + TagResourceCommandInput, + TagResourceCommandOutput +} from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput +} from "./commands/UntagResourceCommand"; +import { + UpdateEndpointCommand, + UpdateEndpointCommandInput, + UpdateEndpointCommandOutput +} from "./commands/UpdateEndpointCommand"; +import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; + +/** + * + *

Amazon Comprehend is an AWS service for gaining insight into the content of documents. Use these + * actions to determine the topics contained in your documents, the topics they discuss, the + * predominant sentiment expressed in them, the predominant language used, and more.

+ * + */ +export class Comprehend extends ComprehendClient { + /** + * + *

Determines the dominant language of the input text for a batch of documents. For a list + * of languages that Amazon Comprehend can detect, see Amazon Comprehend Supported Languages.

+ * + */ + public batchDetectDominantLanguage( + args: BatchDetectDominantLanguageCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public batchDetectDominantLanguage( + args: BatchDetectDominantLanguageCommandInput, + cb: (err: any, data?: BatchDetectDominantLanguageCommandOutput) => void + ): void; + public batchDetectDominantLanguage( + args: BatchDetectDominantLanguageCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchDetectDominantLanguageCommandOutput) => void + ): void; + public batchDetectDominantLanguage( + args: BatchDetectDominantLanguageCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: BatchDetectDominantLanguageCommandOutput) => void), + cb?: (err: any, data?: BatchDetectDominantLanguageCommandOutput) => void + ): Promise | void { + const command = new BatchDetectDominantLanguageCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

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 + *

+ * + */ + public batchDetectEntities( + args: BatchDetectEntitiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public batchDetectEntities( + args: BatchDetectEntitiesCommandInput, + cb: (err: any, data?: BatchDetectEntitiesCommandOutput) => void + ): void; + public batchDetectEntities( + args: BatchDetectEntitiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchDetectEntitiesCommandOutput) => void + ): void; + public batchDetectEntities( + args: BatchDetectEntitiesCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: BatchDetectEntitiesCommandOutput) => void), + cb?: (err: any, data?: BatchDetectEntitiesCommandOutput) => void + ): Promise | void { + const command = new BatchDetectEntitiesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Detects the key noun phrases found in a batch of documents.

+ * + */ + public batchDetectKeyPhrases( + args: BatchDetectKeyPhrasesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public batchDetectKeyPhrases( + args: BatchDetectKeyPhrasesCommandInput, + cb: (err: any, data?: BatchDetectKeyPhrasesCommandOutput) => void + ): void; + public batchDetectKeyPhrases( + args: BatchDetectKeyPhrasesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchDetectKeyPhrasesCommandOutput) => void + ): void; + public batchDetectKeyPhrases( + args: BatchDetectKeyPhrasesCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: BatchDetectKeyPhrasesCommandOutput) => void), + cb?: (err: any, data?: BatchDetectKeyPhrasesCommandOutput) => void + ): Promise | void { + const command = new BatchDetectKeyPhrasesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Inspects a batch of documents and returns an inference of the prevailing sentiment, + * POSITIVE, NEUTRAL, MIXED, or NEGATIVE, + * in each one.

+ * + */ + public batchDetectSentiment( + args: BatchDetectSentimentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public batchDetectSentiment( + args: BatchDetectSentimentCommandInput, + cb: (err: any, data?: BatchDetectSentimentCommandOutput) => void + ): void; + public batchDetectSentiment( + args: BatchDetectSentimentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchDetectSentimentCommandOutput) => void + ): void; + public batchDetectSentiment( + args: BatchDetectSentimentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: BatchDetectSentimentCommandOutput) => void), + cb?: (err: any, data?: BatchDetectSentimentCommandOutput) => void + ): Promise | void { + const command = new BatchDetectSentimentCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

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.

+ * + */ + public batchDetectSyntax( + args: BatchDetectSyntaxCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public batchDetectSyntax( + args: BatchDetectSyntaxCommandInput, + cb: (err: any, data?: BatchDetectSyntaxCommandOutput) => void + ): void; + public batchDetectSyntax( + args: BatchDetectSyntaxCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: BatchDetectSyntaxCommandOutput) => void + ): void; + public batchDetectSyntax( + args: BatchDetectSyntaxCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: BatchDetectSyntaxCommandOutput) => void), + cb?: (err: any, data?: BatchDetectSyntaxCommandOutput) => void + ): Promise | void { + const command = new BatchDetectSyntaxCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Creates a new document classification request to analyze a single document in real-time, using a previously created and trained custom model and an endpoint.

+ * + */ + public classifyDocument( + args: ClassifyDocumentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public classifyDocument( + args: ClassifyDocumentCommandInput, + cb: (err: any, data?: ClassifyDocumentCommandOutput) => void + ): void; + public classifyDocument( + args: ClassifyDocumentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ClassifyDocumentCommandOutput) => void + ): void; + public classifyDocument( + args: ClassifyDocumentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ClassifyDocumentCommandOutput) => void), + cb?: (err: any, data?: ClassifyDocumentCommandOutput) => void + ): Promise | void { + const command = new ClassifyDocumentCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Creates a new document classifier that you can use to categorize 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.

+ * + */ + public createDocumentClassifier( + args: CreateDocumentClassifierCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createDocumentClassifier( + args: CreateDocumentClassifierCommandInput, + cb: (err: any, data?: CreateDocumentClassifierCommandOutput) => void + ): void; + public createDocumentClassifier( + args: CreateDocumentClassifierCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateDocumentClassifierCommandOutput) => void + ): void; + public createDocumentClassifier( + args: CreateDocumentClassifierCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: CreateDocumentClassifierCommandOutput) => void), + cb?: (err: any, data?: CreateDocumentClassifierCommandOutput) => void + ): Promise | void { + const command = new CreateDocumentClassifierCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Creates a model-specific endpoint for synchronous inference for a previously trained custom model

+ * + */ + public createEndpoint( + args: CreateEndpointCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createEndpoint( + args: CreateEndpointCommandInput, + cb: (err: any, data?: CreateEndpointCommandOutput) => void + ): void; + public createEndpoint( + args: CreateEndpointCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateEndpointCommandOutput) => void + ): void; + public createEndpoint( + args: CreateEndpointCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: CreateEndpointCommandOutput) => void), + cb?: (err: any, data?: CreateEndpointCommandOutput) => void + ): Promise | void { + const command = new CreateEndpointCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Creates an entity recognizer using submitted files. After your CreateEntityRecognizer request is + * submitted, you can check job status using the API.

+ * + */ + public createEntityRecognizer( + args: CreateEntityRecognizerCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createEntityRecognizer( + args: CreateEntityRecognizerCommandInput, + cb: (err: any, data?: CreateEntityRecognizerCommandOutput) => void + ): void; + public createEntityRecognizer( + args: CreateEntityRecognizerCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateEntityRecognizerCommandOutput) => void + ): void; + public createEntityRecognizer( + args: CreateEntityRecognizerCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: CreateEntityRecognizerCommandOutput) => void), + cb?: (err: any, data?: CreateEntityRecognizerCommandOutput) => void + ): Promise | void { + const command = new CreateEntityRecognizerCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Deletes a previously created document classifier

+ *

Only those classifiers that are in terminated states (IN_ERROR, TRAINED) will be + * deleted. If an active inference job is using the model, a ResourceInUseException will be + * returned.

+ *

This is an asynchronous action that puts the classifier into a DELETING state, and it is then removed by + * a background job. Once removed, the classifier disappears from your account and is no longer available for use.

+ * + * + */ + public deleteDocumentClassifier( + args: DeleteDocumentClassifierCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteDocumentClassifier( + args: DeleteDocumentClassifierCommandInput, + cb: (err: any, data?: DeleteDocumentClassifierCommandOutput) => void + ): void; + public deleteDocumentClassifier( + args: DeleteDocumentClassifierCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteDocumentClassifierCommandOutput) => void + ): void; + public deleteDocumentClassifier( + args: DeleteDocumentClassifierCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeleteDocumentClassifierCommandOutput) => void), + cb?: (err: any, data?: DeleteDocumentClassifierCommandOutput) => void + ): Promise | void { + const command = new DeleteDocumentClassifierCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Deletes a model-specific endpoint for a previously-trained custom model. All endpoints must be deleted in order for the model to be deleted.

+ * + */ + public deleteEndpoint( + args: DeleteEndpointCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteEndpoint( + args: DeleteEndpointCommandInput, + cb: (err: any, data?: DeleteEndpointCommandOutput) => void + ): void; + public deleteEndpoint( + args: DeleteEndpointCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteEndpointCommandOutput) => void + ): void; + public deleteEndpoint( + args: DeleteEndpointCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeleteEndpointCommandOutput) => void), + cb?: (err: any, data?: DeleteEndpointCommandOutput) => void + ): Promise | void { + const command = new DeleteEndpointCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Deletes an entity recognizer.

+ *

Only those recognizers that are in terminated states (IN_ERROR, TRAINED) will be + * deleted. If an active inference job is using the model, a ResourceInUseException will be + * returned.

+ *

This is an asynchronous action that puts the recognizer into a DELETING state, and it is then removed by + * a background job. Once removed, the recognizer disappears from your account and is no longer available for use.

+ * + */ + public deleteEntityRecognizer( + args: DeleteEntityRecognizerCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteEntityRecognizer( + args: DeleteEntityRecognizerCommandInput, + cb: (err: any, data?: DeleteEntityRecognizerCommandOutput) => void + ): void; + public deleteEntityRecognizer( + args: DeleteEntityRecognizerCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteEntityRecognizerCommandOutput) => void + ): void; + public deleteEntityRecognizer( + args: DeleteEntityRecognizerCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DeleteEntityRecognizerCommandOutput) => void), + cb?: (err: any, data?: DeleteEntityRecognizerCommandOutput) => void + ): Promise | void { + const command = new DeleteEntityRecognizerCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets the properties associated with a document classification job. Use this operation to + * get the status of a classification job.

+ * + */ + public describeDocumentClassificationJob( + args: DescribeDocumentClassificationJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeDocumentClassificationJob( + args: DescribeDocumentClassificationJobCommandInput, + cb: ( + err: any, + data?: DescribeDocumentClassificationJobCommandOutput + ) => void + ): void; + public describeDocumentClassificationJob( + args: DescribeDocumentClassificationJobCommandInput, + options: __HttpHandlerOptions, + cb: ( + err: any, + data?: DescribeDocumentClassificationJobCommandOutput + ) => void + ): void; + public describeDocumentClassificationJob( + args: DescribeDocumentClassificationJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: DescribeDocumentClassificationJobCommandOutput + ) => void), + cb?: ( + err: any, + data?: DescribeDocumentClassificationJobCommandOutput + ) => void + ): Promise | void { + const command = new DescribeDocumentClassificationJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets the properties associated with a document classifier.

+ * + */ + public describeDocumentClassifier( + args: DescribeDocumentClassifierCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeDocumentClassifier( + args: DescribeDocumentClassifierCommandInput, + cb: (err: any, data?: DescribeDocumentClassifierCommandOutput) => void + ): void; + public describeDocumentClassifier( + args: DescribeDocumentClassifierCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeDocumentClassifierCommandOutput) => void + ): void; + public describeDocumentClassifier( + args: DescribeDocumentClassifierCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DescribeDocumentClassifierCommandOutput) => void), + cb?: (err: any, data?: DescribeDocumentClassifierCommandOutput) => void + ): Promise | void { + const command = new DescribeDocumentClassifierCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets the properties associated with a dominant language detection job. Use this operation + * to get the status of a detection job.

+ * + */ + public describeDominantLanguageDetectionJob( + args: DescribeDominantLanguageDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeDominantLanguageDetectionJob( + args: DescribeDominantLanguageDetectionJobCommandInput, + cb: ( + err: any, + data?: DescribeDominantLanguageDetectionJobCommandOutput + ) => void + ): void; + public describeDominantLanguageDetectionJob( + args: DescribeDominantLanguageDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: ( + err: any, + data?: DescribeDominantLanguageDetectionJobCommandOutput + ) => void + ): void; + public describeDominantLanguageDetectionJob( + args: DescribeDominantLanguageDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: DescribeDominantLanguageDetectionJobCommandOutput + ) => void), + cb?: ( + err: any, + data?: DescribeDominantLanguageDetectionJobCommandOutput + ) => void + ): Promise | void { + const command = new DescribeDominantLanguageDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets the properties associated with a specific endpoint. Use this operation to get the status of an endpoint.

+ * + */ + public describeEndpoint( + args: DescribeEndpointCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeEndpoint( + args: DescribeEndpointCommandInput, + cb: (err: any, data?: DescribeEndpointCommandOutput) => void + ): void; + public describeEndpoint( + args: DescribeEndpointCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeEndpointCommandOutput) => void + ): void; + public describeEndpoint( + args: DescribeEndpointCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DescribeEndpointCommandOutput) => void), + cb?: (err: any, data?: DescribeEndpointCommandOutput) => void + ): Promise | void { + const command = new DescribeEndpointCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets the properties associated with an entities detection job. Use this operation to get + * the status of a detection job.

+ * + */ + public describeEntitiesDetectionJob( + args: DescribeEntitiesDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeEntitiesDetectionJob( + args: DescribeEntitiesDetectionJobCommandInput, + cb: (err: any, data?: DescribeEntitiesDetectionJobCommandOutput) => void + ): void; + public describeEntitiesDetectionJob( + args: DescribeEntitiesDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeEntitiesDetectionJobCommandOutput) => void + ): void; + public describeEntitiesDetectionJob( + args: DescribeEntitiesDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DescribeEntitiesDetectionJobCommandOutput) => void), + cb?: (err: any, data?: DescribeEntitiesDetectionJobCommandOutput) => void + ): Promise | void { + const command = new DescribeEntitiesDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Provides details about an entity recognizer including status, S3 buckets containing + * training data, recognizer metadata, metrics, and so on.

+ * + */ + public describeEntityRecognizer( + args: DescribeEntityRecognizerCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeEntityRecognizer( + args: DescribeEntityRecognizerCommandInput, + cb: (err: any, data?: DescribeEntityRecognizerCommandOutput) => void + ): void; + public describeEntityRecognizer( + args: DescribeEntityRecognizerCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeEntityRecognizerCommandOutput) => void + ): void; + public describeEntityRecognizer( + args: DescribeEntityRecognizerCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DescribeEntityRecognizerCommandOutput) => void), + cb?: (err: any, data?: DescribeEntityRecognizerCommandOutput) => void + ): Promise | void { + const command = new DescribeEntityRecognizerCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets the properties associated with a key phrases detection job. Use this operation to get + * the status of a detection job.

+ * + */ + public describeKeyPhrasesDetectionJob( + args: DescribeKeyPhrasesDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeKeyPhrasesDetectionJob( + args: DescribeKeyPhrasesDetectionJobCommandInput, + cb: (err: any, data?: DescribeKeyPhrasesDetectionJobCommandOutput) => void + ): void; + public describeKeyPhrasesDetectionJob( + args: DescribeKeyPhrasesDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeKeyPhrasesDetectionJobCommandOutput) => void + ): void; + public describeKeyPhrasesDetectionJob( + args: DescribeKeyPhrasesDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: DescribeKeyPhrasesDetectionJobCommandOutput + ) => void), + cb?: (err: any, data?: DescribeKeyPhrasesDetectionJobCommandOutput) => void + ): Promise | void { + const command = new DescribeKeyPhrasesDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets the properties associated with a sentiment detection job. Use this operation to get + * the status of a detection job.

+ * + */ + public describeSentimentDetectionJob( + args: DescribeSentimentDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeSentimentDetectionJob( + args: DescribeSentimentDetectionJobCommandInput, + cb: (err: any, data?: DescribeSentimentDetectionJobCommandOutput) => void + ): void; + public describeSentimentDetectionJob( + args: DescribeSentimentDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeSentimentDetectionJobCommandOutput) => void + ): void; + public describeSentimentDetectionJob( + args: DescribeSentimentDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DescribeSentimentDetectionJobCommandOutput) => void), + cb?: (err: any, data?: DescribeSentimentDetectionJobCommandOutput) => void + ): Promise | void { + const command = new DescribeSentimentDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets the properties associated with a topic detection job. Use this operation to get + * the status of a detection job.

+ * + */ + public describeTopicsDetectionJob( + args: DescribeTopicsDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeTopicsDetectionJob( + args: DescribeTopicsDetectionJobCommandInput, + cb: (err: any, data?: DescribeTopicsDetectionJobCommandOutput) => void + ): void; + public describeTopicsDetectionJob( + args: DescribeTopicsDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeTopicsDetectionJobCommandOutput) => void + ): void; + public describeTopicsDetectionJob( + args: DescribeTopicsDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DescribeTopicsDetectionJobCommandOutput) => void), + cb?: (err: any, data?: DescribeTopicsDetectionJobCommandOutput) => void + ): Promise | void { + const command = new DescribeTopicsDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Determines the dominant language of the input text. For a list of languages that Amazon Comprehend + * can detect, see Amazon Comprehend Supported Languages.

+ * + * + */ + public detectDominantLanguage( + args: DetectDominantLanguageCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public detectDominantLanguage( + args: DetectDominantLanguageCommandInput, + cb: (err: any, data?: DetectDominantLanguageCommandOutput) => void + ): void; + public detectDominantLanguage( + args: DetectDominantLanguageCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DetectDominantLanguageCommandOutput) => void + ): void; + public detectDominantLanguage( + args: DetectDominantLanguageCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DetectDominantLanguageCommandOutput) => void), + cb?: (err: any, data?: DetectDominantLanguageCommandOutput) => void + ): Promise | void { + const command = new DetectDominantLanguageCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Inspects text for named entities, and returns information about them. For more + * information, about named entities, see how-entities.

+ * + * + */ + public detectEntities( + args: DetectEntitiesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public detectEntities( + args: DetectEntitiesCommandInput, + cb: (err: any, data?: DetectEntitiesCommandOutput) => void + ): void; + public detectEntities( + args: DetectEntitiesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DetectEntitiesCommandOutput) => void + ): void; + public detectEntities( + args: DetectEntitiesCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DetectEntitiesCommandOutput) => void), + cb?: (err: any, data?: DetectEntitiesCommandOutput) => void + ): Promise | void { + const command = new DetectEntitiesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Detects the key noun phrases found in the text.

+ * + * + */ + public detectKeyPhrases( + args: DetectKeyPhrasesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public detectKeyPhrases( + args: DetectKeyPhrasesCommandInput, + cb: (err: any, data?: DetectKeyPhrasesCommandOutput) => void + ): void; + public detectKeyPhrases( + args: DetectKeyPhrasesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DetectKeyPhrasesCommandOutput) => void + ): void; + public detectKeyPhrases( + args: DetectKeyPhrasesCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DetectKeyPhrasesCommandOutput) => void), + cb?: (err: any, data?: DetectKeyPhrasesCommandOutput) => void + ): Promise | void { + const command = new DetectKeyPhrasesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Inspects text and returns an inference of the prevailing sentiment + * (POSITIVE, NEUTRAL, MIXED, or NEGATIVE).

+ * + * + */ + public detectSentiment( + args: DetectSentimentCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public detectSentiment( + args: DetectSentimentCommandInput, + cb: (err: any, data?: DetectSentimentCommandOutput) => void + ): void; + public detectSentiment( + args: DetectSentimentCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DetectSentimentCommandOutput) => void + ): void; + public detectSentiment( + args: DetectSentimentCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DetectSentimentCommandOutput) => void), + cb?: (err: any, data?: DetectSentimentCommandOutput) => void + ): Promise | void { + const command = new DetectSentimentCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

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

+ * + */ + public detectSyntax( + args: DetectSyntaxCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public detectSyntax( + args: DetectSyntaxCommandInput, + cb: (err: any, data?: DetectSyntaxCommandOutput) => void + ): void; + public detectSyntax( + args: DetectSyntaxCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DetectSyntaxCommandOutput) => void + ): void; + public detectSyntax( + args: DetectSyntaxCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: DetectSyntaxCommandOutput) => void), + cb?: (err: any, data?: DetectSyntaxCommandOutput) => void + ): Promise | void { + const command = new DetectSyntaxCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets a list of the documentation classification jobs that you have submitted.

+ * + */ + public listDocumentClassificationJobs( + args: ListDocumentClassificationJobsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listDocumentClassificationJobs( + args: ListDocumentClassificationJobsCommandInput, + cb: (err: any, data?: ListDocumentClassificationJobsCommandOutput) => void + ): void; + public listDocumentClassificationJobs( + args: ListDocumentClassificationJobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListDocumentClassificationJobsCommandOutput) => void + ): void; + public listDocumentClassificationJobs( + args: ListDocumentClassificationJobsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: ListDocumentClassificationJobsCommandOutput + ) => void), + cb?: (err: any, data?: ListDocumentClassificationJobsCommandOutput) => void + ): Promise | void { + const command = new ListDocumentClassificationJobsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets a list of the document classifiers that you have created.

+ * + */ + public listDocumentClassifiers( + args: ListDocumentClassifiersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listDocumentClassifiers( + args: ListDocumentClassifiersCommandInput, + cb: (err: any, data?: ListDocumentClassifiersCommandOutput) => void + ): void; + public listDocumentClassifiers( + args: ListDocumentClassifiersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListDocumentClassifiersCommandOutput) => void + ): void; + public listDocumentClassifiers( + args: ListDocumentClassifiersCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListDocumentClassifiersCommandOutput) => void), + cb?: (err: any, data?: ListDocumentClassifiersCommandOutput) => void + ): Promise | void { + const command = new ListDocumentClassifiersCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets a list of the dominant language detection jobs that you have submitted.

+ * + */ + public listDominantLanguageDetectionJobs( + args: ListDominantLanguageDetectionJobsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listDominantLanguageDetectionJobs( + args: ListDominantLanguageDetectionJobsCommandInput, + cb: ( + err: any, + data?: ListDominantLanguageDetectionJobsCommandOutput + ) => void + ): void; + public listDominantLanguageDetectionJobs( + args: ListDominantLanguageDetectionJobsCommandInput, + options: __HttpHandlerOptions, + cb: ( + err: any, + data?: ListDominantLanguageDetectionJobsCommandOutput + ) => void + ): void; + public listDominantLanguageDetectionJobs( + args: ListDominantLanguageDetectionJobsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: ListDominantLanguageDetectionJobsCommandOutput + ) => void), + cb?: ( + err: any, + data?: ListDominantLanguageDetectionJobsCommandOutput + ) => void + ): Promise | void { + const command = new ListDominantLanguageDetectionJobsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets a list of all existing endpoints that you've created.

+ * + */ + public listEndpoints( + args: ListEndpointsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listEndpoints( + args: ListEndpointsCommandInput, + cb: (err: any, data?: ListEndpointsCommandOutput) => void + ): void; + public listEndpoints( + args: ListEndpointsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListEndpointsCommandOutput) => void + ): void; + public listEndpoints( + args: ListEndpointsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListEndpointsCommandOutput) => void), + cb?: (err: any, data?: ListEndpointsCommandOutput) => void + ): Promise | void { + const command = new ListEndpointsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets a list of the entity detection jobs that you have submitted.

+ * + */ + public listEntitiesDetectionJobs( + args: ListEntitiesDetectionJobsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listEntitiesDetectionJobs( + args: ListEntitiesDetectionJobsCommandInput, + cb: (err: any, data?: ListEntitiesDetectionJobsCommandOutput) => void + ): void; + public listEntitiesDetectionJobs( + args: ListEntitiesDetectionJobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListEntitiesDetectionJobsCommandOutput) => void + ): void; + public listEntitiesDetectionJobs( + args: ListEntitiesDetectionJobsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListEntitiesDetectionJobsCommandOutput) => void), + cb?: (err: any, data?: ListEntitiesDetectionJobsCommandOutput) => void + ): Promise | void { + const command = new ListEntitiesDetectionJobsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets a list of the properties of all entity recognizers that you created, including recognizers currently + * in training. Allows + * you to filter the list of recognizers based on criteria such as status and submission time. This + * call returns up to 500 entity recognizers in the list, with a default number of 100 + * recognizers in the list.

+ *

The results of this list are not in any particular order. Please get the list and sort + * locally if needed.

+ * + */ + public listEntityRecognizers( + args: ListEntityRecognizersCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listEntityRecognizers( + args: ListEntityRecognizersCommandInput, + cb: (err: any, data?: ListEntityRecognizersCommandOutput) => void + ): void; + public listEntityRecognizers( + args: ListEntityRecognizersCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListEntityRecognizersCommandOutput) => void + ): void; + public listEntityRecognizers( + args: ListEntityRecognizersCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListEntityRecognizersCommandOutput) => void), + cb?: (err: any, data?: ListEntityRecognizersCommandOutput) => void + ): Promise | void { + const command = new ListEntityRecognizersCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Get a list of key phrase detection jobs that you have submitted.

+ * + */ + public listKeyPhrasesDetectionJobs( + args: ListKeyPhrasesDetectionJobsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listKeyPhrasesDetectionJobs( + args: ListKeyPhrasesDetectionJobsCommandInput, + cb: (err: any, data?: ListKeyPhrasesDetectionJobsCommandOutput) => void + ): void; + public listKeyPhrasesDetectionJobs( + args: ListKeyPhrasesDetectionJobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListKeyPhrasesDetectionJobsCommandOutput) => void + ): void; + public listKeyPhrasesDetectionJobs( + args: ListKeyPhrasesDetectionJobsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListKeyPhrasesDetectionJobsCommandOutput) => void), + cb?: (err: any, data?: ListKeyPhrasesDetectionJobsCommandOutput) => void + ): Promise | void { + const command = new ListKeyPhrasesDetectionJobsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets a list of sentiment detection jobs that you have submitted.

+ * + */ + public listSentimentDetectionJobs( + args: ListSentimentDetectionJobsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listSentimentDetectionJobs( + args: ListSentimentDetectionJobsCommandInput, + cb: (err: any, data?: ListSentimentDetectionJobsCommandOutput) => void + ): void; + public listSentimentDetectionJobs( + args: ListSentimentDetectionJobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListSentimentDetectionJobsCommandOutput) => void + ): void; + public listSentimentDetectionJobs( + args: ListSentimentDetectionJobsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListSentimentDetectionJobsCommandOutput) => void), + cb?: (err: any, data?: ListSentimentDetectionJobsCommandOutput) => void + ): Promise | void { + const command = new ListSentimentDetectionJobsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Lists all tags associated with a given Amazon Comprehend resource.

+ * + */ + public listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + public listTagsForResource( + args: ListTagsForResourceCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListTagsForResourceCommandOutput) => void), + cb?: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): Promise | void { + const command = new ListTagsForResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Gets a list of the topic detection jobs that you have submitted.

+ * + */ + public listTopicsDetectionJobs( + args: ListTopicsDetectionJobsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listTopicsDetectionJobs( + args: ListTopicsDetectionJobsCommandInput, + cb: (err: any, data?: ListTopicsDetectionJobsCommandOutput) => void + ): void; + public listTopicsDetectionJobs( + args: ListTopicsDetectionJobsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTopicsDetectionJobsCommandOutput) => void + ): void; + public listTopicsDetectionJobs( + args: ListTopicsDetectionJobsCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: ListTopicsDetectionJobsCommandOutput) => void), + cb?: (err: any, data?: ListTopicsDetectionJobsCommandOutput) => void + ): Promise | void { + const command = new ListTopicsDetectionJobsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Starts an asynchronous document classification job. Use the operation to track the progress of the + * job.

+ * + */ + public startDocumentClassificationJob( + args: StartDocumentClassificationJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public startDocumentClassificationJob( + args: StartDocumentClassificationJobCommandInput, + cb: (err: any, data?: StartDocumentClassificationJobCommandOutput) => void + ): void; + public startDocumentClassificationJob( + args: StartDocumentClassificationJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartDocumentClassificationJobCommandOutput) => void + ): void; + public startDocumentClassificationJob( + args: StartDocumentClassificationJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: StartDocumentClassificationJobCommandOutput + ) => void), + cb?: (err: any, data?: StartDocumentClassificationJobCommandOutput) => void + ): Promise | void { + const command = new StartDocumentClassificationJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Starts an asynchronous dominant language detection job for a collection of documents. Use + * the operation to track the status + * of a job.

+ * + */ + public startDominantLanguageDetectionJob( + args: StartDominantLanguageDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public startDominantLanguageDetectionJob( + args: StartDominantLanguageDetectionJobCommandInput, + cb: ( + err: any, + data?: StartDominantLanguageDetectionJobCommandOutput + ) => void + ): void; + public startDominantLanguageDetectionJob( + args: StartDominantLanguageDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: ( + err: any, + data?: StartDominantLanguageDetectionJobCommandOutput + ) => void + ): void; + public startDominantLanguageDetectionJob( + args: StartDominantLanguageDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: StartDominantLanguageDetectionJobCommandOutput + ) => void), + cb?: ( + err: any, + data?: StartDominantLanguageDetectionJobCommandOutput + ) => void + ): Promise | void { + const command = new StartDominantLanguageDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Starts an asynchronous entity detection job for a collection of documents. Use the operation to track the status of a job.

+ *

This API can be used for either standard entity detection or custom entity recognition. In order + * to be used for custom entity recognition, the optional EntityRecognizerArn must be used + * in order to provide access to the recognizer being used to detect the custom entity.

+ * + */ + public startEntitiesDetectionJob( + args: StartEntitiesDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public startEntitiesDetectionJob( + args: StartEntitiesDetectionJobCommandInput, + cb: (err: any, data?: StartEntitiesDetectionJobCommandOutput) => void + ): void; + public startEntitiesDetectionJob( + args: StartEntitiesDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartEntitiesDetectionJobCommandOutput) => void + ): void; + public startEntitiesDetectionJob( + args: StartEntitiesDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StartEntitiesDetectionJobCommandOutput) => void), + cb?: (err: any, data?: StartEntitiesDetectionJobCommandOutput) => void + ): Promise | void { + const command = new StartEntitiesDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Starts an asynchronous key phrase detection job for a collection of documents. Use the + * operation to track the status of a + * job.

+ * + */ + public startKeyPhrasesDetectionJob( + args: StartKeyPhrasesDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public startKeyPhrasesDetectionJob( + args: StartKeyPhrasesDetectionJobCommandInput, + cb: (err: any, data?: StartKeyPhrasesDetectionJobCommandOutput) => void + ): void; + public startKeyPhrasesDetectionJob( + args: StartKeyPhrasesDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartKeyPhrasesDetectionJobCommandOutput) => void + ): void; + public startKeyPhrasesDetectionJob( + args: StartKeyPhrasesDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StartKeyPhrasesDetectionJobCommandOutput) => void), + cb?: (err: any, data?: StartKeyPhrasesDetectionJobCommandOutput) => void + ): Promise | void { + const command = new StartKeyPhrasesDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Starts an asynchronous sentiment detection job for a collection of documents. use the + * operation to track the status of a + * job.

+ * + */ + public startSentimentDetectionJob( + args: StartSentimentDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public startSentimentDetectionJob( + args: StartSentimentDetectionJobCommandInput, + cb: (err: any, data?: StartSentimentDetectionJobCommandOutput) => void + ): void; + public startSentimentDetectionJob( + args: StartSentimentDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartSentimentDetectionJobCommandOutput) => void + ): void; + public startSentimentDetectionJob( + args: StartSentimentDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StartSentimentDetectionJobCommandOutput) => void), + cb?: (err: any, data?: StartSentimentDetectionJobCommandOutput) => void + ): Promise | void { + const command = new StartSentimentDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Starts an asynchronous topic detection job. Use the + * DescribeTopicDetectionJob operation to track the status of a job.

+ * + */ + public startTopicsDetectionJob( + args: StartTopicsDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public startTopicsDetectionJob( + args: StartTopicsDetectionJobCommandInput, + cb: (err: any, data?: StartTopicsDetectionJobCommandOutput) => void + ): void; + public startTopicsDetectionJob( + args: StartTopicsDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartTopicsDetectionJobCommandOutput) => void + ): void; + public startTopicsDetectionJob( + args: StartTopicsDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StartTopicsDetectionJobCommandOutput) => void), + cb?: (err: any, data?: StartTopicsDetectionJobCommandOutput) => void + ): Promise | void { + const command = new StartTopicsDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Stops a dominant language detection job in progress.

+ *

If the job state is IN_PROGRESS the job is marked for termination and put + * into the STOP_REQUESTED state. If the job completes before it can be stopped, it + * is put into the COMPLETED state; otherwise the job is stopped and put into the + * STOPPED state.

+ *

If the job is in the COMPLETED or FAILED state when you call the + * StopDominantLanguageDetectionJob operation, the operation returns a 400 + * Internal Request Exception.

+ *

When a job is stopped, any documents already processed are written to the output + * location.

+ * + */ + public stopDominantLanguageDetectionJob( + args: StopDominantLanguageDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public stopDominantLanguageDetectionJob( + args: StopDominantLanguageDetectionJobCommandInput, + cb: (err: any, data?: StopDominantLanguageDetectionJobCommandOutput) => void + ): void; + public stopDominantLanguageDetectionJob( + args: StopDominantLanguageDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopDominantLanguageDetectionJobCommandOutput) => void + ): void; + public stopDominantLanguageDetectionJob( + args: StopDominantLanguageDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: StopDominantLanguageDetectionJobCommandOutput + ) => void), + cb?: ( + err: any, + data?: StopDominantLanguageDetectionJobCommandOutput + ) => void + ): Promise | void { + const command = new StopDominantLanguageDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Stops an entities detection job in progress.

+ *

If the job state is IN_PROGRESS the job is marked for termination and put + * into the STOP_REQUESTED state. If the job completes before it can be stopped, it + * is put into the COMPLETED state; otherwise the job is stopped and put into the + * STOPPED state.

+ *

If the job is in the COMPLETED or FAILED state when you call the + * StopDominantLanguageDetectionJob operation, the operation returns a 400 + * Internal Request Exception.

+ *

When a job is stopped, any documents already processed are written to the output + * location.

+ * + */ + public stopEntitiesDetectionJob( + args: StopEntitiesDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public stopEntitiesDetectionJob( + args: StopEntitiesDetectionJobCommandInput, + cb: (err: any, data?: StopEntitiesDetectionJobCommandOutput) => void + ): void; + public stopEntitiesDetectionJob( + args: StopEntitiesDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopEntitiesDetectionJobCommandOutput) => void + ): void; + public stopEntitiesDetectionJob( + args: StopEntitiesDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StopEntitiesDetectionJobCommandOutput) => void), + cb?: (err: any, data?: StopEntitiesDetectionJobCommandOutput) => void + ): Promise | void { + const command = new StopEntitiesDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Stops a key phrases detection job in progress.

+ *

If the job state is IN_PROGRESS the job is marked for termination and put + * into the STOP_REQUESTED state. If the job completes before it can be stopped, it + * is put into the COMPLETED state; otherwise the job is stopped and put into the + * STOPPED state.

+ *

If the job is in the COMPLETED or FAILED state when you call the + * StopDominantLanguageDetectionJob operation, the operation returns a 400 + * Internal Request Exception.

+ *

When a job is stopped, any documents already processed are written to the output + * location.

+ * + */ + public stopKeyPhrasesDetectionJob( + args: StopKeyPhrasesDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public stopKeyPhrasesDetectionJob( + args: StopKeyPhrasesDetectionJobCommandInput, + cb: (err: any, data?: StopKeyPhrasesDetectionJobCommandOutput) => void + ): void; + public stopKeyPhrasesDetectionJob( + args: StopKeyPhrasesDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopKeyPhrasesDetectionJobCommandOutput) => void + ): void; + public stopKeyPhrasesDetectionJob( + args: StopKeyPhrasesDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StopKeyPhrasesDetectionJobCommandOutput) => void), + cb?: (err: any, data?: StopKeyPhrasesDetectionJobCommandOutput) => void + ): Promise | void { + const command = new StopKeyPhrasesDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Stops a sentiment detection job in progress.

+ *

If the job state is IN_PROGRESS the job is marked for termination and put + * into the STOP_REQUESTED state. If the job completes before it can be stopped, it + * is put into the COMPLETED state; otherwise the job is be stopped and put into the + * STOPPED state.

+ *

If the job is in the COMPLETED or FAILED state when you call the + * StopDominantLanguageDetectionJob operation, the operation returns a 400 + * Internal Request Exception.

+ *

When a job is stopped, any documents already processed are written to the output + * location.

+ * + */ + public stopSentimentDetectionJob( + args: StopSentimentDetectionJobCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public stopSentimentDetectionJob( + args: StopSentimentDetectionJobCommandInput, + cb: (err: any, data?: StopSentimentDetectionJobCommandOutput) => void + ): void; + public stopSentimentDetectionJob( + args: StopSentimentDetectionJobCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopSentimentDetectionJobCommandOutput) => void + ): void; + public stopSentimentDetectionJob( + args: StopSentimentDetectionJobCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StopSentimentDetectionJobCommandOutput) => void), + cb?: (err: any, data?: StopSentimentDetectionJobCommandOutput) => void + ): Promise | void { + const command = new StopSentimentDetectionJobCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Stops a document classifier training job while in progress.

+ *

If the training job state is TRAINING, the job is marked for termination + * and put into the STOP_REQUESTED state. If the training job completes before it can be + * stopped, it is put into the TRAINED; otherwise the training job is stopped and + * put into the STOPPED state and the service sends back an HTTP 200 response + * with an empty HTTP body.

+ * + * + */ + public stopTrainingDocumentClassifier( + args: StopTrainingDocumentClassifierCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public stopTrainingDocumentClassifier( + args: StopTrainingDocumentClassifierCommandInput, + cb: (err: any, data?: StopTrainingDocumentClassifierCommandOutput) => void + ): void; + public stopTrainingDocumentClassifier( + args: StopTrainingDocumentClassifierCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopTrainingDocumentClassifierCommandOutput) => void + ): void; + public stopTrainingDocumentClassifier( + args: StopTrainingDocumentClassifierCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | (( + err: any, + data?: StopTrainingDocumentClassifierCommandOutput + ) => void), + cb?: (err: any, data?: StopTrainingDocumentClassifierCommandOutput) => void + ): Promise | void { + const command = new StopTrainingDocumentClassifierCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Stops an entity recognizer training job while in progress.

+ *

If the training job state is TRAINING, the job is marked for termination and put into + * the STOP_REQUESTED state. If the training job completes before it can be stopped, it is put into the TRAINED; otherwise the + * training job is stopped and putted into the STOPPED state and the service sends back an HTTP 200 response with an empty HTTP body.

+ * + * + */ + public stopTrainingEntityRecognizer( + args: StopTrainingEntityRecognizerCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public stopTrainingEntityRecognizer( + args: StopTrainingEntityRecognizerCommandInput, + cb: (err: any, data?: StopTrainingEntityRecognizerCommandOutput) => void + ): void; + public stopTrainingEntityRecognizer( + args: StopTrainingEntityRecognizerCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopTrainingEntityRecognizerCommandOutput) => void + ): void; + public stopTrainingEntityRecognizer( + args: StopTrainingEntityRecognizerCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: StopTrainingEntityRecognizerCommandOutput) => void), + cb?: (err: any, data?: StopTrainingEntityRecognizerCommandOutput) => void + ): Promise | void { + const command = new StopTrainingEntityRecognizerCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Associates a specific tag with an Amazon Comprehend resource. A tag is a key-value pair that adds as a metadata to a resource used by Amazon Comprehend. + * For example, + * a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.

+ * + */ + public tagResource( + args: TagResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public tagResource( + args: TagResourceCommandInput, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + public tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + public tagResource( + args: TagResourceCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: TagResourceCommandOutput) => void), + cb?: (err: any, data?: TagResourceCommandOutput) => void + ): Promise | void { + const command = new TagResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Removes a specific tag associated with an Amazon Comprehend resource.

+ * + */ + public untagResource( + args: UntagResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public untagResource( + args: UntagResourceCommandInput, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + public untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + public untagResource( + args: UntagResourceCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UntagResourceCommandOutput) => void), + cb?: (err: any, data?: UntagResourceCommandOutput) => void + ): Promise | void { + const command = new UntagResourceCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + + /** + * + *

Updates information about the specified endpoint.

+ * + */ + public updateEndpoint( + args: UpdateEndpointCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateEndpoint( + args: UpdateEndpointCommandInput, + cb: (err: any, data?: UpdateEndpointCommandOutput) => void + ): void; + public updateEndpoint( + args: UpdateEndpointCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateEndpointCommandOutput) => void + ): void; + public updateEndpoint( + args: UpdateEndpointCommandInput, + optionsOrCb?: + | __HttpHandlerOptions + | ((err: any, data?: UpdateEndpointCommandOutput) => void), + cb?: (err: any, data?: UpdateEndpointCommandOutput) => void + ): Promise | void { + const command = new UpdateEndpointCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") + throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } +} diff --git a/clients/client-comprehend/ComprehendClient.ts b/clients/client-comprehend/ComprehendClient.ts new file mode 100644 index 000000000000..802c0ea8d229 --- /dev/null +++ b/clients/client-comprehend/ComprehendClient.ts @@ -0,0 +1,400 @@ +import { + BatchDetectDominantLanguageRequest, + BatchDetectDominantLanguageResponse, + BatchDetectEntitiesRequest, + BatchDetectEntitiesResponse, + BatchDetectKeyPhrasesRequest, + BatchDetectKeyPhrasesResponse, + BatchDetectSentimentRequest, + BatchDetectSentimentResponse, + BatchDetectSyntaxRequest, + BatchDetectSyntaxResponse, + ClassifyDocumentRequest, + ClassifyDocumentResponse, + CreateDocumentClassifierRequest, + CreateDocumentClassifierResponse, + CreateEndpointRequest, + CreateEndpointResponse, + CreateEntityRecognizerRequest, + CreateEntityRecognizerResponse, + DeleteDocumentClassifierRequest, + DeleteDocumentClassifierResponse, + DeleteEndpointRequest, + DeleteEndpointResponse, + DeleteEntityRecognizerRequest, + DeleteEntityRecognizerResponse, + DescribeDocumentClassificationJobRequest, + DescribeDocumentClassificationJobResponse, + DescribeDocumentClassifierRequest, + DescribeDocumentClassifierResponse, + DescribeDominantLanguageDetectionJobRequest, + DescribeDominantLanguageDetectionJobResponse, + DescribeEndpointRequest, + DescribeEndpointResponse, + DescribeEntitiesDetectionJobRequest, + DescribeEntitiesDetectionJobResponse, + DescribeEntityRecognizerRequest, + DescribeEntityRecognizerResponse, + DescribeKeyPhrasesDetectionJobRequest, + DescribeKeyPhrasesDetectionJobResponse, + DescribeSentimentDetectionJobRequest, + DescribeSentimentDetectionJobResponse, + DescribeTopicsDetectionJobRequest, + DescribeTopicsDetectionJobResponse, + DetectDominantLanguageRequest, + DetectDominantLanguageResponse, + DetectEntitiesRequest, + DetectEntitiesResponse, + DetectKeyPhrasesRequest, + DetectKeyPhrasesResponse, + DetectSentimentRequest, + DetectSentimentResponse, + DetectSyntaxRequest, + DetectSyntaxResponse, + ListDocumentClassificationJobsRequest, + ListDocumentClassificationJobsResponse, + ListDocumentClassifiersRequest, + ListDocumentClassifiersResponse, + ListDominantLanguageDetectionJobsRequest, + ListDominantLanguageDetectionJobsResponse, + ListEndpointsRequest, + ListEndpointsResponse, + ListEntitiesDetectionJobsRequest, + ListEntitiesDetectionJobsResponse, + ListEntityRecognizersRequest, + ListEntityRecognizersResponse, + ListKeyPhrasesDetectionJobsRequest, + ListKeyPhrasesDetectionJobsResponse, + ListSentimentDetectionJobsRequest, + ListSentimentDetectionJobsResponse, + ListTagsForResourceRequest, + ListTagsForResourceResponse, + ListTopicsDetectionJobsRequest, + ListTopicsDetectionJobsResponse, + StartDocumentClassificationJobRequest, + StartDocumentClassificationJobResponse, + StartDominantLanguageDetectionJobRequest, + StartDominantLanguageDetectionJobResponse, + StartEntitiesDetectionJobRequest, + StartEntitiesDetectionJobResponse, + StartKeyPhrasesDetectionJobRequest, + StartKeyPhrasesDetectionJobResponse, + StartSentimentDetectionJobRequest, + StartSentimentDetectionJobResponse, + StartTopicsDetectionJobRequest, + StartTopicsDetectionJobResponse, + StopDominantLanguageDetectionJobRequest, + StopDominantLanguageDetectionJobResponse, + StopEntitiesDetectionJobRequest, + StopEntitiesDetectionJobResponse, + StopKeyPhrasesDetectionJobRequest, + StopKeyPhrasesDetectionJobResponse, + StopSentimentDetectionJobRequest, + StopSentimentDetectionJobResponse, + StopTrainingDocumentClassifierRequest, + StopTrainingDocumentClassifierResponse, + StopTrainingEntityRecognizerRequest, + StopTrainingEntityRecognizerResponse, + TagResourceRequest, + TagResourceResponse, + UntagResourceRequest, + UntagResourceResponse, + UpdateEndpointRequest, + UpdateEndpointResponse +} from "./models/index"; +import { ClientDefaultValues as __ClientDefaultValues } from "./runtimeConfig"; +import { + EndpointsInputConfig, + EndpointsResolvedConfig, + RegionInputConfig, + RegionResolvedConfig, + resolveEndpointsConfig, + resolveRegionConfig +} from "@aws-sdk/config-resolver"; +import { getContentLengthPlugin } from "@aws-sdk/middleware-content-length"; +import { + HostHeaderInputConfig, + HostHeaderResolvedConfig, + getHostHeaderPlugin, + resolveHostHeaderConfig +} from "@aws-sdk/middleware-host-header"; +import { + RetryInputConfig, + RetryResolvedConfig, + getRetryPlugin, + resolveRetryConfig +} from "@aws-sdk/middleware-retry"; +import { + AwsAuthInputConfig, + AwsAuthResolvedConfig, + getAwsAuthPlugin, + resolveAwsAuthConfig +} from "@aws-sdk/middleware-signing"; +import { + UserAgentInputConfig, + UserAgentResolvedConfig, + getUserAgentPlugin, + resolveUserAgentConfig +} from "@aws-sdk/middleware-user-agent"; +import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http"; +import { + Client as __Client, + SmithyConfiguration as __SmithyConfiguration, + SmithyResolvedConfiguration as __SmithyResolvedConfiguration +} from "@aws-sdk/smithy-client"; +import { + RegionInfoProvider, + Credentials as __Credentials, + Decoder as __Decoder, + Encoder as __Encoder, + HashConstructor as __HashConstructor, + HttpHandlerOptions as __HttpHandlerOptions, + Provider as __Provider, + StreamCollector as __StreamCollector, + UrlParser as __UrlParser +} from "@aws-sdk/types"; + +export type ServiceInputTypes = + | BatchDetectDominantLanguageRequest + | BatchDetectEntitiesRequest + | BatchDetectKeyPhrasesRequest + | BatchDetectSentimentRequest + | BatchDetectSyntaxRequest + | ClassifyDocumentRequest + | CreateDocumentClassifierRequest + | CreateEndpointRequest + | CreateEntityRecognizerRequest + | DeleteDocumentClassifierRequest + | DeleteEndpointRequest + | DeleteEntityRecognizerRequest + | DescribeDocumentClassificationJobRequest + | DescribeDocumentClassifierRequest + | DescribeDominantLanguageDetectionJobRequest + | DescribeEndpointRequest + | DescribeEntitiesDetectionJobRequest + | DescribeEntityRecognizerRequest + | DescribeKeyPhrasesDetectionJobRequest + | DescribeSentimentDetectionJobRequest + | DescribeTopicsDetectionJobRequest + | DetectDominantLanguageRequest + | DetectEntitiesRequest + | DetectKeyPhrasesRequest + | DetectSentimentRequest + | DetectSyntaxRequest + | ListDocumentClassificationJobsRequest + | ListDocumentClassifiersRequest + | ListDominantLanguageDetectionJobsRequest + | ListEndpointsRequest + | ListEntitiesDetectionJobsRequest + | ListEntityRecognizersRequest + | ListKeyPhrasesDetectionJobsRequest + | ListSentimentDetectionJobsRequest + | ListTagsForResourceRequest + | ListTopicsDetectionJobsRequest + | StartDocumentClassificationJobRequest + | StartDominantLanguageDetectionJobRequest + | StartEntitiesDetectionJobRequest + | StartKeyPhrasesDetectionJobRequest + | StartSentimentDetectionJobRequest + | StartTopicsDetectionJobRequest + | StopDominantLanguageDetectionJobRequest + | StopEntitiesDetectionJobRequest + | StopKeyPhrasesDetectionJobRequest + | StopSentimentDetectionJobRequest + | StopTrainingDocumentClassifierRequest + | StopTrainingEntityRecognizerRequest + | TagResourceRequest + | UntagResourceRequest + | UpdateEndpointRequest; + +export type ServiceOutputTypes = + | BatchDetectDominantLanguageResponse + | BatchDetectEntitiesResponse + | BatchDetectKeyPhrasesResponse + | BatchDetectSentimentResponse + | BatchDetectSyntaxResponse + | ClassifyDocumentResponse + | CreateDocumentClassifierResponse + | CreateEndpointResponse + | CreateEntityRecognizerResponse + | DeleteDocumentClassifierResponse + | DeleteEndpointResponse + | DeleteEntityRecognizerResponse + | DescribeDocumentClassificationJobResponse + | DescribeDocumentClassifierResponse + | DescribeDominantLanguageDetectionJobResponse + | DescribeEndpointResponse + | DescribeEntitiesDetectionJobResponse + | DescribeEntityRecognizerResponse + | DescribeKeyPhrasesDetectionJobResponse + | DescribeSentimentDetectionJobResponse + | DescribeTopicsDetectionJobResponse + | DetectDominantLanguageResponse + | DetectEntitiesResponse + | DetectKeyPhrasesResponse + | DetectSentimentResponse + | DetectSyntaxResponse + | ListDocumentClassificationJobsResponse + | ListDocumentClassifiersResponse + | ListDominantLanguageDetectionJobsResponse + | ListEndpointsResponse + | ListEntitiesDetectionJobsResponse + | ListEntityRecognizersResponse + | ListKeyPhrasesDetectionJobsResponse + | ListSentimentDetectionJobsResponse + | ListTagsForResourceResponse + | ListTopicsDetectionJobsResponse + | StartDocumentClassificationJobResponse + | StartDominantLanguageDetectionJobResponse + | StartEntitiesDetectionJobResponse + | StartKeyPhrasesDetectionJobResponse + | StartSentimentDetectionJobResponse + | StartTopicsDetectionJobResponse + | StopDominantLanguageDetectionJobResponse + | StopEntitiesDetectionJobResponse + | StopKeyPhrasesDetectionJobResponse + | StopSentimentDetectionJobResponse + | StopTrainingDocumentClassifierResponse + | StopTrainingEntityRecognizerResponse + | TagResourceResponse + | UntagResourceResponse + | UpdateEndpointResponse; + +export interface ClientDefaults + extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> { + /** + * The HTTP handler to use. Fetch in browser and Https in Nodejs. + */ + requestHandler?: __HttpHandler; + + /** + * A constructor for a class implementing the @aws-sdk/types.Hash interface + * that computes the SHA-256 HMAC or checksum of a string or binary buffer. + */ + sha256?: __HashConstructor; + + /** + * The function that will be used to convert strings into HTTP endpoints. + */ + urlParser?: __UrlParser; + + /** + * A function that can calculate the length of a request body. + */ + bodyLengthChecker?: (body: any) => number | undefined; + + /** + * A function that converts a stream into an array of bytes. + */ + streamCollector?: __StreamCollector; + + /** + * The function that will be used to convert a base64-encoded string to a byte array + */ + base64Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a base64-encoded string + */ + base64Encoder?: __Encoder; + + /** + * The function that will be used to convert a UTF8-encoded string to a byte array + */ + utf8Decoder?: __Decoder; + + /** + * The function that will be used to convert binary data to a UTF-8 encoded string + */ + utf8Encoder?: __Encoder; + + /** + * The string that will be used to populate default value in 'User-Agent' header + */ + defaultUserAgent?: string; + + /** + * The runtime environment + */ + runtime?: string; + + /** + * The service name with which to sign requests. + */ + signingName?: string; + + /** + * Default credentials provider; Not available in browser runtime + */ + credentialDefaultProvider?: (input: any) => __Provider<__Credentials>; + + /** + * Provider function that return promise of a region string + */ + regionDefaultProvider?: (input: any) => __Provider; + + /** + * Fetch related hostname, signing name or signing region with given region. + */ + regionInfoProvider?: RegionInfoProvider; +} + +export type ComprehendClientConfig = Partial< + __SmithyConfiguration<__HttpHandlerOptions> +> & + ClientDefaults & + RegionInputConfig & + EndpointsInputConfig & + AwsAuthInputConfig & + RetryInputConfig & + UserAgentInputConfig & + HostHeaderInputConfig; + +export type ComprehendClientResolvedConfig = __SmithyResolvedConfiguration< + __HttpHandlerOptions +> & + Required & + RegionResolvedConfig & + EndpointsResolvedConfig & + AwsAuthResolvedConfig & + RetryResolvedConfig & + UserAgentResolvedConfig & + HostHeaderResolvedConfig; + +/** + * + *

Amazon Comprehend is an AWS service for gaining insight into the content of documents. Use these + * actions to determine the topics contained in your documents, the topics they discuss, the + * predominant sentiment expressed in them, the predominant language used, and more.

+ * + */ +export class ComprehendClient extends __Client< + __HttpHandlerOptions, + ServiceInputTypes, + ServiceOutputTypes, + ComprehendClientResolvedConfig +> { + readonly config: ComprehendClientResolvedConfig; + + constructor(configuration: ComprehendClientConfig) { + let _config_0 = { + ...__ClientDefaultValues, + ...configuration + }; + let _config_1 = resolveRegionConfig(_config_0); + let _config_2 = resolveEndpointsConfig(_config_1); + let _config_3 = resolveAwsAuthConfig(_config_2); + let _config_4 = resolveRetryConfig(_config_3); + let _config_5 = resolveUserAgentConfig(_config_4); + let _config_6 = resolveHostHeaderConfig(_config_5); + super(_config_6); + this.config = _config_6; + this.middlewareStack.use(getAwsAuthPlugin(this.config)); + this.middlewareStack.use(getRetryPlugin(this.config)); + this.middlewareStack.use(getUserAgentPlugin(this.config)); + this.middlewareStack.use(getContentLengthPlugin(this.config)); + this.middlewareStack.use(getHostHeaderPlugin(this.config)); + } + + destroy(): void {} +} diff --git a/clients/client-comprehend/LICENSE b/clients/client-comprehend/LICENSE new file mode 100644 index 000000000000..b7d2463d8cc0 --- /dev/null +++ b/clients/client-comprehend/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License 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. diff --git a/clients/client-comprehend/README.md b/clients/client-comprehend/README.md new file mode 100644 index 000000000000..b7b9da1d534c --- /dev/null +++ b/clients/client-comprehend/README.md @@ -0,0 +1,6 @@ +@aws-sdk/client-comprehend + +[![NPM version](https://img.shields.io/npm/v/@aws-sdk/client-comprehend/preview.svg)](https://www.npmjs.com/package/@aws-sdk/client-comprehend) +[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/client-comprehend.svg)](https://www.npmjs.com/package/@aws-sdk/client-comprehend) + +For SDK usage, please step to [SDK reademe](https://github.com/aws/aws-sdk-js-v3). diff --git a/clients/client-comprehend/commands/BatchDetectDominantLanguageCommand.ts b/clients/client-comprehend/commands/BatchDetectDominantLanguageCommand.ts new file mode 100644 index 000000000000..3458797d0e7d --- /dev/null +++ b/clients/client-comprehend/commands/BatchDetectDominantLanguageCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + BatchDetectDominantLanguageRequest, + BatchDetectDominantLanguageResponse +} from "../models/index"; +import { + deserializeAws_json1_1BatchDetectDominantLanguageCommand, + serializeAws_json1_1BatchDetectDominantLanguageCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type BatchDetectDominantLanguageCommandInput = BatchDetectDominantLanguageRequest; +export type BatchDetectDominantLanguageCommandOutput = BatchDetectDominantLanguageResponse; + +export class BatchDetectDominantLanguageCommand extends $Command< + BatchDetectDominantLanguageCommandInput, + BatchDetectDominantLanguageCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: BatchDetectDominantLanguageCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + BatchDetectDominantLanguageCommandInput, + BatchDetectDominantLanguageCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: BatchDetectDominantLanguageCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1BatchDetectDominantLanguageCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1BatchDetectDominantLanguageCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/BatchDetectEntitiesCommand.ts b/clients/client-comprehend/commands/BatchDetectEntitiesCommand.ts new file mode 100644 index 000000000000..95788ebf1ea7 --- /dev/null +++ b/clients/client-comprehend/commands/BatchDetectEntitiesCommand.ts @@ -0,0 +1,87 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + BatchDetectEntitiesRequest, + BatchDetectEntitiesResponse +} from "../models/index"; +import { + deserializeAws_json1_1BatchDetectEntitiesCommand, + serializeAws_json1_1BatchDetectEntitiesCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type BatchDetectEntitiesCommandInput = BatchDetectEntitiesRequest; +export type BatchDetectEntitiesCommandOutput = BatchDetectEntitiesResponse; + +export class BatchDetectEntitiesCommand extends $Command< + BatchDetectEntitiesCommandInput, + BatchDetectEntitiesCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: BatchDetectEntitiesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + BatchDetectEntitiesCommandInput, + BatchDetectEntitiesCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: BatchDetectEntitiesCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1BatchDetectEntitiesCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1BatchDetectEntitiesCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/BatchDetectKeyPhrasesCommand.ts b/clients/client-comprehend/commands/BatchDetectKeyPhrasesCommand.ts new file mode 100644 index 000000000000..0ce26a7c0dc5 --- /dev/null +++ b/clients/client-comprehend/commands/BatchDetectKeyPhrasesCommand.ts @@ -0,0 +1,87 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + BatchDetectKeyPhrasesRequest, + BatchDetectKeyPhrasesResponse +} from "../models/index"; +import { + deserializeAws_json1_1BatchDetectKeyPhrasesCommand, + serializeAws_json1_1BatchDetectKeyPhrasesCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type BatchDetectKeyPhrasesCommandInput = BatchDetectKeyPhrasesRequest; +export type BatchDetectKeyPhrasesCommandOutput = BatchDetectKeyPhrasesResponse; + +export class BatchDetectKeyPhrasesCommand extends $Command< + BatchDetectKeyPhrasesCommandInput, + BatchDetectKeyPhrasesCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: BatchDetectKeyPhrasesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + BatchDetectKeyPhrasesCommandInput, + BatchDetectKeyPhrasesCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: BatchDetectKeyPhrasesCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1BatchDetectKeyPhrasesCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1BatchDetectKeyPhrasesCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/BatchDetectSentimentCommand.ts b/clients/client-comprehend/commands/BatchDetectSentimentCommand.ts new file mode 100644 index 000000000000..c41dc158943c --- /dev/null +++ b/clients/client-comprehend/commands/BatchDetectSentimentCommand.ts @@ -0,0 +1,87 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + BatchDetectSentimentRequest, + BatchDetectSentimentResponse +} from "../models/index"; +import { + deserializeAws_json1_1BatchDetectSentimentCommand, + serializeAws_json1_1BatchDetectSentimentCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type BatchDetectSentimentCommandInput = BatchDetectSentimentRequest; +export type BatchDetectSentimentCommandOutput = BatchDetectSentimentResponse; + +export class BatchDetectSentimentCommand extends $Command< + BatchDetectSentimentCommandInput, + BatchDetectSentimentCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: BatchDetectSentimentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + BatchDetectSentimentCommandInput, + BatchDetectSentimentCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: BatchDetectSentimentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1BatchDetectSentimentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1BatchDetectSentimentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/BatchDetectSyntaxCommand.ts b/clients/client-comprehend/commands/BatchDetectSyntaxCommand.ts new file mode 100644 index 000000000000..42dce795efde --- /dev/null +++ b/clients/client-comprehend/commands/BatchDetectSyntaxCommand.ts @@ -0,0 +1,84 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + BatchDetectSyntaxRequest, + BatchDetectSyntaxResponse +} from "../models/index"; +import { + deserializeAws_json1_1BatchDetectSyntaxCommand, + serializeAws_json1_1BatchDetectSyntaxCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type BatchDetectSyntaxCommandInput = BatchDetectSyntaxRequest; +export type BatchDetectSyntaxCommandOutput = BatchDetectSyntaxResponse; + +export class BatchDetectSyntaxCommand extends $Command< + BatchDetectSyntaxCommandInput, + BatchDetectSyntaxCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: BatchDetectSyntaxCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: BatchDetectSyntaxCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1BatchDetectSyntaxCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1BatchDetectSyntaxCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ClassifyDocumentCommand.ts b/clients/client-comprehend/commands/ClassifyDocumentCommand.ts new file mode 100644 index 000000000000..6e25d34f0cca --- /dev/null +++ b/clients/client-comprehend/commands/ClassifyDocumentCommand.ts @@ -0,0 +1,84 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ClassifyDocumentRequest, + ClassifyDocumentResponse +} from "../models/index"; +import { + deserializeAws_json1_1ClassifyDocumentCommand, + serializeAws_json1_1ClassifyDocumentCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ClassifyDocumentCommandInput = ClassifyDocumentRequest; +export type ClassifyDocumentCommandOutput = ClassifyDocumentResponse; + +export class ClassifyDocumentCommand extends $Command< + ClassifyDocumentCommandInput, + ClassifyDocumentCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ClassifyDocumentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ClassifyDocumentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ClassifyDocumentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ClassifyDocumentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/CreateDocumentClassifierCommand.ts b/clients/client-comprehend/commands/CreateDocumentClassifierCommand.ts new file mode 100644 index 000000000000..44b8fc7c3fc2 --- /dev/null +++ b/clients/client-comprehend/commands/CreateDocumentClassifierCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + CreateDocumentClassifierRequest, + CreateDocumentClassifierResponse +} from "../models/index"; +import { + deserializeAws_json1_1CreateDocumentClassifierCommand, + serializeAws_json1_1CreateDocumentClassifierCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type CreateDocumentClassifierCommandInput = CreateDocumentClassifierRequest; +export type CreateDocumentClassifierCommandOutput = CreateDocumentClassifierResponse; + +export class CreateDocumentClassifierCommand extends $Command< + CreateDocumentClassifierCommandInput, + CreateDocumentClassifierCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateDocumentClassifierCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + CreateDocumentClassifierCommandInput, + CreateDocumentClassifierCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: CreateDocumentClassifierCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1CreateDocumentClassifierCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1CreateDocumentClassifierCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/CreateEndpointCommand.ts b/clients/client-comprehend/commands/CreateEndpointCommand.ts new file mode 100644 index 000000000000..cdbcec094530 --- /dev/null +++ b/clients/client-comprehend/commands/CreateEndpointCommand.ts @@ -0,0 +1,81 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { CreateEndpointRequest, CreateEndpointResponse } from "../models/index"; +import { + deserializeAws_json1_1CreateEndpointCommand, + serializeAws_json1_1CreateEndpointCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type CreateEndpointCommandInput = CreateEndpointRequest; +export type CreateEndpointCommandOutput = CreateEndpointResponse; + +export class CreateEndpointCommand extends $Command< + CreateEndpointCommandInput, + CreateEndpointCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateEndpointCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: CreateEndpointCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1CreateEndpointCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1CreateEndpointCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/CreateEntityRecognizerCommand.ts b/clients/client-comprehend/commands/CreateEntityRecognizerCommand.ts new file mode 100644 index 000000000000..ec341af92ac1 --- /dev/null +++ b/clients/client-comprehend/commands/CreateEntityRecognizerCommand.ts @@ -0,0 +1,87 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + CreateEntityRecognizerRequest, + CreateEntityRecognizerResponse +} from "../models/index"; +import { + deserializeAws_json1_1CreateEntityRecognizerCommand, + serializeAws_json1_1CreateEntityRecognizerCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type CreateEntityRecognizerCommandInput = CreateEntityRecognizerRequest; +export type CreateEntityRecognizerCommandOutput = CreateEntityRecognizerResponse; + +export class CreateEntityRecognizerCommand extends $Command< + CreateEntityRecognizerCommandInput, + CreateEntityRecognizerCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateEntityRecognizerCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + CreateEntityRecognizerCommandInput, + CreateEntityRecognizerCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: CreateEntityRecognizerCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1CreateEntityRecognizerCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1CreateEntityRecognizerCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DeleteDocumentClassifierCommand.ts b/clients/client-comprehend/commands/DeleteDocumentClassifierCommand.ts new file mode 100644 index 000000000000..005b40d748f9 --- /dev/null +++ b/clients/client-comprehend/commands/DeleteDocumentClassifierCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DeleteDocumentClassifierRequest, + DeleteDocumentClassifierResponse +} from "../models/index"; +import { + deserializeAws_json1_1DeleteDocumentClassifierCommand, + serializeAws_json1_1DeleteDocumentClassifierCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DeleteDocumentClassifierCommandInput = DeleteDocumentClassifierRequest; +export type DeleteDocumentClassifierCommandOutput = DeleteDocumentClassifierResponse; + +export class DeleteDocumentClassifierCommand extends $Command< + DeleteDocumentClassifierCommandInput, + DeleteDocumentClassifierCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteDocumentClassifierCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DeleteDocumentClassifierCommandInput, + DeleteDocumentClassifierCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DeleteDocumentClassifierCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DeleteDocumentClassifierCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DeleteDocumentClassifierCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DeleteEndpointCommand.ts b/clients/client-comprehend/commands/DeleteEndpointCommand.ts new file mode 100644 index 000000000000..ec1dfeeda42f --- /dev/null +++ b/clients/client-comprehend/commands/DeleteEndpointCommand.ts @@ -0,0 +1,81 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { DeleteEndpointRequest, DeleteEndpointResponse } from "../models/index"; +import { + deserializeAws_json1_1DeleteEndpointCommand, + serializeAws_json1_1DeleteEndpointCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DeleteEndpointCommandInput = DeleteEndpointRequest; +export type DeleteEndpointCommandOutput = DeleteEndpointResponse; + +export class DeleteEndpointCommand extends $Command< + DeleteEndpointCommandInput, + DeleteEndpointCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteEndpointCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DeleteEndpointCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DeleteEndpointCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DeleteEndpointCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DeleteEntityRecognizerCommand.ts b/clients/client-comprehend/commands/DeleteEntityRecognizerCommand.ts new file mode 100644 index 000000000000..5d0d553587ce --- /dev/null +++ b/clients/client-comprehend/commands/DeleteEntityRecognizerCommand.ts @@ -0,0 +1,87 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DeleteEntityRecognizerRequest, + DeleteEntityRecognizerResponse +} from "../models/index"; +import { + deserializeAws_json1_1DeleteEntityRecognizerCommand, + serializeAws_json1_1DeleteEntityRecognizerCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DeleteEntityRecognizerCommandInput = DeleteEntityRecognizerRequest; +export type DeleteEntityRecognizerCommandOutput = DeleteEntityRecognizerResponse; + +export class DeleteEntityRecognizerCommand extends $Command< + DeleteEntityRecognizerCommandInput, + DeleteEntityRecognizerCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteEntityRecognizerCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DeleteEntityRecognizerCommandInput, + DeleteEntityRecognizerCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DeleteEntityRecognizerCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DeleteEntityRecognizerCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DeleteEntityRecognizerCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeDocumentClassificationJobCommand.ts b/clients/client-comprehend/commands/DescribeDocumentClassificationJobCommand.ts new file mode 100644 index 000000000000..6fe274e78344 --- /dev/null +++ b/clients/client-comprehend/commands/DescribeDocumentClassificationJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeDocumentClassificationJobRequest, + DescribeDocumentClassificationJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeDocumentClassificationJobCommand, + serializeAws_json1_1DescribeDocumentClassificationJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeDocumentClassificationJobCommandInput = DescribeDocumentClassificationJobRequest; +export type DescribeDocumentClassificationJobCommandOutput = DescribeDocumentClassificationJobResponse; + +export class DescribeDocumentClassificationJobCommand extends $Command< + DescribeDocumentClassificationJobCommandInput, + DescribeDocumentClassificationJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeDocumentClassificationJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeDocumentClassificationJobCommandInput, + DescribeDocumentClassificationJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeDocumentClassificationJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeDocumentClassificationJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeDocumentClassificationJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeDocumentClassifierCommand.ts b/clients/client-comprehend/commands/DescribeDocumentClassifierCommand.ts new file mode 100644 index 000000000000..1bf5c6170e36 --- /dev/null +++ b/clients/client-comprehend/commands/DescribeDocumentClassifierCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeDocumentClassifierRequest, + DescribeDocumentClassifierResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeDocumentClassifierCommand, + serializeAws_json1_1DescribeDocumentClassifierCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeDocumentClassifierCommandInput = DescribeDocumentClassifierRequest; +export type DescribeDocumentClassifierCommandOutput = DescribeDocumentClassifierResponse; + +export class DescribeDocumentClassifierCommand extends $Command< + DescribeDocumentClassifierCommandInput, + DescribeDocumentClassifierCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeDocumentClassifierCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeDocumentClassifierCommandInput, + DescribeDocumentClassifierCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeDocumentClassifierCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeDocumentClassifierCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeDocumentClassifierCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeDominantLanguageDetectionJobCommand.ts b/clients/client-comprehend/commands/DescribeDominantLanguageDetectionJobCommand.ts new file mode 100644 index 000000000000..6c66dc819c68 --- /dev/null +++ b/clients/client-comprehend/commands/DescribeDominantLanguageDetectionJobCommand.ts @@ -0,0 +1,95 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeDominantLanguageDetectionJobRequest, + DescribeDominantLanguageDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommand, + serializeAws_json1_1DescribeDominantLanguageDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeDominantLanguageDetectionJobCommandInput = DescribeDominantLanguageDetectionJobRequest; +export type DescribeDominantLanguageDetectionJobCommandOutput = DescribeDominantLanguageDetectionJobResponse; + +export class DescribeDominantLanguageDetectionJobCommand extends $Command< + DescribeDominantLanguageDetectionJobCommandInput, + DescribeDominantLanguageDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor( + readonly input: DescribeDominantLanguageDetectionJobCommandInput + ) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeDominantLanguageDetectionJobCommandInput, + DescribeDominantLanguageDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeDominantLanguageDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeDominantLanguageDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeEndpointCommand.ts b/clients/client-comprehend/commands/DescribeEndpointCommand.ts new file mode 100644 index 000000000000..ad873e8218c6 --- /dev/null +++ b/clients/client-comprehend/commands/DescribeEndpointCommand.ts @@ -0,0 +1,84 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeEndpointRequest, + DescribeEndpointResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeEndpointCommand, + serializeAws_json1_1DescribeEndpointCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeEndpointCommandInput = DescribeEndpointRequest; +export type DescribeEndpointCommandOutput = DescribeEndpointResponse; + +export class DescribeEndpointCommand extends $Command< + DescribeEndpointCommandInput, + DescribeEndpointCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeEndpointCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeEndpointCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeEndpointCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeEndpointCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeEntitiesDetectionJobCommand.ts b/clients/client-comprehend/commands/DescribeEntitiesDetectionJobCommand.ts new file mode 100644 index 000000000000..0fc8464920ea --- /dev/null +++ b/clients/client-comprehend/commands/DescribeEntitiesDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeEntitiesDetectionJobRequest, + DescribeEntitiesDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeEntitiesDetectionJobCommand, + serializeAws_json1_1DescribeEntitiesDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeEntitiesDetectionJobCommandInput = DescribeEntitiesDetectionJobRequest; +export type DescribeEntitiesDetectionJobCommandOutput = DescribeEntitiesDetectionJobResponse; + +export class DescribeEntitiesDetectionJobCommand extends $Command< + DescribeEntitiesDetectionJobCommandInput, + DescribeEntitiesDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeEntitiesDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeEntitiesDetectionJobCommandInput, + DescribeEntitiesDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeEntitiesDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeEntitiesDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeEntitiesDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeEntityRecognizerCommand.ts b/clients/client-comprehend/commands/DescribeEntityRecognizerCommand.ts new file mode 100644 index 000000000000..9713a4c2047b --- /dev/null +++ b/clients/client-comprehend/commands/DescribeEntityRecognizerCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeEntityRecognizerRequest, + DescribeEntityRecognizerResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeEntityRecognizerCommand, + serializeAws_json1_1DescribeEntityRecognizerCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeEntityRecognizerCommandInput = DescribeEntityRecognizerRequest; +export type DescribeEntityRecognizerCommandOutput = DescribeEntityRecognizerResponse; + +export class DescribeEntityRecognizerCommand extends $Command< + DescribeEntityRecognizerCommandInput, + DescribeEntityRecognizerCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeEntityRecognizerCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeEntityRecognizerCommandInput, + DescribeEntityRecognizerCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeEntityRecognizerCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeEntityRecognizerCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeEntityRecognizerCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeKeyPhrasesDetectionJobCommand.ts b/clients/client-comprehend/commands/DescribeKeyPhrasesDetectionJobCommand.ts new file mode 100644 index 000000000000..f5df90ee2e89 --- /dev/null +++ b/clients/client-comprehend/commands/DescribeKeyPhrasesDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeKeyPhrasesDetectionJobRequest, + DescribeKeyPhrasesDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand, + serializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeKeyPhrasesDetectionJobCommandInput = DescribeKeyPhrasesDetectionJobRequest; +export type DescribeKeyPhrasesDetectionJobCommandOutput = DescribeKeyPhrasesDetectionJobResponse; + +export class DescribeKeyPhrasesDetectionJobCommand extends $Command< + DescribeKeyPhrasesDetectionJobCommandInput, + DescribeKeyPhrasesDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeKeyPhrasesDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeKeyPhrasesDetectionJobCommandInput, + DescribeKeyPhrasesDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeKeyPhrasesDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeSentimentDetectionJobCommand.ts b/clients/client-comprehend/commands/DescribeSentimentDetectionJobCommand.ts new file mode 100644 index 000000000000..0eb4ed34b6ab --- /dev/null +++ b/clients/client-comprehend/commands/DescribeSentimentDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeSentimentDetectionJobRequest, + DescribeSentimentDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeSentimentDetectionJobCommand, + serializeAws_json1_1DescribeSentimentDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeSentimentDetectionJobCommandInput = DescribeSentimentDetectionJobRequest; +export type DescribeSentimentDetectionJobCommandOutput = DescribeSentimentDetectionJobResponse; + +export class DescribeSentimentDetectionJobCommand extends $Command< + DescribeSentimentDetectionJobCommandInput, + DescribeSentimentDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeSentimentDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeSentimentDetectionJobCommandInput, + DescribeSentimentDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeSentimentDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeSentimentDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeSentimentDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DescribeTopicsDetectionJobCommand.ts b/clients/client-comprehend/commands/DescribeTopicsDetectionJobCommand.ts new file mode 100644 index 000000000000..baafd8b4c984 --- /dev/null +++ b/clients/client-comprehend/commands/DescribeTopicsDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DescribeTopicsDetectionJobRequest, + DescribeTopicsDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1DescribeTopicsDetectionJobCommand, + serializeAws_json1_1DescribeTopicsDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DescribeTopicsDetectionJobCommandInput = DescribeTopicsDetectionJobRequest; +export type DescribeTopicsDetectionJobCommandOutput = DescribeTopicsDetectionJobResponse; + +export class DescribeTopicsDetectionJobCommand extends $Command< + DescribeTopicsDetectionJobCommandInput, + DescribeTopicsDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DescribeTopicsDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DescribeTopicsDetectionJobCommandInput, + DescribeTopicsDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DescribeTopicsDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DescribeTopicsDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DescribeTopicsDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DetectDominantLanguageCommand.ts b/clients/client-comprehend/commands/DetectDominantLanguageCommand.ts new file mode 100644 index 000000000000..1011a5b81b2b --- /dev/null +++ b/clients/client-comprehend/commands/DetectDominantLanguageCommand.ts @@ -0,0 +1,87 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DetectDominantLanguageRequest, + DetectDominantLanguageResponse +} from "../models/index"; +import { + deserializeAws_json1_1DetectDominantLanguageCommand, + serializeAws_json1_1DetectDominantLanguageCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DetectDominantLanguageCommandInput = DetectDominantLanguageRequest; +export type DetectDominantLanguageCommandOutput = DetectDominantLanguageResponse; + +export class DetectDominantLanguageCommand extends $Command< + DetectDominantLanguageCommandInput, + DetectDominantLanguageCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DetectDominantLanguageCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + DetectDominantLanguageCommandInput, + DetectDominantLanguageCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DetectDominantLanguageCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DetectDominantLanguageCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DetectDominantLanguageCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DetectEntitiesCommand.ts b/clients/client-comprehend/commands/DetectEntitiesCommand.ts new file mode 100644 index 000000000000..c0551dcf0c6d --- /dev/null +++ b/clients/client-comprehend/commands/DetectEntitiesCommand.ts @@ -0,0 +1,81 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { DetectEntitiesRequest, DetectEntitiesResponse } from "../models/index"; +import { + deserializeAws_json1_1DetectEntitiesCommand, + serializeAws_json1_1DetectEntitiesCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DetectEntitiesCommandInput = DetectEntitiesRequest; +export type DetectEntitiesCommandOutput = DetectEntitiesResponse; + +export class DetectEntitiesCommand extends $Command< + DetectEntitiesCommandInput, + DetectEntitiesCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DetectEntitiesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DetectEntitiesCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DetectEntitiesCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DetectEntitiesCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DetectKeyPhrasesCommand.ts b/clients/client-comprehend/commands/DetectKeyPhrasesCommand.ts new file mode 100644 index 000000000000..8d67e869fb07 --- /dev/null +++ b/clients/client-comprehend/commands/DetectKeyPhrasesCommand.ts @@ -0,0 +1,84 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DetectKeyPhrasesRequest, + DetectKeyPhrasesResponse +} from "../models/index"; +import { + deserializeAws_json1_1DetectKeyPhrasesCommand, + serializeAws_json1_1DetectKeyPhrasesCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DetectKeyPhrasesCommandInput = DetectKeyPhrasesRequest; +export type DetectKeyPhrasesCommandOutput = DetectKeyPhrasesResponse; + +export class DetectKeyPhrasesCommand extends $Command< + DetectKeyPhrasesCommandInput, + DetectKeyPhrasesCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DetectKeyPhrasesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DetectKeyPhrasesCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DetectKeyPhrasesCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DetectKeyPhrasesCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DetectSentimentCommand.ts b/clients/client-comprehend/commands/DetectSentimentCommand.ts new file mode 100644 index 000000000000..bda052fc351f --- /dev/null +++ b/clients/client-comprehend/commands/DetectSentimentCommand.ts @@ -0,0 +1,84 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + DetectSentimentRequest, + DetectSentimentResponse +} from "../models/index"; +import { + deserializeAws_json1_1DetectSentimentCommand, + serializeAws_json1_1DetectSentimentCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DetectSentimentCommandInput = DetectSentimentRequest; +export type DetectSentimentCommandOutput = DetectSentimentResponse; + +export class DetectSentimentCommand extends $Command< + DetectSentimentCommandInput, + DetectSentimentCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DetectSentimentCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DetectSentimentCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DetectSentimentCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DetectSentimentCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/DetectSyntaxCommand.ts b/clients/client-comprehend/commands/DetectSyntaxCommand.ts new file mode 100644 index 000000000000..b41cb9d60b6c --- /dev/null +++ b/clients/client-comprehend/commands/DetectSyntaxCommand.ts @@ -0,0 +1,81 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { DetectSyntaxRequest, DetectSyntaxResponse } from "../models/index"; +import { + deserializeAws_json1_1DetectSyntaxCommand, + serializeAws_json1_1DetectSyntaxCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type DetectSyntaxCommandInput = DetectSyntaxRequest; +export type DetectSyntaxCommandOutput = DetectSyntaxResponse; + +export class DetectSyntaxCommand extends $Command< + DetectSyntaxCommandInput, + DetectSyntaxCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DetectSyntaxCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DetectSyntaxCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DetectSyntaxCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1DetectSyntaxCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListDocumentClassificationJobsCommand.ts b/clients/client-comprehend/commands/ListDocumentClassificationJobsCommand.ts new file mode 100644 index 000000000000..78e73370e52a --- /dev/null +++ b/clients/client-comprehend/commands/ListDocumentClassificationJobsCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListDocumentClassificationJobsRequest, + ListDocumentClassificationJobsResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListDocumentClassificationJobsCommand, + serializeAws_json1_1ListDocumentClassificationJobsCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListDocumentClassificationJobsCommandInput = ListDocumentClassificationJobsRequest; +export type ListDocumentClassificationJobsCommandOutput = ListDocumentClassificationJobsResponse; + +export class ListDocumentClassificationJobsCommand extends $Command< + ListDocumentClassificationJobsCommandInput, + ListDocumentClassificationJobsCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListDocumentClassificationJobsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListDocumentClassificationJobsCommandInput, + ListDocumentClassificationJobsCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListDocumentClassificationJobsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListDocumentClassificationJobsCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListDocumentClassificationJobsCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListDocumentClassifiersCommand.ts b/clients/client-comprehend/commands/ListDocumentClassifiersCommand.ts new file mode 100644 index 000000000000..851325244ca2 --- /dev/null +++ b/clients/client-comprehend/commands/ListDocumentClassifiersCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListDocumentClassifiersRequest, + ListDocumentClassifiersResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListDocumentClassifiersCommand, + serializeAws_json1_1ListDocumentClassifiersCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListDocumentClassifiersCommandInput = ListDocumentClassifiersRequest; +export type ListDocumentClassifiersCommandOutput = ListDocumentClassifiersResponse; + +export class ListDocumentClassifiersCommand extends $Command< + ListDocumentClassifiersCommandInput, + ListDocumentClassifiersCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListDocumentClassifiersCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListDocumentClassifiersCommandInput, + ListDocumentClassifiersCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListDocumentClassifiersCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListDocumentClassifiersCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListDocumentClassifiersCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListDominantLanguageDetectionJobsCommand.ts b/clients/client-comprehend/commands/ListDominantLanguageDetectionJobsCommand.ts new file mode 100644 index 000000000000..4f95927e5aac --- /dev/null +++ b/clients/client-comprehend/commands/ListDominantLanguageDetectionJobsCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListDominantLanguageDetectionJobsRequest, + ListDominantLanguageDetectionJobsResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListDominantLanguageDetectionJobsCommand, + serializeAws_json1_1ListDominantLanguageDetectionJobsCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListDominantLanguageDetectionJobsCommandInput = ListDominantLanguageDetectionJobsRequest; +export type ListDominantLanguageDetectionJobsCommandOutput = ListDominantLanguageDetectionJobsResponse; + +export class ListDominantLanguageDetectionJobsCommand extends $Command< + ListDominantLanguageDetectionJobsCommandInput, + ListDominantLanguageDetectionJobsCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListDominantLanguageDetectionJobsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListDominantLanguageDetectionJobsCommandInput, + ListDominantLanguageDetectionJobsCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListDominantLanguageDetectionJobsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListDominantLanguageDetectionJobsCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListDominantLanguageDetectionJobsCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListEndpointsCommand.ts b/clients/client-comprehend/commands/ListEndpointsCommand.ts new file mode 100644 index 000000000000..421e08e94da2 --- /dev/null +++ b/clients/client-comprehend/commands/ListEndpointsCommand.ts @@ -0,0 +1,81 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { ListEndpointsRequest, ListEndpointsResponse } from "../models/index"; +import { + deserializeAws_json1_1ListEndpointsCommand, + serializeAws_json1_1ListEndpointsCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListEndpointsCommandInput = ListEndpointsRequest; +export type ListEndpointsCommandOutput = ListEndpointsResponse; + +export class ListEndpointsCommand extends $Command< + ListEndpointsCommandInput, + ListEndpointsCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListEndpointsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListEndpointsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListEndpointsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListEndpointsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListEntitiesDetectionJobsCommand.ts b/clients/client-comprehend/commands/ListEntitiesDetectionJobsCommand.ts new file mode 100644 index 000000000000..03a3448292e4 --- /dev/null +++ b/clients/client-comprehend/commands/ListEntitiesDetectionJobsCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListEntitiesDetectionJobsRequest, + ListEntitiesDetectionJobsResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListEntitiesDetectionJobsCommand, + serializeAws_json1_1ListEntitiesDetectionJobsCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListEntitiesDetectionJobsCommandInput = ListEntitiesDetectionJobsRequest; +export type ListEntitiesDetectionJobsCommandOutput = ListEntitiesDetectionJobsResponse; + +export class ListEntitiesDetectionJobsCommand extends $Command< + ListEntitiesDetectionJobsCommandInput, + ListEntitiesDetectionJobsCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListEntitiesDetectionJobsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListEntitiesDetectionJobsCommandInput, + ListEntitiesDetectionJobsCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListEntitiesDetectionJobsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListEntitiesDetectionJobsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListEntitiesDetectionJobsCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListEntityRecognizersCommand.ts b/clients/client-comprehend/commands/ListEntityRecognizersCommand.ts new file mode 100644 index 000000000000..2b487f83d23b --- /dev/null +++ b/clients/client-comprehend/commands/ListEntityRecognizersCommand.ts @@ -0,0 +1,87 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListEntityRecognizersRequest, + ListEntityRecognizersResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListEntityRecognizersCommand, + serializeAws_json1_1ListEntityRecognizersCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListEntityRecognizersCommandInput = ListEntityRecognizersRequest; +export type ListEntityRecognizersCommandOutput = ListEntityRecognizersResponse; + +export class ListEntityRecognizersCommand extends $Command< + ListEntityRecognizersCommandInput, + ListEntityRecognizersCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListEntityRecognizersCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListEntityRecognizersCommandInput, + ListEntityRecognizersCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListEntityRecognizersCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListEntityRecognizersCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListEntityRecognizersCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListKeyPhrasesDetectionJobsCommand.ts b/clients/client-comprehend/commands/ListKeyPhrasesDetectionJobsCommand.ts new file mode 100644 index 000000000000..6bc92c6ed53f --- /dev/null +++ b/clients/client-comprehend/commands/ListKeyPhrasesDetectionJobsCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListKeyPhrasesDetectionJobsRequest, + ListKeyPhrasesDetectionJobsResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommand, + serializeAws_json1_1ListKeyPhrasesDetectionJobsCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListKeyPhrasesDetectionJobsCommandInput = ListKeyPhrasesDetectionJobsRequest; +export type ListKeyPhrasesDetectionJobsCommandOutput = ListKeyPhrasesDetectionJobsResponse; + +export class ListKeyPhrasesDetectionJobsCommand extends $Command< + ListKeyPhrasesDetectionJobsCommandInput, + ListKeyPhrasesDetectionJobsCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListKeyPhrasesDetectionJobsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListKeyPhrasesDetectionJobsCommandInput, + ListKeyPhrasesDetectionJobsCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListKeyPhrasesDetectionJobsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListKeyPhrasesDetectionJobsCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListSentimentDetectionJobsCommand.ts b/clients/client-comprehend/commands/ListSentimentDetectionJobsCommand.ts new file mode 100644 index 000000000000..48de3a562ea9 --- /dev/null +++ b/clients/client-comprehend/commands/ListSentimentDetectionJobsCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListSentimentDetectionJobsRequest, + ListSentimentDetectionJobsResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListSentimentDetectionJobsCommand, + serializeAws_json1_1ListSentimentDetectionJobsCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListSentimentDetectionJobsCommandInput = ListSentimentDetectionJobsRequest; +export type ListSentimentDetectionJobsCommandOutput = ListSentimentDetectionJobsResponse; + +export class ListSentimentDetectionJobsCommand extends $Command< + ListSentimentDetectionJobsCommandInput, + ListSentimentDetectionJobsCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListSentimentDetectionJobsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListSentimentDetectionJobsCommandInput, + ListSentimentDetectionJobsCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListSentimentDetectionJobsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListSentimentDetectionJobsCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListSentimentDetectionJobsCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListTagsForResourceCommand.ts b/clients/client-comprehend/commands/ListTagsForResourceCommand.ts new file mode 100644 index 000000000000..69faa0fdfba1 --- /dev/null +++ b/clients/client-comprehend/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,87 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListTagsForResourceRequest, + ListTagsForResourceResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListTagsForResourceCommand, + serializeAws_json1_1ListTagsForResourceCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListTagsForResourceCommandInput = ListTagsForResourceRequest; +export type ListTagsForResourceCommandOutput = ListTagsForResourceResponse; + +export class ListTagsForResourceCommand extends $Command< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListTagsForResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListTagsForResourceCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListTagsForResourceCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListTagsForResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/ListTopicsDetectionJobsCommand.ts b/clients/client-comprehend/commands/ListTopicsDetectionJobsCommand.ts new file mode 100644 index 000000000000..269c4cc8da0f --- /dev/null +++ b/clients/client-comprehend/commands/ListTopicsDetectionJobsCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + ListTopicsDetectionJobsRequest, + ListTopicsDetectionJobsResponse +} from "../models/index"; +import { + deserializeAws_json1_1ListTopicsDetectionJobsCommand, + serializeAws_json1_1ListTopicsDetectionJobsCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type ListTopicsDetectionJobsCommandInput = ListTopicsDetectionJobsRequest; +export type ListTopicsDetectionJobsCommandOutput = ListTopicsDetectionJobsResponse; + +export class ListTopicsDetectionJobsCommand extends $Command< + ListTopicsDetectionJobsCommandInput, + ListTopicsDetectionJobsCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListTopicsDetectionJobsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + ListTopicsDetectionJobsCommandInput, + ListTopicsDetectionJobsCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListTopicsDetectionJobsCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListTopicsDetectionJobsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1ListTopicsDetectionJobsCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StartDocumentClassificationJobCommand.ts b/clients/client-comprehend/commands/StartDocumentClassificationJobCommand.ts new file mode 100644 index 000000000000..e16d1a7b1e6b --- /dev/null +++ b/clients/client-comprehend/commands/StartDocumentClassificationJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StartDocumentClassificationJobRequest, + StartDocumentClassificationJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StartDocumentClassificationJobCommand, + serializeAws_json1_1StartDocumentClassificationJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StartDocumentClassificationJobCommandInput = StartDocumentClassificationJobRequest; +export type StartDocumentClassificationJobCommandOutput = StartDocumentClassificationJobResponse; + +export class StartDocumentClassificationJobCommand extends $Command< + StartDocumentClassificationJobCommandInput, + StartDocumentClassificationJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StartDocumentClassificationJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StartDocumentClassificationJobCommandInput, + StartDocumentClassificationJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StartDocumentClassificationJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StartDocumentClassificationJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StartDocumentClassificationJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StartDominantLanguageDetectionJobCommand.ts b/clients/client-comprehend/commands/StartDominantLanguageDetectionJobCommand.ts new file mode 100644 index 000000000000..9e31c3a2ec0c --- /dev/null +++ b/clients/client-comprehend/commands/StartDominantLanguageDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StartDominantLanguageDetectionJobRequest, + StartDominantLanguageDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StartDominantLanguageDetectionJobCommand, + serializeAws_json1_1StartDominantLanguageDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StartDominantLanguageDetectionJobCommandInput = StartDominantLanguageDetectionJobRequest; +export type StartDominantLanguageDetectionJobCommandOutput = StartDominantLanguageDetectionJobResponse; + +export class StartDominantLanguageDetectionJobCommand extends $Command< + StartDominantLanguageDetectionJobCommandInput, + StartDominantLanguageDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StartDominantLanguageDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StartDominantLanguageDetectionJobCommandInput, + StartDominantLanguageDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StartDominantLanguageDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StartDominantLanguageDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StartDominantLanguageDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StartEntitiesDetectionJobCommand.ts b/clients/client-comprehend/commands/StartEntitiesDetectionJobCommand.ts new file mode 100644 index 000000000000..0c78e1ab189d --- /dev/null +++ b/clients/client-comprehend/commands/StartEntitiesDetectionJobCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StartEntitiesDetectionJobRequest, + StartEntitiesDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StartEntitiesDetectionJobCommand, + serializeAws_json1_1StartEntitiesDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StartEntitiesDetectionJobCommandInput = StartEntitiesDetectionJobRequest; +export type StartEntitiesDetectionJobCommandOutput = StartEntitiesDetectionJobResponse; + +export class StartEntitiesDetectionJobCommand extends $Command< + StartEntitiesDetectionJobCommandInput, + StartEntitiesDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StartEntitiesDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StartEntitiesDetectionJobCommandInput, + StartEntitiesDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StartEntitiesDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StartEntitiesDetectionJobCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StartEntitiesDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StartKeyPhrasesDetectionJobCommand.ts b/clients/client-comprehend/commands/StartKeyPhrasesDetectionJobCommand.ts new file mode 100644 index 000000000000..3955f839b801 --- /dev/null +++ b/clients/client-comprehend/commands/StartKeyPhrasesDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StartKeyPhrasesDetectionJobRequest, + StartKeyPhrasesDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StartKeyPhrasesDetectionJobCommand, + serializeAws_json1_1StartKeyPhrasesDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StartKeyPhrasesDetectionJobCommandInput = StartKeyPhrasesDetectionJobRequest; +export type StartKeyPhrasesDetectionJobCommandOutput = StartKeyPhrasesDetectionJobResponse; + +export class StartKeyPhrasesDetectionJobCommand extends $Command< + StartKeyPhrasesDetectionJobCommandInput, + StartKeyPhrasesDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StartKeyPhrasesDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StartKeyPhrasesDetectionJobCommandInput, + StartKeyPhrasesDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StartKeyPhrasesDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StartKeyPhrasesDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StartKeyPhrasesDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StartSentimentDetectionJobCommand.ts b/clients/client-comprehend/commands/StartSentimentDetectionJobCommand.ts new file mode 100644 index 000000000000..34214ef3761f --- /dev/null +++ b/clients/client-comprehend/commands/StartSentimentDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StartSentimentDetectionJobRequest, + StartSentimentDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StartSentimentDetectionJobCommand, + serializeAws_json1_1StartSentimentDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StartSentimentDetectionJobCommandInput = StartSentimentDetectionJobRequest; +export type StartSentimentDetectionJobCommandOutput = StartSentimentDetectionJobResponse; + +export class StartSentimentDetectionJobCommand extends $Command< + StartSentimentDetectionJobCommandInput, + StartSentimentDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StartSentimentDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StartSentimentDetectionJobCommandInput, + StartSentimentDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StartSentimentDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StartSentimentDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StartSentimentDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StartTopicsDetectionJobCommand.ts b/clients/client-comprehend/commands/StartTopicsDetectionJobCommand.ts new file mode 100644 index 000000000000..df231f239fc2 --- /dev/null +++ b/clients/client-comprehend/commands/StartTopicsDetectionJobCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StartTopicsDetectionJobRequest, + StartTopicsDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StartTopicsDetectionJobCommand, + serializeAws_json1_1StartTopicsDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StartTopicsDetectionJobCommandInput = StartTopicsDetectionJobRequest; +export type StartTopicsDetectionJobCommandOutput = StartTopicsDetectionJobResponse; + +export class StartTopicsDetectionJobCommand extends $Command< + StartTopicsDetectionJobCommandInput, + StartTopicsDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StartTopicsDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StartTopicsDetectionJobCommandInput, + StartTopicsDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StartTopicsDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StartTopicsDetectionJobCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StartTopicsDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StopDominantLanguageDetectionJobCommand.ts b/clients/client-comprehend/commands/StopDominantLanguageDetectionJobCommand.ts new file mode 100644 index 000000000000..1d5cc1a58eb2 --- /dev/null +++ b/clients/client-comprehend/commands/StopDominantLanguageDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StopDominantLanguageDetectionJobRequest, + StopDominantLanguageDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StopDominantLanguageDetectionJobCommand, + serializeAws_json1_1StopDominantLanguageDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StopDominantLanguageDetectionJobCommandInput = StopDominantLanguageDetectionJobRequest; +export type StopDominantLanguageDetectionJobCommandOutput = StopDominantLanguageDetectionJobResponse; + +export class StopDominantLanguageDetectionJobCommand extends $Command< + StopDominantLanguageDetectionJobCommandInput, + StopDominantLanguageDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StopDominantLanguageDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StopDominantLanguageDetectionJobCommandInput, + StopDominantLanguageDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StopDominantLanguageDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StopDominantLanguageDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StopDominantLanguageDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StopEntitiesDetectionJobCommand.ts b/clients/client-comprehend/commands/StopEntitiesDetectionJobCommand.ts new file mode 100644 index 000000000000..6cec69f24927 --- /dev/null +++ b/clients/client-comprehend/commands/StopEntitiesDetectionJobCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StopEntitiesDetectionJobRequest, + StopEntitiesDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StopEntitiesDetectionJobCommand, + serializeAws_json1_1StopEntitiesDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StopEntitiesDetectionJobCommandInput = StopEntitiesDetectionJobRequest; +export type StopEntitiesDetectionJobCommandOutput = StopEntitiesDetectionJobResponse; + +export class StopEntitiesDetectionJobCommand extends $Command< + StopEntitiesDetectionJobCommandInput, + StopEntitiesDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StopEntitiesDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StopEntitiesDetectionJobCommandInput, + StopEntitiesDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StopEntitiesDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StopEntitiesDetectionJobCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StopEntitiesDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StopKeyPhrasesDetectionJobCommand.ts b/clients/client-comprehend/commands/StopKeyPhrasesDetectionJobCommand.ts new file mode 100644 index 000000000000..167662cecaab --- /dev/null +++ b/clients/client-comprehend/commands/StopKeyPhrasesDetectionJobCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StopKeyPhrasesDetectionJobRequest, + StopKeyPhrasesDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StopKeyPhrasesDetectionJobCommand, + serializeAws_json1_1StopKeyPhrasesDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StopKeyPhrasesDetectionJobCommandInput = StopKeyPhrasesDetectionJobRequest; +export type StopKeyPhrasesDetectionJobCommandOutput = StopKeyPhrasesDetectionJobResponse; + +export class StopKeyPhrasesDetectionJobCommand extends $Command< + StopKeyPhrasesDetectionJobCommandInput, + StopKeyPhrasesDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StopKeyPhrasesDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StopKeyPhrasesDetectionJobCommandInput, + StopKeyPhrasesDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StopKeyPhrasesDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StopKeyPhrasesDetectionJobCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StopKeyPhrasesDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StopSentimentDetectionJobCommand.ts b/clients/client-comprehend/commands/StopSentimentDetectionJobCommand.ts new file mode 100644 index 000000000000..6bc54ad48195 --- /dev/null +++ b/clients/client-comprehend/commands/StopSentimentDetectionJobCommand.ts @@ -0,0 +1,90 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StopSentimentDetectionJobRequest, + StopSentimentDetectionJobResponse +} from "../models/index"; +import { + deserializeAws_json1_1StopSentimentDetectionJobCommand, + serializeAws_json1_1StopSentimentDetectionJobCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StopSentimentDetectionJobCommandInput = StopSentimentDetectionJobRequest; +export type StopSentimentDetectionJobCommandOutput = StopSentimentDetectionJobResponse; + +export class StopSentimentDetectionJobCommand extends $Command< + StopSentimentDetectionJobCommandInput, + StopSentimentDetectionJobCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StopSentimentDetectionJobCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StopSentimentDetectionJobCommandInput, + StopSentimentDetectionJobCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StopSentimentDetectionJobCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StopSentimentDetectionJobCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StopSentimentDetectionJobCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StopTrainingDocumentClassifierCommand.ts b/clients/client-comprehend/commands/StopTrainingDocumentClassifierCommand.ts new file mode 100644 index 000000000000..78f957736907 --- /dev/null +++ b/clients/client-comprehend/commands/StopTrainingDocumentClassifierCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StopTrainingDocumentClassifierRequest, + StopTrainingDocumentClassifierResponse +} from "../models/index"; +import { + deserializeAws_json1_1StopTrainingDocumentClassifierCommand, + serializeAws_json1_1StopTrainingDocumentClassifierCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StopTrainingDocumentClassifierCommandInput = StopTrainingDocumentClassifierRequest; +export type StopTrainingDocumentClassifierCommandOutput = StopTrainingDocumentClassifierResponse; + +export class StopTrainingDocumentClassifierCommand extends $Command< + StopTrainingDocumentClassifierCommandInput, + StopTrainingDocumentClassifierCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StopTrainingDocumentClassifierCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StopTrainingDocumentClassifierCommandInput, + StopTrainingDocumentClassifierCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StopTrainingDocumentClassifierCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StopTrainingDocumentClassifierCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StopTrainingDocumentClassifierCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/StopTrainingEntityRecognizerCommand.ts b/clients/client-comprehend/commands/StopTrainingEntityRecognizerCommand.ts new file mode 100644 index 000000000000..b9338bae1f81 --- /dev/null +++ b/clients/client-comprehend/commands/StopTrainingEntityRecognizerCommand.ts @@ -0,0 +1,93 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { + StopTrainingEntityRecognizerRequest, + StopTrainingEntityRecognizerResponse +} from "../models/index"; +import { + deserializeAws_json1_1StopTrainingEntityRecognizerCommand, + serializeAws_json1_1StopTrainingEntityRecognizerCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type StopTrainingEntityRecognizerCommandInput = StopTrainingEntityRecognizerRequest; +export type StopTrainingEntityRecognizerCommandOutput = StopTrainingEntityRecognizerResponse; + +export class StopTrainingEntityRecognizerCommand extends $Command< + StopTrainingEntityRecognizerCommandInput, + StopTrainingEntityRecognizerCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: StopTrainingEntityRecognizerCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler< + StopTrainingEntityRecognizerCommandInput, + StopTrainingEntityRecognizerCommandOutput + > { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: StopTrainingEntityRecognizerCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1StopTrainingEntityRecognizerCommand( + input, + context + ); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1StopTrainingEntityRecognizerCommand( + output, + context + ); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/TagResourceCommand.ts b/clients/client-comprehend/commands/TagResourceCommand.ts new file mode 100644 index 000000000000..b105d31b1d0c --- /dev/null +++ b/clients/client-comprehend/commands/TagResourceCommand.ts @@ -0,0 +1,81 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { TagResourceRequest, TagResourceResponse } from "../models/index"; +import { + deserializeAws_json1_1TagResourceCommand, + serializeAws_json1_1TagResourceCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type TagResourceCommandInput = TagResourceRequest; +export type TagResourceCommandOutput = TagResourceResponse; + +export class TagResourceCommand extends $Command< + TagResourceCommandInput, + TagResourceCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: TagResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: TagResourceCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1TagResourceCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1TagResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/UntagResourceCommand.ts b/clients/client-comprehend/commands/UntagResourceCommand.ts new file mode 100644 index 000000000000..27e2d96d3c32 --- /dev/null +++ b/clients/client-comprehend/commands/UntagResourceCommand.ts @@ -0,0 +1,81 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { UntagResourceRequest, UntagResourceResponse } from "../models/index"; +import { + deserializeAws_json1_1UntagResourceCommand, + serializeAws_json1_1UntagResourceCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type UntagResourceCommandInput = UntagResourceRequest; +export type UntagResourceCommandOutput = UntagResourceResponse; + +export class UntagResourceCommand extends $Command< + UntagResourceCommandInput, + UntagResourceCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UntagResourceCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: UntagResourceCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1UntagResourceCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1UntagResourceCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/commands/UpdateEndpointCommand.ts b/clients/client-comprehend/commands/UpdateEndpointCommand.ts new file mode 100644 index 000000000000..7354fdc8d591 --- /dev/null +++ b/clients/client-comprehend/commands/UpdateEndpointCommand.ts @@ -0,0 +1,81 @@ +import { + ComprehendClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes +} from "../ComprehendClient"; +import { UpdateEndpointRequest, UpdateEndpointResponse } from "../models/index"; +import { + deserializeAws_json1_1UpdateEndpointCommand, + serializeAws_json1_1UpdateEndpointCommand +} from "../protocols/Aws_json1_1"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + MiddlewareStack, + SerdeContext, + HttpHandlerOptions as __HttpHandlerOptions +} from "@aws-sdk/types"; + +export type UpdateEndpointCommandInput = UpdateEndpointRequest; +export type UpdateEndpointCommandOutput = UpdateEndpointResponse; + +export class UpdateEndpointCommand extends $Command< + UpdateEndpointCommandInput, + UpdateEndpointCommandOutput, + ComprehendClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateEndpointCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: ComprehendClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use( + getSerdePlugin(configuration, this.serialize, this.deserialize) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const handlerExecutionContext: HandlerExecutionContext = { + logger: {} as any + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: UpdateEndpointCommandInput, + context: SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1UpdateEndpointCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: SerdeContext + ): Promise { + return deserializeAws_json1_1UpdateEndpointCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-comprehend/endpoints.ts b/clients/client-comprehend/endpoints.ts new file mode 100644 index 000000000000..5e53bddda2b9 --- /dev/null +++ b/clients/client-comprehend/endpoints.ts @@ -0,0 +1,128 @@ +import { RegionInfo, RegionInfoProvider } from "@aws-sdk/types"; + +// Partition default templates +const AWS_TEMPLATE = "comprehend.{region}.amazonaws.com"; +const AWS_CN_TEMPLATE = "comprehend.{region}.amazonaws.com.cn"; +const AWS_ISO_TEMPLATE = "comprehend.{region}.c2s.ic.gov"; +const AWS_ISO_B_TEMPLATE = "comprehend.{region}.sc2s.sgov.gov"; +const AWS_US_GOV_TEMPLATE = "comprehend.{region}.amazonaws.com"; + +// Partition regions +const AWS_REGIONS = new Set([ + "ap-south-1", + "eu-north-1", + "eu-west-3", + "eu-west-2", + "eu-west-1", + "ap-northeast-2", + "ap-northeast-1", + "me-south-1", + "ca-central-1", + "sa-east-1", + "ap-east-1", + "ap-southeast-1", + "ap-southeast-2", + "eu-central-1", + "us-east-1", + "us-east-2", + "us-west-1", + "us-west-2" +]); +const AWS_CN_REGIONS = new Set(["cn-north-1", "cn-northwest-1"]); +const AWS_ISO_REGIONS = new Set(["us-iso-east-1"]); +const AWS_ISO_B_REGIONS = new Set(["us-isob-east-1"]); +const AWS_US_GOV_REGIONS = new Set(["us-gov-west-1", "us-gov-east-1"]); + +export const defaultRegionInfoProvider: RegionInfoProvider = ( + region: string, + options?: any +) => { + let regionInfo: RegionInfo | undefined = undefined; + switch (region) { + // First, try to match exact region names. + case "ap-southeast-1": + regionInfo = { + hostname: "comprehend.ap-southeast-1.amazonaws.com" + }; + break; + case "ap-southeast-2": + regionInfo = { + hostname: "comprehend.ap-southeast-2.amazonaws.com" + }; + break; + case "ca-central-1": + regionInfo = { + hostname: "comprehend.ca-central-1.amazonaws.com" + }; + break; + case "eu-central-1": + regionInfo = { + hostname: "comprehend.eu-central-1.amazonaws.com" + }; + break; + case "eu-west-1": + regionInfo = { + hostname: "comprehend.eu-west-1.amazonaws.com" + }; + break; + case "eu-west-2": + regionInfo = { + hostname: "comprehend.eu-west-2.amazonaws.com" + }; + break; + case "us-east-1": + regionInfo = { + hostname: "comprehend.us-east-1.amazonaws.com" + }; + break; + case "us-east-2": + regionInfo = { + hostname: "comprehend.us-east-2.amazonaws.com" + }; + break; + case "us-gov-west-1": + regionInfo = { + hostname: "comprehend.us-gov-west-1.amazonaws.com" + }; + break; + case "us-west-2": + regionInfo = { + hostname: "comprehend.us-west-2.amazonaws.com" + }; + break; + // Next, try to match partition endpoints. + default: + if (AWS_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_CN_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_CN_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_ISO_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_ISO_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_ISO_B_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_ISO_B_TEMPLATE.replace("{region}", region) + }; + } + if (AWS_US_GOV_REGIONS.has(region)) { + regionInfo = { + hostname: AWS_US_GOV_TEMPLATE.replace("{region}", region) + }; + } + // Finally, assume it's an AWS partition endpoint. + if (regionInfo === undefined) { + regionInfo = { + hostname: AWS_TEMPLATE.replace("{region}", region) + }; + } + } + return Promise.resolve(regionInfo); +}; diff --git a/clients/client-comprehend/index.ts b/clients/client-comprehend/index.ts new file mode 100644 index 000000000000..9e249a43052b --- /dev/null +++ b/clients/client-comprehend/index.ts @@ -0,0 +1,53 @@ +export * from "./ComprehendClient"; +export * from "./Comprehend"; +export * from "./commands/BatchDetectDominantLanguageCommand"; +export * from "./commands/BatchDetectEntitiesCommand"; +export * from "./commands/BatchDetectKeyPhrasesCommand"; +export * from "./commands/BatchDetectSentimentCommand"; +export * from "./commands/BatchDetectSyntaxCommand"; +export * from "./commands/ClassifyDocumentCommand"; +export * from "./commands/CreateDocumentClassifierCommand"; +export * from "./commands/CreateEndpointCommand"; +export * from "./commands/CreateEntityRecognizerCommand"; +export * from "./commands/DeleteDocumentClassifierCommand"; +export * from "./commands/DeleteEndpointCommand"; +export * from "./commands/DeleteEntityRecognizerCommand"; +export * from "./commands/DescribeDocumentClassificationJobCommand"; +export * from "./commands/DescribeDocumentClassifierCommand"; +export * from "./commands/DescribeDominantLanguageDetectionJobCommand"; +export * from "./commands/DescribeEndpointCommand"; +export * from "./commands/DescribeEntitiesDetectionJobCommand"; +export * from "./commands/DescribeEntityRecognizerCommand"; +export * from "./commands/DescribeKeyPhrasesDetectionJobCommand"; +export * from "./commands/DescribeSentimentDetectionJobCommand"; +export * from "./commands/DescribeTopicsDetectionJobCommand"; +export * from "./commands/DetectDominantLanguageCommand"; +export * from "./commands/DetectEntitiesCommand"; +export * from "./commands/DetectKeyPhrasesCommand"; +export * from "./commands/DetectSentimentCommand"; +export * from "./commands/DetectSyntaxCommand"; +export * from "./commands/ListDocumentClassificationJobsCommand"; +export * from "./commands/ListDocumentClassifiersCommand"; +export * from "./commands/ListDominantLanguageDetectionJobsCommand"; +export * from "./commands/ListEndpointsCommand"; +export * from "./commands/ListEntitiesDetectionJobsCommand"; +export * from "./commands/ListEntityRecognizersCommand"; +export * from "./commands/ListKeyPhrasesDetectionJobsCommand"; +export * from "./commands/ListSentimentDetectionJobsCommand"; +export * from "./commands/ListTagsForResourceCommand"; +export * from "./commands/ListTopicsDetectionJobsCommand"; +export * from "./commands/StartDocumentClassificationJobCommand"; +export * from "./commands/StartDominantLanguageDetectionJobCommand"; +export * from "./commands/StartEntitiesDetectionJobCommand"; +export * from "./commands/StartKeyPhrasesDetectionJobCommand"; +export * from "./commands/StartSentimentDetectionJobCommand"; +export * from "./commands/StartTopicsDetectionJobCommand"; +export * from "./commands/StopDominantLanguageDetectionJobCommand"; +export * from "./commands/StopEntitiesDetectionJobCommand"; +export * from "./commands/StopKeyPhrasesDetectionJobCommand"; +export * from "./commands/StopSentimentDetectionJobCommand"; +export * from "./commands/StopTrainingDocumentClassifierCommand"; +export * from "./commands/StopTrainingEntityRecognizerCommand"; +export * from "./commands/TagResourceCommand"; +export * from "./commands/UntagResourceCommand"; +export * from "./commands/UpdateEndpointCommand"; diff --git a/clients/client-comprehend/models/index.ts b/clients/client-comprehend/models/index.ts new file mode 100644 index 000000000000..5e765a3e41c9 --- /dev/null +++ b/clients/client-comprehend/models/index.ts @@ -0,0 +1,5703 @@ +import * as _smithy from "@aws-sdk/smithy-client"; +import { MetadataBearer as $MetadataBearer } from "@aws-sdk/types"; + +/** + * + *

The result of calling the operation. + * The operation returns one object for each document that is successfully processed by the + * operation.

+ * + */ +export interface BatchDetectDominantLanguageItemResult { + __type?: "BatchDetectDominantLanguageItemResult"; + /** + * + *

The zero-based index of the document in the input list.

+ * + */ + Index?: number; + + /** + * + *

One or more DominantLanguage objects describing the dominant + * languages in the document.

+ * + */ + Languages?: Array; +} + +export namespace BatchDetectDominantLanguageItemResult { + export function isa(o: any): o is BatchDetectDominantLanguageItemResult { + return _smithy.isa(o, "BatchDetectDominantLanguageItemResult"); + } +} + +export interface BatchDetectDominantLanguageRequest { + __type?: "BatchDetectDominantLanguageRequest"; + /** + * + *

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.

+ * + */ + TextList: Array | undefined; +} + +export namespace BatchDetectDominantLanguageRequest { + export function isa(o: any): o is BatchDetectDominantLanguageRequest { + return _smithy.isa(o, "BatchDetectDominantLanguageRequest"); + } +} + +export interface BatchDetectDominantLanguageResponse extends $MetadataBearer { + __type?: "BatchDetectDominantLanguageResponse"; + /** + * + *

A list containing one object for each document + * that contained an error. The results are sorted in ascending order by the Index + * field and match the order of the documents in the input list. If there are no errors in the + * batch, the ErrorList is empty.

+ * + */ + ErrorList: Array | undefined; + + /** + * + *

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.

+ * + */ + ResultList: Array | undefined; +} + +export namespace BatchDetectDominantLanguageResponse { + export function isa(o: any): o is BatchDetectDominantLanguageResponse { + return _smithy.isa(o, "BatchDetectDominantLanguageResponse"); + } +} + +/** + * + *

The result of calling the operation. The + * operation returns one object for each document that is successfully processed by the + * operation.

+ * + */ +export interface BatchDetectEntitiesItemResult { + __type?: "BatchDetectEntitiesItemResult"; + /** + * + *

One or more Entity objects, one for each entity detected in the + * document.

+ * + */ + Entities?: Array; + + /** + * + *

The zero-based index of the document in the input list.

+ * + */ + Index?: number; +} + +export namespace BatchDetectEntitiesItemResult { + export function isa(o: any): o is BatchDetectEntitiesItemResult { + return _smithy.isa(o, "BatchDetectEntitiesItemResult"); + } +} + +export interface BatchDetectEntitiesRequest { + __type?: "BatchDetectEntitiesRequest"; + /** + * + *

The language of the input documents. You can specify any of the primary languages supported by Amazon + * Comprehend. + * All documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

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.

+ * + */ + TextList: Array | undefined; +} + +export namespace BatchDetectEntitiesRequest { + export function isa(o: any): o is BatchDetectEntitiesRequest { + return _smithy.isa(o, "BatchDetectEntitiesRequest"); + } +} + +export interface BatchDetectEntitiesResponse extends $MetadataBearer { + __type?: "BatchDetectEntitiesResponse"; + /** + * + *

A list containing one object for each document + * that contained an error. The results are sorted in ascending order by the Index + * field and match the order of the documents in the input list. If there are no errors in the + * batch, the ErrorList is empty.

+ * + */ + ErrorList: Array | undefined; + + /** + * + *

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.

+ * + */ + ResultList: Array | undefined; +} + +export namespace BatchDetectEntitiesResponse { + export function isa(o: any): o is BatchDetectEntitiesResponse { + return _smithy.isa(o, "BatchDetectEntitiesResponse"); + } +} + +/** + * + *

The result of calling the operation. The + * operation returns one object for each document that is successfully processed by the + * operation.

+ * + */ +export interface BatchDetectKeyPhrasesItemResult { + __type?: "BatchDetectKeyPhrasesItemResult"; + /** + * + *

The zero-based index of the document in the input list.

+ * + */ + Index?: number; + + /** + * + *

One or more KeyPhrase objects, one for each key phrase detected in + * the document.

+ * + */ + KeyPhrases?: Array; +} + +export namespace BatchDetectKeyPhrasesItemResult { + export function isa(o: any): o is BatchDetectKeyPhrasesItemResult { + return _smithy.isa(o, "BatchDetectKeyPhrasesItemResult"); + } +} + +export interface BatchDetectKeyPhrasesRequest { + __type?: "BatchDetectKeyPhrasesRequest"; + /** + * + *

The language of the input documents. You can specify any of the primary languages supported by Amazon + * Comprehend. + * All documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

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.

+ * + */ + TextList: Array | undefined; +} + +export namespace BatchDetectKeyPhrasesRequest { + export function isa(o: any): o is BatchDetectKeyPhrasesRequest { + return _smithy.isa(o, "BatchDetectKeyPhrasesRequest"); + } +} + +export interface BatchDetectKeyPhrasesResponse extends $MetadataBearer { + __type?: "BatchDetectKeyPhrasesResponse"; + /** + * + *

A list containing one object for each document + * that contained an error. The results are sorted in ascending order by the Index + * field and match the order of the documents in the input list. If there are no errors in the + * batch, the ErrorList is empty.

+ * + */ + ErrorList: Array | undefined; + + /** + * + *

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.

+ * + */ + ResultList: Array | undefined; +} + +export namespace BatchDetectKeyPhrasesResponse { + export function isa(o: any): o is BatchDetectKeyPhrasesResponse { + return _smithy.isa(o, "BatchDetectKeyPhrasesResponse"); + } +} + +/** + * + *

The result of calling the operation. The + * operation returns one object for each document that is successfully processed by the + * operation.

+ * + */ +export interface BatchDetectSentimentItemResult { + __type?: "BatchDetectSentimentItemResult"; + /** + * + *

The zero-based index of the document in the input list.

+ * + */ + Index?: number; + + /** + * + *

The sentiment detected in the document.

+ * + */ + Sentiment?: SentimentType | string; + + /** + * + *

The level of confidence that Amazon Comprehend has in the accuracy of its sentiment + * detection.

+ * + */ + SentimentScore?: SentimentScore; +} + +export namespace BatchDetectSentimentItemResult { + export function isa(o: any): o is BatchDetectSentimentItemResult { + return _smithy.isa(o, "BatchDetectSentimentItemResult"); + } +} + +export interface BatchDetectSentimentRequest { + __type?: "BatchDetectSentimentRequest"; + /** + * + *

The language of the input documents. You can specify any of the primary languages supported by Amazon + * Comprehend. + * All documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

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.

+ * + */ + TextList: Array | undefined; +} + +export namespace BatchDetectSentimentRequest { + export function isa(o: any): o is BatchDetectSentimentRequest { + return _smithy.isa(o, "BatchDetectSentimentRequest"); + } +} + +export interface BatchDetectSentimentResponse extends $MetadataBearer { + __type?: "BatchDetectSentimentResponse"; + /** + * + *

A list containing one object for each document + * that contained an error. The results are sorted in ascending order by the Index + * field and match the order of the documents in the input list. If there are no errors in the + * batch, the ErrorList is empty.

+ * + */ + ErrorList: Array | undefined; + + /** + * + *

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.

+ * + */ + ResultList: Array | undefined; +} + +export namespace BatchDetectSentimentResponse { + export function isa(o: any): o is BatchDetectSentimentResponse { + return _smithy.isa(o, "BatchDetectSentimentResponse"); + } +} + +/** + * + *

The result of calling the operation. The operation + * returns one object that is successfully processed by the operation.

+ * + */ +export interface BatchDetectSyntaxItemResult { + __type?: "BatchDetectSyntaxItemResult"; + /** + * + *

The zero-based index of the document in the input list.

+ * + */ + Index?: number; + + /** + * + *

The syntax tokens for the words in the document, one token for each word.

+ * + */ + SyntaxTokens?: Array; +} + +export namespace BatchDetectSyntaxItemResult { + export function isa(o: any): o is BatchDetectSyntaxItemResult { + return _smithy.isa(o, "BatchDetectSyntaxItemResult"); + } +} + +export interface BatchDetectSyntaxRequest { + __type?: "BatchDetectSyntaxRequest"; + /** + * + *

The language of the input documents. You can specify any of the following languages supported by Amazon + * Comprehend: German ("de"), English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt"). All + * documents must be in the same language.

+ * + */ + LanguageCode: SyntaxLanguageCode | string | undefined; + + /** + * + *

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.

+ * + */ + TextList: Array | undefined; +} + +export namespace BatchDetectSyntaxRequest { + export function isa(o: any): o is BatchDetectSyntaxRequest { + return _smithy.isa(o, "BatchDetectSyntaxRequest"); + } +} + +export interface BatchDetectSyntaxResponse extends $MetadataBearer { + __type?: "BatchDetectSyntaxResponse"; + /** + * + *

A list containing one object for each document that + * contained an error. The results are sorted in ascending order by the Index field + * and match the order of the documents in the input list. If there are no errors in the batch, + * the ErrorList is empty.

+ * + */ + ErrorList: Array | undefined; + + /** + * + *

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.

+ * + */ + ResultList: Array | undefined; +} + +export namespace BatchDetectSyntaxResponse { + export function isa(o: any): o is BatchDetectSyntaxResponse { + return _smithy.isa(o, "BatchDetectSyntaxResponse"); + } +} + +/** + * + *

Describes an error that occurred while processing a document in a batch. The operation + * returns on BatchItemError object for each document that contained an + * error.

+ * + */ +export interface BatchItemError { + __type?: "BatchItemError"; + /** + * + *

The numeric error code of the error.

+ * + */ + ErrorCode?: string; + + /** + * + *

A text description of the error.

+ * + */ + ErrorMessage?: string; + + /** + * + *

The zero-based index of the document in the input list.

+ * + */ + Index?: number; +} + +export namespace BatchItemError { + export function isa(o: any): o is BatchItemError { + return _smithy.isa(o, "BatchItemError"); + } +} + +/** + * + *

The number of documents in the request exceeds the limit of 25. Try your request again + * with fewer documents.

+ * + */ +export interface BatchSizeLimitExceededException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "BatchSizeLimitExceededException"; + $fault: "client"; + Message?: string; +} + +export namespace BatchSizeLimitExceededException { + export function isa(o: any): o is BatchSizeLimitExceededException { + return _smithy.isa(o, "BatchSizeLimitExceededException"); + } +} + +/** + * + *

Describes the result metrics for the test data associated with an documentation classifier.

+ * + */ +export interface ClassifierEvaluationMetrics { + __type?: "ClassifierEvaluationMetrics"; + /** + * + *

The fraction of the labels that were correct recognized. It is computed by dividing + * the number of labels in the test documents that were correctly recognized by the total number of labels in the test documents.

+ * + */ + Accuracy?: number; + + /** + * + *

A measure of how accurate the classifier results are for the test data. It is + * derived from the Precision and Recall values. The F1Score is + * the harmonic average of the two scores. The highest score is 1, and the worst score is 0. + *

+ * + */ + F1Score?: number; + + /** + * + *

A measure of the usefulness of the classifier results in the test data. High precision + * means that the classifier returned substantially more relevant results than irrelevant ones.

+ * + */ + Precision?: number; + + /** + * + *

A measure of how complete the classifier results are for the test data. High recall means + * that the classifier returned most of the relevant results.

+ * + */ + Recall?: number; +} + +export namespace ClassifierEvaluationMetrics { + export function isa(o: any): o is ClassifierEvaluationMetrics { + return _smithy.isa(o, "ClassifierEvaluationMetrics"); + } +} + +/** + * + *

Provides information about a document classifier.

+ * + */ +export interface ClassifierMetadata { + __type?: "ClassifierMetadata"; + /** + * + *

Describes the result metrics for the test data associated with an documentation classifier.

+ * + */ + EvaluationMetrics?: ClassifierEvaluationMetrics; + + /** + * + *

The number of labels in the input data.

+ * + */ + NumberOfLabels?: number; + + /** + * + *

The number of documents in the input data that were used to test the classifier. Typically + * this is 10 to 20 percent of the input documents.

+ * + */ + NumberOfTestDocuments?: number; + + /** + * + *

The number of documents in the input data that were used to train the classifier. + * Typically this is 80 to 90 percent of the input documents.

+ * + */ + NumberOfTrainedDocuments?: number; +} + +export namespace ClassifierMetadata { + export function isa(o: any): o is ClassifierMetadata { + return _smithy.isa(o, "ClassifierMetadata"); + } +} + +export interface ClassifyDocumentRequest { + __type?: "ClassifyDocumentRequest"; + /** + * + *

The Amazon Resource Number (ARN) of the endpoint.

+ * + */ + EndpointArn: string | undefined; + + /** + * + *

The document text to be analyzed.

+ * + */ + Text: string | undefined; +} + +export namespace ClassifyDocumentRequest { + export function isa(o: any): o is ClassifyDocumentRequest { + return _smithy.isa(o, "ClassifyDocumentRequest"); + } +} + +export interface ClassifyDocumentResponse extends $MetadataBearer { + __type?: "ClassifyDocumentResponse"; + /** + * + *

The classes used by the document being analyzed. These are used for multi-class trained models. Individual classes are mutually exclusive and each document is expected + * to have only a single class assigned to it. For example, an animal can be a dog or a cat, but not both at the same time.

+ * + */ + Classes?: Array; +} + +export namespace ClassifyDocumentResponse { + export function isa(o: any): o is ClassifyDocumentResponse { + return _smithy.isa(o, "ClassifyDocumentResponse"); + } +} + +/** + * + *

Concurrent modification of the tags associated with an Amazon Comprehend resource is not supported.

+ * + */ +export interface ConcurrentModificationException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ConcurrentModificationException"; + $fault: "client"; + Message?: string; +} + +export namespace ConcurrentModificationException { + export function isa(o: any): o is ConcurrentModificationException { + return _smithy.isa(o, "ConcurrentModificationException"); + } +} + +export interface CreateDocumentClassifierRequest { + __type?: "CreateDocumentClassifierRequest"; + /** + * + *

A unique identifier for the request. If you don't set the client request token, Amazon Comprehend + * generates one.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Management (IAM) role that grants + * Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn: string | undefined; + + /** + * + *

The name of the document classifier.

+ * + */ + DocumentClassifierName: string | undefined; + + /** + * + *

Specifies the format and location of the input data for the job.

+ * + */ + InputDataConfig: DocumentClassifierInputDataConfig | undefined; + + /** + * + *

The language of the input documents. You can specify any of the following languages supported by Amazon + * Comprehend: German ("de"), English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt"). All + * documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

Enables the addition of output results configuration parameters for custom classifier jobs.

+ * + */ + OutputDataConfig?: DocumentClassifierOutputDataConfig; + + /** + * + *

Tags to be associated with the document classifier being created. A tag is a key-value pair that adds as a metadata to a resource + * used by Amazon Comprehend. For example, + * a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.

+ * + */ + Tags?: Array; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your custom classifier. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace CreateDocumentClassifierRequest { + export function isa(o: any): o is CreateDocumentClassifierRequest { + return _smithy.isa(o, "CreateDocumentClassifierRequest"); + } +} + +export interface CreateDocumentClassifierResponse extends $MetadataBearer { + __type?: "CreateDocumentClassifierResponse"; + /** + * + *

The Amazon Resource Name (ARN) that identifies the document classifier.

+ * + */ + DocumentClassifierArn?: string; +} + +export namespace CreateDocumentClassifierResponse { + export function isa(o: any): o is CreateDocumentClassifierResponse { + return _smithy.isa(o, "CreateDocumentClassifierResponse"); + } +} + +export interface CreateEndpointRequest { + __type?: "CreateEndpointRequest"; + /** + * + *

An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend + * will not return a ResourceInUseException.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The desired number of inference units to be used by the model using this endpoint. Each + * inference unit represents of a throughput of 100 characters per second.

+ * + */ + DesiredInferenceUnits: number | undefined; + + /** + * + *

This is the descriptive suffix that becomes part of the EndpointArn used for all subsequent requests to this resource.

+ * + */ + EndpointName: string | undefined; + + /** + * + *

The Amazon Resource Number (ARN) of the model to which the endpoint will be attached.

+ * + */ + ModelArn: string | undefined; + + /** + * + *

Tags associated with the endpoint being created. A tag is a key-value pair that adds metadata + * to the endpoint. For example, a tag with "Sales" as the key might be added to an endpoint + * to indicate its use by the sales department.

+ * + */ + Tags?: Array; +} + +export namespace CreateEndpointRequest { + export function isa(o: any): o is CreateEndpointRequest { + return _smithy.isa(o, "CreateEndpointRequest"); + } +} + +export interface CreateEndpointResponse extends $MetadataBearer { + __type?: "CreateEndpointResponse"; + /** + * + *

The Amazon Resource Number (ARN) of the endpoint being created.

+ * + */ + EndpointArn?: string; +} + +export namespace CreateEndpointResponse { + export function isa(o: any): o is CreateEndpointResponse { + return _smithy.isa(o, "CreateEndpointResponse"); + } +} + +export interface CreateEntityRecognizerRequest { + __type?: "CreateEntityRecognizerRequest"; + /** + * + *

A unique identifier for the request. If you don't set the client request token, Amazon Comprehend + * generates one.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Management (IAM) role that grants Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn: string | undefined; + + /** + * + *

Specifies the format and location of the input data. The S3 bucket containing the input data must + * be located in the same region as the entity recognizer being created.

+ * + */ + InputDataConfig: EntityRecognizerInputDataConfig | undefined; + + /** + * + *

The language of the input documents. All documents must be in the same language. Only English ("en") is currently supported.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

The name given to the newly created recognizer. Recognizer names can be a maximum of 256 characters. + * Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The name must be unique in the account/region.

+ * + */ + RecognizerName: string | undefined; + + /** + * + *

Tags to be associated with the entity recognizer being created. A tag is a key-value pair that adds as a metadata to a + * resource used by Amazon Comprehend. For example, + * a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.

+ * + */ + Tags?: Array; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your custom entity recognizer. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace CreateEntityRecognizerRequest { + export function isa(o: any): o is CreateEntityRecognizerRequest { + return _smithy.isa(o, "CreateEntityRecognizerRequest"); + } +} + +export interface CreateEntityRecognizerResponse extends $MetadataBearer { + __type?: "CreateEntityRecognizerResponse"; + /** + * + *

The Amazon Resource Name (ARN) that identifies the entity recognizer.

+ * + */ + EntityRecognizerArn?: string; +} + +export namespace CreateEntityRecognizerResponse { + export function isa(o: any): o is CreateEntityRecognizerResponse { + return _smithy.isa(o, "CreateEntityRecognizerResponse"); + } +} + +export interface DeleteDocumentClassifierRequest { + __type?: "DeleteDocumentClassifierRequest"; + /** + * + *

The Amazon Resource Name (ARN) that identifies the document classifier.

+ * + */ + DocumentClassifierArn: string | undefined; +} + +export namespace DeleteDocumentClassifierRequest { + export function isa(o: any): o is DeleteDocumentClassifierRequest { + return _smithy.isa(o, "DeleteDocumentClassifierRequest"); + } +} + +export interface DeleteDocumentClassifierResponse extends $MetadataBearer { + __type?: "DeleteDocumentClassifierResponse"; +} + +export namespace DeleteDocumentClassifierResponse { + export function isa(o: any): o is DeleteDocumentClassifierResponse { + return _smithy.isa(o, "DeleteDocumentClassifierResponse"); + } +} + +export interface DeleteEndpointRequest { + __type?: "DeleteEndpointRequest"; + /** + * + *

The Amazon Resource Number (ARN) of the endpoint being deleted.

+ * + */ + EndpointArn: string | undefined; +} + +export namespace DeleteEndpointRequest { + export function isa(o: any): o is DeleteEndpointRequest { + return _smithy.isa(o, "DeleteEndpointRequest"); + } +} + +export interface DeleteEndpointResponse extends $MetadataBearer { + __type?: "DeleteEndpointResponse"; +} + +export namespace DeleteEndpointResponse { + export function isa(o: any): o is DeleteEndpointResponse { + return _smithy.isa(o, "DeleteEndpointResponse"); + } +} + +export interface DeleteEntityRecognizerRequest { + __type?: "DeleteEntityRecognizerRequest"; + /** + * + *

The Amazon Resource Name (ARN) that identifies the entity recognizer.

+ * + */ + EntityRecognizerArn: string | undefined; +} + +export namespace DeleteEntityRecognizerRequest { + export function isa(o: any): o is DeleteEntityRecognizerRequest { + return _smithy.isa(o, "DeleteEntityRecognizerRequest"); + } +} + +export interface DeleteEntityRecognizerResponse extends $MetadataBearer { + __type?: "DeleteEntityRecognizerResponse"; +} + +export namespace DeleteEntityRecognizerResponse { + export function isa(o: any): o is DeleteEntityRecognizerResponse { + return _smithy.isa(o, "DeleteEntityRecognizerResponse"); + } +} + +export interface DescribeDocumentClassificationJobRequest { + __type?: "DescribeDocumentClassificationJobRequest"; + /** + * + *

The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its + * response.

+ * + */ + JobId: string | undefined; +} + +export namespace DescribeDocumentClassificationJobRequest { + export function isa(o: any): o is DescribeDocumentClassificationJobRequest { + return _smithy.isa(o, "DescribeDocumentClassificationJobRequest"); + } +} + +export interface DescribeDocumentClassificationJobResponse + extends $MetadataBearer { + __type?: "DescribeDocumentClassificationJobResponse"; + /** + * + *

An object that describes the properties associated with the document classification + * job.

+ * + */ + DocumentClassificationJobProperties?: DocumentClassificationJobProperties; +} + +export namespace DescribeDocumentClassificationJobResponse { + export function isa(o: any): o is DescribeDocumentClassificationJobResponse { + return _smithy.isa(o, "DescribeDocumentClassificationJobResponse"); + } +} + +export interface DescribeDocumentClassifierRequest { + __type?: "DescribeDocumentClassifierRequest"; + /** + * + *

The Amazon Resource Name (ARN) that identifies the document classifier. The operation returns this identifier in its + * response.

+ * + */ + DocumentClassifierArn: string | undefined; +} + +export namespace DescribeDocumentClassifierRequest { + export function isa(o: any): o is DescribeDocumentClassifierRequest { + return _smithy.isa(o, "DescribeDocumentClassifierRequest"); + } +} + +export interface DescribeDocumentClassifierResponse extends $MetadataBearer { + __type?: "DescribeDocumentClassifierResponse"; + /** + * + *

An object that contains the properties associated with a document classifier.

+ * + */ + DocumentClassifierProperties?: DocumentClassifierProperties; +} + +export namespace DescribeDocumentClassifierResponse { + export function isa(o: any): o is DescribeDocumentClassifierResponse { + return _smithy.isa(o, "DescribeDocumentClassifierResponse"); + } +} + +export interface DescribeDominantLanguageDetectionJobRequest { + __type?: "DescribeDominantLanguageDetectionJobRequest"; + /** + * + *

The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its + * response.

+ * + */ + JobId: string | undefined; +} + +export namespace DescribeDominantLanguageDetectionJobRequest { + export function isa( + o: any + ): o is DescribeDominantLanguageDetectionJobRequest { + return _smithy.isa(o, "DescribeDominantLanguageDetectionJobRequest"); + } +} + +export interface DescribeDominantLanguageDetectionJobResponse + extends $MetadataBearer { + __type?: "DescribeDominantLanguageDetectionJobResponse"; + /** + * + *

An object that contains the properties associated with a dominant language detection + * job.

+ * + */ + DominantLanguageDetectionJobProperties?: DominantLanguageDetectionJobProperties; +} + +export namespace DescribeDominantLanguageDetectionJobResponse { + export function isa( + o: any + ): o is DescribeDominantLanguageDetectionJobResponse { + return _smithy.isa(o, "DescribeDominantLanguageDetectionJobResponse"); + } +} + +export interface DescribeEndpointRequest { + __type?: "DescribeEndpointRequest"; + /** + * + *

The Amazon Resource Number (ARN) of the endpoint being described.

+ * + */ + EndpointArn: string | undefined; +} + +export namespace DescribeEndpointRequest { + export function isa(o: any): o is DescribeEndpointRequest { + return _smithy.isa(o, "DescribeEndpointRequest"); + } +} + +export interface DescribeEndpointResponse extends $MetadataBearer { + __type?: "DescribeEndpointResponse"; + /** + * + *

Describes information associated with the specific endpoint.

+ * + */ + EndpointProperties?: EndpointProperties; +} + +export namespace DescribeEndpointResponse { + export function isa(o: any): o is DescribeEndpointResponse { + return _smithy.isa(o, "DescribeEndpointResponse"); + } +} + +export interface DescribeEntitiesDetectionJobRequest { + __type?: "DescribeEntitiesDetectionJobRequest"; + /** + * + *

The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its + * response.

+ * + */ + JobId: string | undefined; +} + +export namespace DescribeEntitiesDetectionJobRequest { + export function isa(o: any): o is DescribeEntitiesDetectionJobRequest { + return _smithy.isa(o, "DescribeEntitiesDetectionJobRequest"); + } +} + +export interface DescribeEntitiesDetectionJobResponse extends $MetadataBearer { + __type?: "DescribeEntitiesDetectionJobResponse"; + /** + * + *

An object that contains the properties associated with an entities detection job.

+ * + */ + EntitiesDetectionJobProperties?: EntitiesDetectionJobProperties; +} + +export namespace DescribeEntitiesDetectionJobResponse { + export function isa(o: any): o is DescribeEntitiesDetectionJobResponse { + return _smithy.isa(o, "DescribeEntitiesDetectionJobResponse"); + } +} + +export interface DescribeEntityRecognizerRequest { + __type?: "DescribeEntityRecognizerRequest"; + /** + * + *

The Amazon Resource Name (ARN) that identifies the entity recognizer.

+ * + */ + EntityRecognizerArn: string | undefined; +} + +export namespace DescribeEntityRecognizerRequest { + export function isa(o: any): o is DescribeEntityRecognizerRequest { + return _smithy.isa(o, "DescribeEntityRecognizerRequest"); + } +} + +export interface DescribeEntityRecognizerResponse extends $MetadataBearer { + __type?: "DescribeEntityRecognizerResponse"; + /** + * + *

Describes information associated with an entity recognizer.

+ * + */ + EntityRecognizerProperties?: EntityRecognizerProperties; +} + +export namespace DescribeEntityRecognizerResponse { + export function isa(o: any): o is DescribeEntityRecognizerResponse { + return _smithy.isa(o, "DescribeEntityRecognizerResponse"); + } +} + +export interface DescribeKeyPhrasesDetectionJobRequest { + __type?: "DescribeKeyPhrasesDetectionJobRequest"; + /** + * + *

The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its + * response.

+ * + */ + JobId: string | undefined; +} + +export namespace DescribeKeyPhrasesDetectionJobRequest { + export function isa(o: any): o is DescribeKeyPhrasesDetectionJobRequest { + return _smithy.isa(o, "DescribeKeyPhrasesDetectionJobRequest"); + } +} + +export interface DescribeKeyPhrasesDetectionJobResponse + extends $MetadataBearer { + __type?: "DescribeKeyPhrasesDetectionJobResponse"; + /** + * + *

An object that contains the properties associated with a key phrases detection job. + *

+ * + */ + KeyPhrasesDetectionJobProperties?: KeyPhrasesDetectionJobProperties; +} + +export namespace DescribeKeyPhrasesDetectionJobResponse { + export function isa(o: any): o is DescribeKeyPhrasesDetectionJobResponse { + return _smithy.isa(o, "DescribeKeyPhrasesDetectionJobResponse"); + } +} + +export interface DescribeSentimentDetectionJobRequest { + __type?: "DescribeSentimentDetectionJobRequest"; + /** + * + *

The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its + * response.

+ * + */ + JobId: string | undefined; +} + +export namespace DescribeSentimentDetectionJobRequest { + export function isa(o: any): o is DescribeSentimentDetectionJobRequest { + return _smithy.isa(o, "DescribeSentimentDetectionJobRequest"); + } +} + +export interface DescribeSentimentDetectionJobResponse extends $MetadataBearer { + __type?: "DescribeSentimentDetectionJobResponse"; + /** + * + *

An object that contains the properties associated with a sentiment detection job.

+ * + */ + SentimentDetectionJobProperties?: SentimentDetectionJobProperties; +} + +export namespace DescribeSentimentDetectionJobResponse { + export function isa(o: any): o is DescribeSentimentDetectionJobResponse { + return _smithy.isa(o, "DescribeSentimentDetectionJobResponse"); + } +} + +export interface DescribeTopicsDetectionJobRequest { + __type?: "DescribeTopicsDetectionJobRequest"; + /** + * + *

The identifier assigned by the user to the detection job.

+ * + */ + JobId: string | undefined; +} + +export namespace DescribeTopicsDetectionJobRequest { + export function isa(o: any): o is DescribeTopicsDetectionJobRequest { + return _smithy.isa(o, "DescribeTopicsDetectionJobRequest"); + } +} + +export interface DescribeTopicsDetectionJobResponse extends $MetadataBearer { + __type?: "DescribeTopicsDetectionJobResponse"; + /** + * + *

The list of properties for the requested job.

+ * + */ + TopicsDetectionJobProperties?: TopicsDetectionJobProperties; +} + +export namespace DescribeTopicsDetectionJobResponse { + export function isa(o: any): o is DescribeTopicsDetectionJobResponse { + return _smithy.isa(o, "DescribeTopicsDetectionJobResponse"); + } +} + +export interface DetectDominantLanguageRequest { + __type?: "DetectDominantLanguageRequest"; + /** + * + *

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.

+ * + */ + Text: string | undefined; +} + +export namespace DetectDominantLanguageRequest { + export function isa(o: any): o is DetectDominantLanguageRequest { + return _smithy.isa(o, "DetectDominantLanguageRequest"); + } +} + +export interface DetectDominantLanguageResponse extends $MetadataBearer { + __type?: "DetectDominantLanguageResponse"; + /** + * + *

The languages that Amazon Comprehend detected in the input text. For each language, the response + * returns the RFC 5646 language code and the level of confidence that Amazon Comprehend has in the accuracy + * of its inference. For more information about RFC 5646, see Tags for Identifying Languages on the + * IETF Tools web site.

+ * + */ + Languages?: Array; +} + +export namespace DetectDominantLanguageResponse { + export function isa(o: any): o is DetectDominantLanguageResponse { + return _smithy.isa(o, "DetectDominantLanguageResponse"); + } +} + +export interface DetectEntitiesRequest { + __type?: "DetectEntitiesRequest"; + /** + * + *

The language of the input documents. You can specify any of the primary languages supported by Amazon + * Comprehend. + * All documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

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

+ * + */ + Text: string | undefined; +} + +export namespace DetectEntitiesRequest { + export function isa(o: any): o is DetectEntitiesRequest { + return _smithy.isa(o, "DetectEntitiesRequest"); + } +} + +export interface DetectEntitiesResponse extends $MetadataBearer { + __type?: "DetectEntitiesResponse"; + /** + * + *

A collection of entities identified in the input text. For each entity, the response + * provides the entity text, entity type, where the entity text begins and ends, and the level of + * confidence that Amazon Comprehend has in the detection. For a list of entity types, see how-entities.

+ * + */ + Entities?: Array; +} + +export namespace DetectEntitiesResponse { + export function isa(o: any): o is DetectEntitiesResponse { + return _smithy.isa(o, "DetectEntitiesResponse"); + } +} + +export interface DetectKeyPhrasesRequest { + __type?: "DetectKeyPhrasesRequest"; + /** + * + *

The language of the input documents. You can specify any of the primary languages supported by Amazon + * Comprehend. + * All documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

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

+ * + */ + Text: string | undefined; +} + +export namespace DetectKeyPhrasesRequest { + export function isa(o: any): o is DetectKeyPhrasesRequest { + return _smithy.isa(o, "DetectKeyPhrasesRequest"); + } +} + +export interface DetectKeyPhrasesResponse extends $MetadataBearer { + __type?: "DetectKeyPhrasesResponse"; + /** + * + *

A collection of key phrases that Amazon Comprehend identified in the input text. For each key + * phrase, the response provides the text of the key phrase, where the key phrase begins and + * ends, and the level of confidence that Amazon Comprehend has in the accuracy of the detection.

+ * + */ + KeyPhrases?: Array; +} + +export namespace DetectKeyPhrasesResponse { + export function isa(o: any): o is DetectKeyPhrasesResponse { + return _smithy.isa(o, "DetectKeyPhrasesResponse"); + } +} + +export interface DetectSentimentRequest { + __type?: "DetectSentimentRequest"; + /** + * + *

The language of the input documents. You can specify any of the primary languages supported by Amazon + * Comprehend. + * All documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

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

+ * + */ + Text: string | undefined; +} + +export namespace DetectSentimentRequest { + export function isa(o: any): o is DetectSentimentRequest { + return _smithy.isa(o, "DetectSentimentRequest"); + } +} + +export interface DetectSentimentResponse extends $MetadataBearer { + __type?: "DetectSentimentResponse"; + /** + * + *

The inferred sentiment that Amazon Comprehend has the highest level of confidence in.

+ * + */ + Sentiment?: SentimentType | string; + + /** + * + *

An object that lists the sentiments, and their corresponding confidence + * levels.

+ * + */ + SentimentScore?: SentimentScore; +} + +export namespace DetectSentimentResponse { + export function isa(o: any): o is DetectSentimentResponse { + return _smithy.isa(o, "DetectSentimentResponse"); + } +} + +export interface DetectSyntaxRequest { + __type?: "DetectSyntaxRequest"; + /** + * + *

The language code of the input documents. You can specify any of the following languages supported by Amazon + * Comprehend: German ("de"), English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), or Portuguese ("pt").

+ * + */ + LanguageCode: SyntaxLanguageCode | string | undefined; + + /** + * + *

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

+ * + */ + Text: string | undefined; +} + +export namespace DetectSyntaxRequest { + export function isa(o: any): o is DetectSyntaxRequest { + return _smithy.isa(o, "DetectSyntaxRequest"); + } +} + +export interface DetectSyntaxResponse extends $MetadataBearer { + __type?: "DetectSyntaxResponse"; + /** + * + *

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.

+ * + */ + SyntaxTokens?: Array; +} + +export namespace DetectSyntaxResponse { + export function isa(o: any): o is DetectSyntaxResponse { + return _smithy.isa(o, "DetectSyntaxResponse"); + } +} + +/** + * + *

Specifies the class that categorizes the document being analyzed

+ * + */ +export interface DocumentClass { + __type?: "DocumentClass"; + /** + * + *

The name of the class.

+ * + */ + Name?: string; + + /** + * + *

The confidence score that Amazon Comprehend has this class correctly attributed.

+ * + */ + Score?: number; +} + +export namespace DocumentClass { + export function isa(o: any): o is DocumentClass { + return _smithy.isa(o, "DocumentClass"); + } +} + +/** + * + *

Provides information for filtering a list of document classification jobs. For more + * information, see the operation. You can + * provide only one filter parameter in each request.

+ * + */ +export interface DocumentClassificationJobFilter { + __type?: "DocumentClassificationJobFilter"; + /** + * + *

Filters on the name of the job.

+ * + */ + JobName?: string; + + /** + * + *

Filters the list based on job status. Returns only jobs with the specified status.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted before the specified time. Jobs are returned in descending order, + * newest to oldest.

+ * + */ + SubmitTimeAfter?: Date; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted after the specified time. Jobs are returned in ascending order, + * oldest to newest.

+ * + */ + SubmitTimeBefore?: Date; +} + +export namespace DocumentClassificationJobFilter { + export function isa(o: any): o is DocumentClassificationJobFilter { + return _smithy.isa(o, "DocumentClassificationJobFilter"); + } +} + +/** + * + *

Provides information about a document classification job.

+ * + */ +export interface DocumentClassificationJobProperties { + __type?: "DocumentClassificationJobProperties"; + /** + * + *

The Amazon Resource Name (ARN) of the AWS identity and Access Management (IAM) role that + * grants Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn?: string; + + /** + * + *

The Amazon Resource Name (ARN) that identifies the document classifier.

+ * + */ + DocumentClassifierArn?: string; + + /** + * + *

The time that the document classification job completed.

+ * + */ + EndTime?: Date; + + /** + * + *

The input data configuration that you supplied when you created the document + * classification job.

+ * + */ + InputDataConfig?: InputDataConfig; + + /** + * + *

The identifier assigned to the document classification job.

+ * + */ + JobId?: string; + + /** + * + *

The name that you assigned to the document classification job.

+ * + */ + JobName?: string; + + /** + * + *

The current status of the document classification job. If the status is + * FAILED, the Message field shows the reason for the failure.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

A description of the status of the job.

+ * + */ + Message?: string; + + /** + * + *

The output data configuration that you supplied when you created the document + * classification job.

+ * + */ + OutputDataConfig?: OutputDataConfig; + + /** + * + *

The time that the document classification job was submitted for processing.

+ * + */ + SubmitTime?: Date; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your document classification job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace DocumentClassificationJobProperties { + export function isa(o: any): o is DocumentClassificationJobProperties { + return _smithy.isa(o, "DocumentClassificationJobProperties"); + } +} + +/** + * + *

Provides information for filtering a list of document classifiers. You can + * only specify + * one filtering parameter in a request. For more information, see the operation.

+ * + */ +export interface DocumentClassifierFilter { + __type?: "DocumentClassifierFilter"; + /** + * + *

Filters the list of classifiers based on status.

+ * + */ + Status?: ModelStatus | string; + + /** + * + *

Filters the list of classifiers based on the time that the classifier was submitted for + * processing. Returns only classifiers submitted after the specified time. Classifiers are returned in + * descending order, newest to oldest.

+ * + */ + SubmitTimeAfter?: Date; + + /** + * + *

Filters the list of classifiers based on the time that the classifier was submitted for + * processing. Returns only classifiers submitted before the specified time. Classifiers are returned in + * ascending order, oldest to newest.

+ * + */ + SubmitTimeBefore?: Date; +} + +export namespace DocumentClassifierFilter { + export function isa(o: any): o is DocumentClassifierFilter { + return _smithy.isa(o, "DocumentClassifierFilter"); + } +} + +/** + * + *

The input properties for training a document classifier.

+ *

For more information on how the input file is formatted, see + * how-document-classification-training-data.

+ * + */ +export interface DocumentClassifierInputDataConfig { + __type?: "DocumentClassifierInputDataConfig"; + /** + * + *

The Amazon S3 URI for the input data. The S3 bucket must be in the same 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.

+ *

For example, if you use the URI S3://bucketName/prefix, if the prefix is a + * single file, Amazon Comprehend uses that file as input. If more than one file begins with the + * prefix, Amazon Comprehend uses all of them as input.

+ * + */ + S3Uri: string | undefined; +} + +export namespace DocumentClassifierInputDataConfig { + export function isa(o: any): o is DocumentClassifierInputDataConfig { + return _smithy.isa(o, "DocumentClassifierInputDataConfig"); + } +} + +/** + * + *

Provides output results configuration parameters for custom classifier jobs.

+ * + */ +export interface DocumentClassifierOutputDataConfig { + __type?: "DocumentClassifierOutputDataConfig"; + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt the output results from an + * analysis job. The KmsKeyId can be one of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    KMS Key Alias: "alias/ExampleAlias" + *

    + *
  • + *
  • + *

    ARN of a KMS Key Alias: "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias" + *

    + *
  • + *
+ * + * + */ + KmsKeyId?: string; + + /** + * + *

When you use the OutputDataConfig object while creating a custom classifier, you + * specify the Amazon S3 location where you want to write the confusion matrix. The URI must be in the + * same region as the API endpoint that you are calling. The location is used as the prefix for + * the actual location of this output file.

+ *

When the custom classifier job is finished, the service creates the output file in a + * directory specific to the job. The S3Uri field contains the location of the + * output file, called output.tar.gz. It is a compressed archive that contains the + * confusion matrix.

+ * + */ + S3Uri?: string; +} + +export namespace DocumentClassifierOutputDataConfig { + export function isa(o: any): o is DocumentClassifierOutputDataConfig { + return _smithy.isa(o, "DocumentClassifierOutputDataConfig"); + } +} + +/** + * + *

Provides information about a document classifier.

+ * + */ +export interface DocumentClassifierProperties { + __type?: "DocumentClassifierProperties"; + /** + * + *

Information about the document classifier, including the number of documents used for + * training the classifier, the number of documents used for test the classifier, and an accuracy + * rating.

+ * + */ + ClassifierMetadata?: ClassifierMetadata; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Management (IAM) role that grants + * Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn?: string; + + /** + * + *

The Amazon Resource Name (ARN) that identifies the document classifier.

+ * + */ + DocumentClassifierArn?: string; + + /** + * + *

The time that training the document classifier completed.

+ * + */ + EndTime?: Date; + + /** + * + *

The input data configuration that you supplied when you created the document classifier + * for training.

+ * + */ + InputDataConfig?: DocumentClassifierInputDataConfig; + + /** + * + *

The language code for the language of the documents that the classifier was trained + * on.

+ * + */ + LanguageCode?: LanguageCode | string; + + /** + * + *

Additional information about the status of the classifier.

+ * + */ + Message?: string; + + /** + * + *

Provides output results configuration parameters for custom classifier jobs.

+ * + */ + OutputDataConfig?: DocumentClassifierOutputDataConfig; + + /** + * + *

The status of the document classifier. If the status is TRAINED the + * classifier is ready to use. If the status is FAILED you can see additional + * information about why the classifier wasn't trained in the Message field.

+ * + */ + Status?: ModelStatus | string; + + /** + * + *

The time that the document classifier was submitted for training.

+ * + */ + SubmitTime?: Date; + + /** + * + *

The time that training of the document classifier was completed. + * Indicates the time when the training completes on documentation classifiers. You are billed for + * the time interval between this time and the value of TrainingStartTime.

+ * + */ + TrainingEndTime?: Date; + + /** + * + *

Indicates the time when the training starts on documentation classifiers. You are billed for + * the time interval between this time and the value of TrainingEndTime.

+ * + */ + TrainingStartTime?: Date; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your custom classifier. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace DocumentClassifierProperties { + export function isa(o: any): o is DocumentClassifierProperties { + return _smithy.isa(o, "DocumentClassifierProperties"); + } +} + +/** + * + *

Returns the code for the dominant language in the input text and the level of + * confidence that Amazon Comprehend has in the accuracy of the detection.

+ * + */ +export interface DominantLanguage { + __type?: "DominantLanguage"; + /** + * + *

The RFC 5646 language code for the dominant language. For more information about RFC + * 5646, see Tags for Identifying + * Languages on the IETF Tools web site.

+ * + */ + LanguageCode?: string; + + /** + * + *

The level of confidence that Amazon Comprehend has in the accuracy of the detection.

+ * + */ + Score?: number; +} + +export namespace DominantLanguage { + export function isa(o: any): o is DominantLanguage { + return _smithy.isa(o, "DominantLanguage"); + } +} + +/** + * + *

Provides information for filtering a list of dominant language detection jobs. For more + * information, see the operation.

+ * + */ +export interface DominantLanguageDetectionJobFilter { + __type?: "DominantLanguageDetectionJobFilter"; + /** + * + *

Filters on the name of the job.

+ * + */ + JobName?: string; + + /** + * + *

Filters the list of jobs based on job status. Returns only jobs with the specified + * status.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted after the specified time. Jobs are returned in descending order, + * newest to oldest.

+ * + */ + SubmitTimeAfter?: Date; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted before the specified time. Jobs are returned in ascending order, + * oldest to newest.

+ * + */ + SubmitTimeBefore?: Date; +} + +export namespace DominantLanguageDetectionJobFilter { + export function isa(o: any): o is DominantLanguageDetectionJobFilter { + return _smithy.isa(o, "DominantLanguageDetectionJobFilter"); + } +} + +/** + * + *

Provides information about a dominant language detection job.

+ * + */ +export interface DominantLanguageDetectionJobProperties { + __type?: "DominantLanguageDetectionJobProperties"; + /** + * + *

The Amazon Resource Name (ARN) that gives Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn?: string; + + /** + * + *

The time that the dominant language detection job completed.

+ * + */ + EndTime?: Date; + + /** + * + *

The input data configuration that you supplied when you created the dominant language + * detection job.

+ * + */ + InputDataConfig?: InputDataConfig; + + /** + * + *

The identifier assigned to the dominant language detection job.

+ * + */ + JobId?: string; + + /** + * + *

The name that you assigned to the dominant language detection job.

+ * + */ + JobName?: string; + + /** + * + *

The current status of the dominant language detection job. If the status is + * FAILED, the Message field shows the reason for the failure.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

A description for the status of a job.

+ * + */ + Message?: string; + + /** + * + *

The output data configuration that you supplied when you created the dominant language + * detection job.

+ * + */ + OutputDataConfig?: OutputDataConfig; + + /** + * + *

The time that the dominant language detection job was submitted for processing.

+ * + */ + SubmitTime?: Date; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your dominant language detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace DominantLanguageDetectionJobProperties { + export function isa(o: any): o is DominantLanguageDetectionJobProperties { + return _smithy.isa(o, "DominantLanguageDetectionJobProperties"); + } +} + +/** + * + *

The filter used to determine which endpoints are are returned. You can filter jobs on their name, model, status, or the date and time that they were created. + * You can only set one filter at a time.

+ * + */ +export interface EndpointFilter { + __type?: "EndpointFilter"; + /** + * + *

Specifies a date after which the returned endpoint or endpoints were created.

+ * + */ + CreationTimeAfter?: Date; + + /** + * + *

Specifies a date before which the returned endpoint or endpoints were created.

+ * + */ + CreationTimeBefore?: Date; + + /** + * + *

The Amazon Resource Number (ARN) of the model to which the endpoint is attached.

+ * + */ + ModelArn?: string; + + /** + * + *

Specifies the status of the endpoint being returned. Possible values are: Creating, Ready, Updating, Deleting, Failed.

+ * + */ + Status?: EndpointStatus | string; +} + +export namespace EndpointFilter { + export function isa(o: any): o is EndpointFilter { + return _smithy.isa(o, "EndpointFilter"); + } +} + +/** + * + *

Specifies information about the specified endpoint.

+ * + */ +export interface EndpointProperties { + __type?: "EndpointProperties"; + /** + * + *

The creation date and time of the endpoint.

+ * + */ + CreationTime?: Date; + + /** + * + *

The number of inference units currently used by the model using this endpoint.

+ * + */ + CurrentInferenceUnits?: number; + + /** + * + *

The desired number of inference units to be used by the model using this endpoint. Each + * inference unit represents of a throughput of 100 characters per second.

+ * + */ + DesiredInferenceUnits?: number; + + /** + * + *

The Amazon Resource Number (ARN) of the endpoint.

+ * + */ + EndpointArn?: string; + + /** + * + *

The date and time that the endpoint was last modified.

+ * + */ + LastModifiedTime?: Date; + + /** + * + *

Specifies a reason for failure in cases of Failed status.

+ * + */ + Message?: string; + + /** + * + *

The Amazon Resource Number (ARN) of the model to which the endpoint is attached.

+ * + */ + ModelArn?: string; + + /** + * + *

Specifies the status of the endpoint. Because the endpoint updates and creation are asynchronous, so + * customers will need to wait for the endpoint to be Ready status before making inference requests.

+ * + */ + Status?: EndpointStatus | string; +} + +export namespace EndpointProperties { + export function isa(o: any): o is EndpointProperties { + return _smithy.isa(o, "EndpointProperties"); + } +} + +export enum EndpointStatus { + CREATING = "CREATING", + DELETING = "DELETING", + FAILED = "FAILED", + IN_SERVICE = "IN_SERVICE", + UPDATING = "UPDATING" +} + +/** + * + *

Provides information for filtering a list of dominant language detection jobs. For more + * information, see the operation.

+ * + */ +export interface EntitiesDetectionJobFilter { + __type?: "EntitiesDetectionJobFilter"; + /** + * + *

Filters on the name of the job.

+ * + */ + JobName?: string; + + /** + * + *

Filters the list of jobs based on job status. Returns only jobs with the specified + * status.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted after the specified time. Jobs are returned in descending order, + * newest to oldest.

+ * + */ + SubmitTimeAfter?: Date; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted before the specified time. Jobs are returned in ascending order, + * oldest to newest.

+ * + */ + SubmitTimeBefore?: Date; +} + +export namespace EntitiesDetectionJobFilter { + export function isa(o: any): o is EntitiesDetectionJobFilter { + return _smithy.isa(o, "EntitiesDetectionJobFilter"); + } +} + +/** + * + *

Provides information about an entities detection job.

+ * + */ +export interface EntitiesDetectionJobProperties { + __type?: "EntitiesDetectionJobProperties"; + /** + * + *

The Amazon Resource Name (ARN) that gives Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn?: string; + + /** + * + *

The time that the entities detection job completed

+ * + */ + EndTime?: Date; + + /** + * + *

The Amazon Resource Name (ARN) that identifies the entity recognizer.

+ * + */ + EntityRecognizerArn?: string; + + /** + * + *

The input data configuration that you supplied when you created the entities detection + * job.

+ * + */ + InputDataConfig?: InputDataConfig; + + /** + * + *

The identifier assigned to the entities detection job.

+ * + */ + JobId?: string; + + /** + * + *

The name that you assigned the entities detection job.

+ * + */ + JobName?: string; + + /** + * + *

The current status of the entities detection job. If the status is FAILED, + * the Message field shows the reason for the failure.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

The language code of the input documents.

+ * + */ + LanguageCode?: LanguageCode | string; + + /** + * + *

A description of the status of a job.

+ * + */ + Message?: string; + + /** + * + *

The output data configuration that you supplied when you created the entities detection + * job.

+ * + */ + OutputDataConfig?: OutputDataConfig; + + /** + * + *

The time that the entities detection job was submitted for processing.

+ * + */ + SubmitTime?: Date; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your entity detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace EntitiesDetectionJobProperties { + export function isa(o: any): o is EntitiesDetectionJobProperties { + return _smithy.isa(o, "EntitiesDetectionJobProperties"); + } +} + +/** + * + *

Provides information about an entity.

+ *

+ * + */ +export interface Entity { + __type?: "Entity"; + /** + * + *

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.

+ * + */ + BeginOffset?: number; + + /** + * + *

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.

+ * + */ + EndOffset?: number; + + /** + * + *

The level of confidence that Amazon Comprehend has in the accuracy of the detection.

+ * + */ + Score?: number; + + /** + * + *

The text of the entity.

+ * + */ + Text?: string; + + /** + * + *

The entity's type.

+ * + */ + Type?: EntityType | string; +} + +export namespace Entity { + export function isa(o: any): o is Entity { + return _smithy.isa(o, "Entity"); + } +} + +/** + * + *

Describes the annotations associated with a entity recognizer.

+ * + */ +export interface EntityRecognizerAnnotations { + __type?: "EntityRecognizerAnnotations"; + /** + * + *

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

+ * + */ + S3Uri: string | undefined; +} + +export namespace EntityRecognizerAnnotations { + export function isa(o: any): o is EntityRecognizerAnnotations { + return _smithy.isa(o, "EntityRecognizerAnnotations"); + } +} + +/** + * + *

Describes the training documents submitted with an entity recognizer.

+ * + */ +export interface EntityRecognizerDocuments { + __type?: "EntityRecognizerDocuments"; + /** + * + *

Specifies the Amazon S3 location where the training documents for an entity recognizer are located. The + * URI must be in the same region as the API endpoint that you are calling.

+ * + */ + S3Uri: string | undefined; +} + +export namespace EntityRecognizerDocuments { + export function isa(o: any): o is EntityRecognizerDocuments { + return _smithy.isa(o, "EntityRecognizerDocuments"); + } +} + +/** + * + *

Describes the entity recognizer submitted with an entity recognizer.

+ * + */ +export interface EntityRecognizerEntityList { + __type?: "EntityRecognizerEntityList"; + /** + * + *

Specifies the Amazon S3 location where the entity list is located. The URI must be in the same region as the API endpoint that you are calling.

+ * + */ + S3Uri: string | undefined; +} + +export namespace EntityRecognizerEntityList { + export function isa(o: any): o is EntityRecognizerEntityList { + return _smithy.isa(o, "EntityRecognizerEntityList"); + } +} + +/** + * + *

Detailed information about the accuracy of an entity recognizer. + *

+ * + */ +export interface EntityRecognizerEvaluationMetrics { + __type?: "EntityRecognizerEvaluationMetrics"; + /** + * + *

A measure of how accurate the recognizer results are for the test data. It is + * derived from the Precision and Recall values. The F1Score is + * the harmonic average of the two scores. The highest score is 1, and the worst score is 0. + *

+ * + */ + F1Score?: number; + + /** + * + *

A measure of the usefulness of the recognizer results in the test data. High precision + * means that the recognizer returned substantially more relevant results than irrelevant ones. + *

+ * + */ + Precision?: number; + + /** + * + *

A measure of how complete the recognizer results are for the test data. High recall means that the recognizer returned most of the relevant results.

+ * + */ + Recall?: number; +} + +export namespace EntityRecognizerEvaluationMetrics { + export function isa(o: any): o is EntityRecognizerEvaluationMetrics { + return _smithy.isa(o, "EntityRecognizerEvaluationMetrics"); + } +} + +/** + * + *

Provides information for filtering a list of entity recognizers. You can only specify + * one filtering parameter in a request. For more information, see the operation./>

+ * + */ +export interface EntityRecognizerFilter { + __type?: "EntityRecognizerFilter"; + /** + * + *

The status of an entity recognizer.

+ * + */ + Status?: ModelStatus | string; + + /** + * + *

Filters the list of entities based on the time that the list was submitted for processing. + * Returns only jobs submitted after the specified time. Jobs are returned in ascending order, + * oldest to newest.

+ * + */ + SubmitTimeAfter?: Date; + + /** + * + *

Filters the list of entities based on the time that the list was submitted for processing. + * Returns only jobs submitted before the specified time. Jobs are returned in descending order, + * newest to oldest.

+ * + */ + SubmitTimeBefore?: Date; +} + +export namespace EntityRecognizerFilter { + export function isa(o: any): o is EntityRecognizerFilter { + return _smithy.isa(o, "EntityRecognizerFilter"); + } +} + +/** + * + *

Specifies the format and location of the input data.

+ * + */ +export interface EntityRecognizerInputDataConfig { + __type?: "EntityRecognizerInputDataConfig"; + /** + * + *

S3 location of the annotations file for an entity recognizer.

+ * + */ + Annotations?: EntityRecognizerAnnotations; + + /** + * + *

S3 location of the documents folder for an entity recognizer

+ * + */ + Documents: EntityRecognizerDocuments | undefined; + + /** + * + *

S3 location of the entity list for an entity recognizer.

+ * + */ + EntityList?: EntityRecognizerEntityList; + + /** + * + *

The entity types in the input data for an entity recognizer. A maximum of 12 entity types can be used at one time to train an entity recognizer.

+ * + */ + EntityTypes: Array | undefined; +} + +export namespace EntityRecognizerInputDataConfig { + export function isa(o: any): o is EntityRecognizerInputDataConfig { + return _smithy.isa(o, "EntityRecognizerInputDataConfig"); + } +} + +/** + * + *

Detailed information about an entity recognizer.

+ * + */ +export interface EntityRecognizerMetadata { + __type?: "EntityRecognizerMetadata"; + /** + * + *

Entity types from the metadata of an entity recognizer.

+ * + */ + EntityTypes?: Array; + + /** + * + *

Detailed information about the accuracy of an entity recognizer.

+ * + */ + EvaluationMetrics?: EntityRecognizerEvaluationMetrics; + + /** + * + *

The number of documents in the input data that were used to test the entity recognizer. Typically this is 10 to 20 percent of the input documents.

+ * + */ + NumberOfTestDocuments?: number; + + /** + * + *

The number of documents in the input data that were used to train the entity recognizer. Typically this is 80 to 90 percent of the input documents.

+ * + */ + NumberOfTrainedDocuments?: number; +} + +export namespace EntityRecognizerMetadata { + export function isa(o: any): o is EntityRecognizerMetadata { + return _smithy.isa(o, "EntityRecognizerMetadata"); + } +} + +/** + * + *

Individual item from the list of entity types in the metadata of an entity recognizer.

+ * + */ +export interface EntityRecognizerMetadataEntityTypesListItem { + __type?: "EntityRecognizerMetadataEntityTypesListItem"; + /** + * + *

Detailed information about the accuracy of the entity recognizer for a specific item on the list of entity types.

+ * + */ + EvaluationMetrics?: EntityTypesEvaluationMetrics; + + /** + * + *

Indicates the number of times the given entity type was seen in the training data.

+ * + */ + NumberOfTrainMentions?: number; + + /** + * + *

Type of entity from the list of entity types in the metadata of an entity recognizer.

+ * + */ + Type?: string; +} + +export namespace EntityRecognizerMetadataEntityTypesListItem { + export function isa( + o: any + ): o is EntityRecognizerMetadataEntityTypesListItem { + return _smithy.isa(o, "EntityRecognizerMetadataEntityTypesListItem"); + } +} + +/** + * + *

Describes information about an entity recognizer.

+ * + */ +export interface EntityRecognizerProperties { + __type?: "EntityRecognizerProperties"; + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Management (IAM) role that grants Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn?: string; + + /** + * + *

The time that the recognizer creation completed.

+ * + */ + EndTime?: Date; + + /** + * + *

The Amazon Resource Name (ARN) that identifies the entity recognizer.

+ * + */ + EntityRecognizerArn?: string; + + /** + * + *

The input data properties of an entity recognizer.

+ * + */ + InputDataConfig?: EntityRecognizerInputDataConfig; + + /** + * + *

The language of the input documents. All documents must be in the same language. Only + * English ("en") is currently supported.

+ * + */ + LanguageCode?: LanguageCode | string; + + /** + * + *

A description of the status of the recognizer.

+ * + */ + Message?: string; + + /** + * + *

Provides information about an entity recognizer.

+ * + */ + RecognizerMetadata?: EntityRecognizerMetadata; + + /** + * + *

Provides the status of the entity recognizer.

+ * + */ + Status?: ModelStatus | string; + + /** + * + *

The time that the recognizer was submitted for processing.

+ * + */ + SubmitTime?: Date; + + /** + * + *

The time that training of the entity recognizer was completed.

+ * + */ + TrainingEndTime?: Date; + + /** + * + *

The time that training of the entity recognizer started.

+ * + */ + TrainingStartTime?: Date; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your custom entity recognizer. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace EntityRecognizerProperties { + export function isa(o: any): o is EntityRecognizerProperties { + return _smithy.isa(o, "EntityRecognizerProperties"); + } +} + +export enum EntityType { + COMMERCIAL_ITEM = "COMMERCIAL_ITEM", + DATE = "DATE", + EVENT = "EVENT", + LOCATION = "LOCATION", + ORGANIZATION = "ORGANIZATION", + OTHER = "OTHER", + PERSON = "PERSON", + QUANTITY = "QUANTITY", + TITLE = "TITLE" +} + +/** + * + *

Detailed information about the accuracy of an entity recognizer for a specific entity type.

+ * + */ +export interface EntityTypesEvaluationMetrics { + __type?: "EntityTypesEvaluationMetrics"; + /** + * + *

A measure of how accurate the recognizer results are for for a specific entity type in the test data. It is + * derived from the Precision and Recall values. The F1Score is + * the harmonic average of the two scores. The highest score is 1, and the worst score is 0. + *

+ * + */ + F1Score?: number; + + /** + * + *

A measure of the usefulness of the recognizer results for a specific entity type in the test data. High precision + * means that the recognizer returned substantially more relevant results than irrelevant ones. + *

+ * + */ + Precision?: number; + + /** + * + *

A measure of how complete the recognizer results are for a specific entity type in the test data. High recall means that the recognizer + * returned most of the relevant results.

+ * + */ + Recall?: number; +} + +export namespace EntityTypesEvaluationMetrics { + export function isa(o: any): o is EntityTypesEvaluationMetrics { + return _smithy.isa(o, "EntityTypesEvaluationMetrics"); + } +} + +/** + * + *

Information about an individual item on a list of entity types.

+ * + */ +export interface EntityTypesListItem { + __type?: "EntityTypesListItem"; + /** + * + *

Entity type of an item on an entity type list.

+ * + */ + Type: string | undefined; +} + +export namespace EntityTypesListItem { + export function isa(o: any): o is EntityTypesListItem { + return _smithy.isa(o, "EntityTypesListItem"); + } +} + +/** + * + *

The input properties for a topic detection job.

+ * + */ +export interface InputDataConfig { + __type?: "InputDataConfig"; + /** + * + *

Specifies how the text in an input file should be processed:

+ *
    + *
  • + *

    + * ONE_DOC_PER_FILE - Each file is considered a separate document. Use + * this option when you are processing large documents, such as newspaper articles or + * scientific papers.

    + *
  • + *
  • + *

    + * ONE_DOC_PER_LINE - Each line in a file is considered a separate + * document. Use this option when you are processing many short documents, such as text + * messages.

    + *
  • + *
+ * + */ + InputFormat?: InputFormat | string; + + /** + * + *

The Amazon S3 URI for the input data. The URI must be in same 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 data files.

+ *

For example, if you use the URI S3://bucketName/prefix, if the prefix is a + * single file, Amazon Comprehend uses that file as input. If more than one file begins with the prefix, + * Amazon Comprehend uses all of them as input.

+ * + */ + S3Uri: string | undefined; +} + +export namespace InputDataConfig { + export function isa(o: any): o is InputDataConfig { + return _smithy.isa(o, "InputDataConfig"); + } +} + +export enum InputFormat { + ONE_DOC_PER_FILE = "ONE_DOC_PER_FILE", + ONE_DOC_PER_LINE = "ONE_DOC_PER_LINE" +} + +/** + * + *

An internal server error occurred. Retry your request.

+ * + */ +export interface InternalServerException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "InternalServerException"; + $fault: "server"; + Message?: string; +} + +export namespace InternalServerException { + export function isa(o: any): o is InternalServerException { + return _smithy.isa(o, "InternalServerException"); + } +} + +/** + * + *

The filter specified for the operation is invalid. + * Specify a different filter.

+ * + */ +export interface InvalidFilterException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "InvalidFilterException"; + $fault: "client"; + Message?: string; +} + +export namespace InvalidFilterException { + export function isa(o: any): o is InvalidFilterException { + return _smithy.isa(o, "InvalidFilterException"); + } +} + +/** + * + *

The request + * is invalid.

+ * + */ +export interface InvalidRequestException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "InvalidRequestException"; + $fault: "client"; + Message?: string; +} + +export namespace InvalidRequestException { + export function isa(o: any): o is InvalidRequestException { + return _smithy.isa(o, "InvalidRequestException"); + } +} + +/** + * + *

The specified job was not found. Check the job ID and try again.

+ * + */ +export interface JobNotFoundException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "JobNotFoundException"; + $fault: "client"; + Message?: string; +} + +export namespace JobNotFoundException { + export function isa(o: any): o is JobNotFoundException { + return _smithy.isa(o, "JobNotFoundException"); + } +} + +export enum JobStatus { + COMPLETED = "COMPLETED", + FAILED = "FAILED", + IN_PROGRESS = "IN_PROGRESS", + STOPPED = "STOPPED", + STOP_REQUESTED = "STOP_REQUESTED", + SUBMITTED = "SUBMITTED" +} + +/** + * + *

Describes a key noun phrase.

+ * + */ +export interface KeyPhrase { + __type?: "KeyPhrase"; + /** + * + *

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.

+ * + */ + BeginOffset?: number; + + /** + * + *

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.

+ * + */ + EndOffset?: number; + + /** + * + *

The level of confidence that Amazon Comprehend has in the accuracy of the detection.

+ * + */ + Score?: number; + + /** + * + *

The text of a key noun phrase.

+ * + */ + Text?: string; +} + +export namespace KeyPhrase { + export function isa(o: any): o is KeyPhrase { + return _smithy.isa(o, "KeyPhrase"); + } +} + +/** + * + *

Provides information for filtering a list of dominant language detection jobs. For more + * information, see the operation.

+ * + */ +export interface KeyPhrasesDetectionJobFilter { + __type?: "KeyPhrasesDetectionJobFilter"; + /** + * + *

Filters on the name of the job.

+ * + */ + JobName?: string; + + /** + * + *

Filters the list of jobs based on job status. Returns only jobs with the specified + * status.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted after the specified time. Jobs are returned in descending order, + * newest to oldest.

+ * + */ + SubmitTimeAfter?: Date; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted before the specified time. Jobs are returned in ascending order, + * oldest to newest.

+ * + */ + SubmitTimeBefore?: Date; +} + +export namespace KeyPhrasesDetectionJobFilter { + export function isa(o: any): o is KeyPhrasesDetectionJobFilter { + return _smithy.isa(o, "KeyPhrasesDetectionJobFilter"); + } +} + +/** + * + *

Provides information about a key phrases detection job.

+ * + */ +export interface KeyPhrasesDetectionJobProperties { + __type?: "KeyPhrasesDetectionJobProperties"; + /** + * + *

The Amazon Resource Name (ARN) that gives Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn?: string; + + /** + * + *

The time that the key phrases detection job completed.

+ * + */ + EndTime?: Date; + + /** + * + *

The input data configuration that you supplied when you created the key phrases detection + * job.

+ * + */ + InputDataConfig?: InputDataConfig; + + /** + * + *

The identifier assigned to the key phrases detection job.

+ * + */ + JobId?: string; + + /** + * + *

The name that you assigned the key phrases detection job.

+ * + */ + JobName?: string; + + /** + * + *

The current status of the key phrases detection job. If the status is FAILED, + * the Message field shows the reason for the failure.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

The language code of the input documents.

+ * + */ + LanguageCode?: LanguageCode | string; + + /** + * + *

A description of the status of a job.

+ * + */ + Message?: string; + + /** + * + *

The output data configuration that you supplied when you created the key phrases detection + * job.

+ * + */ + OutputDataConfig?: OutputDataConfig; + + /** + * + *

The time that the key phrases detection job was submitted for processing.

+ * + */ + SubmitTime?: Date; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your key phrases detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace KeyPhrasesDetectionJobProperties { + export function isa(o: any): o is KeyPhrasesDetectionJobProperties { + return _smithy.isa(o, "KeyPhrasesDetectionJobProperties"); + } +} + +/** + * + *

The KMS customer managed key (CMK) entered cannot be validated. Verify the key and re-enter it.

+ * + */ +export interface KmsKeyValidationException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "KmsKeyValidationException"; + $fault: "client"; + Message?: string; +} + +export namespace KmsKeyValidationException { + export function isa(o: any): o is KmsKeyValidationException { + return _smithy.isa(o, "KmsKeyValidationException"); + } +} + +export enum LanguageCode { + AR = "ar", + DE = "de", + EN = "en", + ES = "es", + FR = "fr", + HI = "hi", + IT = "it", + JA = "ja", + KO = "ko", + PT = "pt", + ZH = "zh", + ZH_TW = "zh-TW" +} + +export interface ListDocumentClassificationJobsRequest { + __type?: "ListDocumentClassificationJobsRequest"; + /** + * + *

Filters the jobs that are returned. You can filter jobs on their names, status, or the + * date and time that they were submitted. You can only set one filter at a time.

+ * + */ + Filter?: DocumentClassificationJobFilter; + + /** + * + *

The maximum number of results to return in each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListDocumentClassificationJobsRequest { + export function isa(o: any): o is ListDocumentClassificationJobsRequest { + return _smithy.isa(o, "ListDocumentClassificationJobsRequest"); + } +} + +export interface ListDocumentClassificationJobsResponse + extends $MetadataBearer { + __type?: "ListDocumentClassificationJobsResponse"; + /** + * + *

A list containing the properties of each job returned.

+ * + */ + DocumentClassificationJobPropertiesList?: Array< + DocumentClassificationJobProperties + >; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListDocumentClassificationJobsResponse { + export function isa(o: any): o is ListDocumentClassificationJobsResponse { + return _smithy.isa(o, "ListDocumentClassificationJobsResponse"); + } +} + +export interface ListDocumentClassifiersRequest { + __type?: "ListDocumentClassifiersRequest"; + /** + * + *

Filters the jobs that are returned. You can filter jobs on their name, status, or the date + * and time that they were submitted. You can only set one filter at a time.

+ * + */ + Filter?: DocumentClassifierFilter; + + /** + * + *

The maximum number of results to return in each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListDocumentClassifiersRequest { + export function isa(o: any): o is ListDocumentClassifiersRequest { + return _smithy.isa(o, "ListDocumentClassifiersRequest"); + } +} + +export interface ListDocumentClassifiersResponse extends $MetadataBearer { + __type?: "ListDocumentClassifiersResponse"; + /** + * + *

A list containing the properties of each job returned.

+ * + */ + DocumentClassifierPropertiesList?: Array; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListDocumentClassifiersResponse { + export function isa(o: any): o is ListDocumentClassifiersResponse { + return _smithy.isa(o, "ListDocumentClassifiersResponse"); + } +} + +export interface ListDominantLanguageDetectionJobsRequest { + __type?: "ListDominantLanguageDetectionJobsRequest"; + /** + * + *

Filters that jobs that are returned. You can filter jobs on their name, status, or the + * date and time that they were submitted. You can only set one filter at a time.

+ * + */ + Filter?: DominantLanguageDetectionJobFilter; + + /** + * + *

The maximum number of results to return in each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListDominantLanguageDetectionJobsRequest { + export function isa(o: any): o is ListDominantLanguageDetectionJobsRequest { + return _smithy.isa(o, "ListDominantLanguageDetectionJobsRequest"); + } +} + +export interface ListDominantLanguageDetectionJobsResponse + extends $MetadataBearer { + __type?: "ListDominantLanguageDetectionJobsResponse"; + /** + * + *

A list containing the properties of each job that is returned.

+ * + */ + DominantLanguageDetectionJobPropertiesList?: Array< + DominantLanguageDetectionJobProperties + >; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListDominantLanguageDetectionJobsResponse { + export function isa(o: any): o is ListDominantLanguageDetectionJobsResponse { + return _smithy.isa(o, "ListDominantLanguageDetectionJobsResponse"); + } +} + +export interface ListEndpointsRequest { + __type?: "ListEndpointsRequest"; + /** + * + *

Filters the endpoints that are returned. You can filter endpoints on their name, model, status, or the date and time that they were created. + * You can only set one filter at a time.

+ * + */ + Filter?: EndpointFilter; + + /** + * + *

The maximum number of results to return in each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListEndpointsRequest { + export function isa(o: any): o is ListEndpointsRequest { + return _smithy.isa(o, "ListEndpointsRequest"); + } +} + +export interface ListEndpointsResponse extends $MetadataBearer { + __type?: "ListEndpointsResponse"; + /** + * + *

Displays a list of endpoint properties being retrieved by the service in response to the request.

+ * + */ + EndpointPropertiesList?: Array; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListEndpointsResponse { + export function isa(o: any): o is ListEndpointsResponse { + return _smithy.isa(o, "ListEndpointsResponse"); + } +} + +export interface ListEntitiesDetectionJobsRequest { + __type?: "ListEntitiesDetectionJobsRequest"; + /** + * + *

Filters the jobs that are returned. You can filter jobs on their name, status, or the date + * and time that they were submitted. You can only set one filter at a time.

+ * + */ + Filter?: EntitiesDetectionJobFilter; + + /** + * + *

The maximum number of results to return in each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListEntitiesDetectionJobsRequest { + export function isa(o: any): o is ListEntitiesDetectionJobsRequest { + return _smithy.isa(o, "ListEntitiesDetectionJobsRequest"); + } +} + +export interface ListEntitiesDetectionJobsResponse extends $MetadataBearer { + __type?: "ListEntitiesDetectionJobsResponse"; + /** + * + *

A list containing the properties of each job that is returned.

+ * + */ + EntitiesDetectionJobPropertiesList?: Array; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListEntitiesDetectionJobsResponse { + export function isa(o: any): o is ListEntitiesDetectionJobsResponse { + return _smithy.isa(o, "ListEntitiesDetectionJobsResponse"); + } +} + +export interface ListEntityRecognizersRequest { + __type?: "ListEntityRecognizersRequest"; + /** + * + *

Filters the list of entities returned. You can filter on Status, SubmitTimeBefore, or SubmitTimeAfter. You can only set one filter at a time.

+ * + */ + Filter?: EntityRecognizerFilter; + + /** + * + *

The maximum number of results to return on each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListEntityRecognizersRequest { + export function isa(o: any): o is ListEntityRecognizersRequest { + return _smithy.isa(o, "ListEntityRecognizersRequest"); + } +} + +export interface ListEntityRecognizersResponse extends $MetadataBearer { + __type?: "ListEntityRecognizersResponse"; + /** + * + *

The list of properties of an entity recognizer.

+ * + */ + EntityRecognizerPropertiesList?: Array; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListEntityRecognizersResponse { + export function isa(o: any): o is ListEntityRecognizersResponse { + return _smithy.isa(o, "ListEntityRecognizersResponse"); + } +} + +export interface ListKeyPhrasesDetectionJobsRequest { + __type?: "ListKeyPhrasesDetectionJobsRequest"; + /** + * + *

Filters the jobs that are returned. You can filter jobs on their name, status, or the date + * and time that they were submitted. You can only set one filter at a time.

+ * + */ + Filter?: KeyPhrasesDetectionJobFilter; + + /** + * + *

The maximum number of results to return in each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListKeyPhrasesDetectionJobsRequest { + export function isa(o: any): o is ListKeyPhrasesDetectionJobsRequest { + return _smithy.isa(o, "ListKeyPhrasesDetectionJobsRequest"); + } +} + +export interface ListKeyPhrasesDetectionJobsResponse extends $MetadataBearer { + __type?: "ListKeyPhrasesDetectionJobsResponse"; + /** + * + *

A list containing the properties of each job that is returned.

+ * + */ + KeyPhrasesDetectionJobPropertiesList?: Array< + KeyPhrasesDetectionJobProperties + >; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListKeyPhrasesDetectionJobsResponse { + export function isa(o: any): o is ListKeyPhrasesDetectionJobsResponse { + return _smithy.isa(o, "ListKeyPhrasesDetectionJobsResponse"); + } +} + +export interface ListSentimentDetectionJobsRequest { + __type?: "ListSentimentDetectionJobsRequest"; + /** + * + *

Filters the jobs that are returned. You can filter jobs on their name, status, or the date + * and time that they were submitted. You can only set one filter at a time.

+ * + */ + Filter?: SentimentDetectionJobFilter; + + /** + * + *

The maximum number of results to return in each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListSentimentDetectionJobsRequest { + export function isa(o: any): o is ListSentimentDetectionJobsRequest { + return _smithy.isa(o, "ListSentimentDetectionJobsRequest"); + } +} + +export interface ListSentimentDetectionJobsResponse extends $MetadataBearer { + __type?: "ListSentimentDetectionJobsResponse"; + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; + + /** + * + *

A list containing the properties of each job that is returned.

+ * + */ + SentimentDetectionJobPropertiesList?: Array; +} + +export namespace ListSentimentDetectionJobsResponse { + export function isa(o: any): o is ListSentimentDetectionJobsResponse { + return _smithy.isa(o, "ListSentimentDetectionJobsResponse"); + } +} + +export interface ListTagsForResourceRequest { + __type?: "ListTagsForResourceRequest"; + /** + * + *

The Amazon Resource Name (ARN) of the given Amazon Comprehend resource you are querying.

+ * + */ + ResourceArn: string | undefined; +} + +export namespace ListTagsForResourceRequest { + export function isa(o: any): o is ListTagsForResourceRequest { + return _smithy.isa(o, "ListTagsForResourceRequest"); + } +} + +export interface ListTagsForResourceResponse extends $MetadataBearer { + __type?: "ListTagsForResourceResponse"; + /** + * + *

The Amazon Resource Name (ARN) of the given Amazon Comprehend resource you are querying.

+ * + */ + ResourceArn?: string; + + /** + * + *

Tags associated with the Amazon Comprehend resource being queried. A tag is a key-value pair that adds as a metadata to a resource used by Amazon Comprehend. For example, + * a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.

+ * + */ + Tags?: Array; +} + +export namespace ListTagsForResourceResponse { + export function isa(o: any): o is ListTagsForResourceResponse { + return _smithy.isa(o, "ListTagsForResourceResponse"); + } +} + +export interface ListTopicsDetectionJobsRequest { + __type?: "ListTopicsDetectionJobsRequest"; + /** + * + *

Filters the jobs that are returned. Jobs can be filtered on their name, status, or the + * date and time that they were submitted. You can set only one filter at a time.

+ * + */ + Filter?: TopicsDetectionJobFilter; + + /** + * + *

The maximum number of results to return in each page. The default is 100.

+ * + */ + MaxResults?: number; + + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; +} + +export namespace ListTopicsDetectionJobsRequest { + export function isa(o: any): o is ListTopicsDetectionJobsRequest { + return _smithy.isa(o, "ListTopicsDetectionJobsRequest"); + } +} + +export interface ListTopicsDetectionJobsResponse extends $MetadataBearer { + __type?: "ListTopicsDetectionJobsResponse"; + /** + * + *

Identifies the next page of results to return.

+ * + */ + NextToken?: string; + + /** + * + *

A list containing the properties of each job that is returned.

+ * + */ + TopicsDetectionJobPropertiesList?: Array; +} + +export namespace ListTopicsDetectionJobsResponse { + export function isa(o: any): o is ListTopicsDetectionJobsResponse { + return _smithy.isa(o, "ListTopicsDetectionJobsResponse"); + } +} + +export enum ModelStatus { + DELETING = "DELETING", + IN_ERROR = "IN_ERROR", + STOPPED = "STOPPED", + STOP_REQUESTED = "STOP_REQUESTED", + SUBMITTED = "SUBMITTED", + TRAINED = "TRAINED", + TRAINING = "TRAINING" +} + +/** + * + *

Provides configuration parameters for the output of topic detection jobs.

+ *

+ * + */ +export interface OutputDataConfig { + __type?: "OutputDataConfig"; + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt the output results from an analysis job. The KmsKeyId can be one of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    KMS Key Alias: "alias/ExampleAlias" + *

    + *
  • + *
  • + *

    ARN of a KMS Key Alias: "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias" + *

    + *
  • + *
+ * + */ + KmsKeyId?: string; + + /** + * + *

When you use the OutputDataConfig object with asynchronous operations, you + * specify the Amazon S3 location where you want to write the output data. The URI must be in the + * same region as the API endpoint that you are calling. The location is used as the prefix for + * the actual location of the output file.

+ *

When the topic detection job is finished, the service creates an output file in a + * directory specific to the job. The S3Uri field contains the location of the + * output file, called output.tar.gz. It is a compressed archive that contains the + * ouput of the operation.

+ * + */ + S3Uri: string | undefined; +} + +export namespace OutputDataConfig { + export function isa(o: any): o is OutputDataConfig { + return _smithy.isa(o, "OutputDataConfig"); + } +} + +/** + * + *

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.

+ * + */ +export interface PartOfSpeechTag { + __type?: "PartOfSpeechTag"; + /** + * + *

The confidence that Amazon Comprehend has that the part of speech was correctly identified.

+ * + */ + Score?: number; + + /** + * + *

Identifies the part of speech that the token represents.

+ * + */ + Tag?: PartOfSpeechTagType | string; +} + +export namespace PartOfSpeechTag { + export function isa(o: any): o is PartOfSpeechTag { + return _smithy.isa(o, "PartOfSpeechTag"); + } +} + +export enum PartOfSpeechTagType { + ADJ = "ADJ", + ADP = "ADP", + ADV = "ADV", + AUX = "AUX", + CCONJ = "CCONJ", + CONJ = "CONJ", + DET = "DET", + INTJ = "INTJ", + NOUN = "NOUN", + NUM = "NUM", + O = "O", + PART = "PART", + PRON = "PRON", + PROPN = "PROPN", + PUNCT = "PUNCT", + SCONJ = "SCONJ", + SYM = "SYM", + VERB = "VERB" +} + +/** + * + *

The specified name is already in use. Use a different name and try your request again.

+ * + */ +export interface ResourceInUseException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ResourceInUseException"; + $fault: "client"; + Message?: string; +} + +export namespace ResourceInUseException { + export function isa(o: any): o is ResourceInUseException { + return _smithy.isa(o, "ResourceInUseException"); + } +} + +/** + * + *

The maximum number of recognizers per account has been exceeded. Review the recognizers, perform cleanup, and then try your request again.

+ * + */ +export interface ResourceLimitExceededException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ResourceLimitExceededException"; + $fault: "client"; + Message?: string; +} + +export namespace ResourceLimitExceededException { + export function isa(o: any): o is ResourceLimitExceededException { + return _smithy.isa(o, "ResourceLimitExceededException"); + } +} + +/** + * + *

The specified resource ARN was not found. Check the ARN and try your request again.

+ * + */ +export interface ResourceNotFoundException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ResourceNotFoundException"; + $fault: "client"; + Message?: string; +} + +export namespace ResourceNotFoundException { + export function isa(o: any): o is ResourceNotFoundException { + return _smithy.isa(o, "ResourceNotFoundException"); + } +} + +/** + * + *

The specified resource is not available. Check to see if the resource is in + * the TRAINED state and try your request again.

+ * + */ +export interface ResourceUnavailableException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "ResourceUnavailableException"; + $fault: "client"; + Message?: string; +} + +export namespace ResourceUnavailableException { + export function isa(o: any): o is ResourceUnavailableException { + return _smithy.isa(o, "ResourceUnavailableException"); + } +} + +/** + * + *

Provides information for filtering a list of dominant language detection jobs. For more + * information, see the operation.

+ * + */ +export interface SentimentDetectionJobFilter { + __type?: "SentimentDetectionJobFilter"; + /** + * + *

Filters on the name of the job.

+ * + */ + JobName?: string; + + /** + * + *

Filters the list of jobs based on job status. Returns only jobs with the specified + * status.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted after the specified time. Jobs are returned in descending order, + * newest to oldest.

+ * + */ + SubmitTimeAfter?: Date; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Returns only jobs submitted before the specified time. Jobs are returned in ascending order, + * oldest to newest.

+ * + */ + SubmitTimeBefore?: Date; +} + +export namespace SentimentDetectionJobFilter { + export function isa(o: any): o is SentimentDetectionJobFilter { + return _smithy.isa(o, "SentimentDetectionJobFilter"); + } +} + +/** + * + *

Provides information about a sentiment detection job.

+ * + */ +export interface SentimentDetectionJobProperties { + __type?: "SentimentDetectionJobProperties"; + /** + * + *

The Amazon Resource Name (ARN) that gives Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn?: string; + + /** + * + *

The time that the sentiment detection job ended.

+ * + */ + EndTime?: Date; + + /** + * + *

The input data configuration that you supplied when you created the sentiment detection + * job.

+ * + */ + InputDataConfig?: InputDataConfig; + + /** + * + *

The identifier assigned to the sentiment detection job.

+ * + */ + JobId?: string; + + /** + * + *

The name that you assigned to the sentiment detection job

+ * + */ + JobName?: string; + + /** + * + *

The current status of the sentiment detection job. If the status is FAILED, + * the Messages field shows the reason for the failure.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

The language code of the input documents.

+ * + */ + LanguageCode?: LanguageCode | string; + + /** + * + *

A description of the status of a job.

+ * + */ + Message?: string; + + /** + * + *

The output data configuration that you supplied when you created the sentiment detection + * job.

+ * + */ + OutputDataConfig?: OutputDataConfig; + + /** + * + *

The time that the sentiment detection job was submitted for processing.

+ * + */ + SubmitTime?: Date; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your sentiment detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace SentimentDetectionJobProperties { + export function isa(o: any): o is SentimentDetectionJobProperties { + return _smithy.isa(o, "SentimentDetectionJobProperties"); + } +} + +/** + * + *

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

+ * + */ +export interface SentimentScore { + __type?: "SentimentScore"; + /** + * + *

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the + * MIXED sentiment.

+ * + */ + Mixed?: number; + + /** + * + *

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the + * NEGATIVE sentiment.

+ * + */ + Negative?: number; + + /** + * + *

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the + * NEUTRAL sentiment.

+ * + */ + Neutral?: number; + + /** + * + *

The level of confidence that Amazon Comprehend has in the accuracy of its detection of the + * POSITIVE sentiment.

+ * + */ + Positive?: number; +} + +export namespace SentimentScore { + export function isa(o: any): o is SentimentScore { + return _smithy.isa(o, "SentimentScore"); + } +} + +export enum SentimentType { + MIXED = "MIXED", + NEGATIVE = "NEGATIVE", + NEUTRAL = "NEUTRAL", + POSITIVE = "POSITIVE" +} + +export interface StartDocumentClassificationJobRequest { + __type?: "StartDocumentClassificationJobRequest"; + /** + * + *

A unique identifier for the request. If you do not set the client request token, Amazon Comprehend + * generates one.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that + * grants Amazon Comprehend read access to your input data.

+ * + */ + DataAccessRoleArn: string | undefined; + + /** + * + *

The Amazon Resource Name (ARN) of the document classifier to use to process the + * job.

+ * + */ + DocumentClassifierArn: string | undefined; + + /** + * + *

Specifies the format and location of the input data for the job.

+ * + */ + InputDataConfig: InputDataConfig | undefined; + + /** + * + *

The identifier of the job.

+ * + */ + JobName?: string; + + /** + * + *

Specifies where to send the output files.

+ * + */ + OutputDataConfig: OutputDataConfig | undefined; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your document classification job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace StartDocumentClassificationJobRequest { + export function isa(o: any): o is StartDocumentClassificationJobRequest { + return _smithy.isa(o, "StartDocumentClassificationJobRequest"); + } +} + +export interface StartDocumentClassificationJobResponse + extends $MetadataBearer { + __type?: "StartDocumentClassificationJobResponse"; + /** + * + *

The identifier generated for the job. To get the status of the job, use this identifier + * with the operation.

+ * + */ + JobId?: string; + + /** + * + *

The status of the job:

+ *
    + *
  • + *

    SUBMITTED - The job has been received and queued for processing.

    + *
  • + *
  • + *

    IN_PROGRESS - Amazon Comprehend is processing the job.

    + *
  • + *
  • + *

    COMPLETED - The job was successfully completed and the output is available.

    + *
  • + *
  • + *

    FAILED - The job did not complete. For details, use the operation.

    + *
  • + *
  • + *

    STOP_REQUESTED - Amazon Comprehend has received a stop request for the job and is processing the request.

    + *
  • + *
  • + *

    STOPPED - The job was successfully stopped without completing.

    + *
  • + *
+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StartDocumentClassificationJobResponse { + export function isa(o: any): o is StartDocumentClassificationJobResponse { + return _smithy.isa(o, "StartDocumentClassificationJobResponse"); + } +} + +export interface StartDominantLanguageDetectionJobRequest { + __type?: "StartDominantLanguageDetectionJobRequest"; + /** + * + *

A unique identifier for the request. If you do not set the client request token, Amazon Comprehend + * generates one.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that + * grants Amazon Comprehend read access to your input data. For more information, see https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions.html#auth-role-permissions.

+ * + */ + DataAccessRoleArn: string | undefined; + + /** + * + *

Specifies the format and location of the input data for the job.

+ * + */ + InputDataConfig: InputDataConfig | undefined; + + /** + * + *

An identifier for the job.

+ * + */ + JobName?: string; + + /** + * + *

Specifies where to send the output files.

+ * + */ + OutputDataConfig: OutputDataConfig | undefined; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your dominant language detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace StartDominantLanguageDetectionJobRequest { + export function isa(o: any): o is StartDominantLanguageDetectionJobRequest { + return _smithy.isa(o, "StartDominantLanguageDetectionJobRequest"); + } +} + +export interface StartDominantLanguageDetectionJobResponse + extends $MetadataBearer { + __type?: "StartDominantLanguageDetectionJobResponse"; + /** + * + *

The identifier generated for the job. To get the status of a job, use this identifier with + * the operation.

+ * + */ + JobId?: string; + + /** + * + *

The status of the job.

+ *
    + *
  • + *

    SUBMITTED - The job has been received and is queued for processing.

    + *
  • + *
  • + *

    IN_PROGRESS - Amazon Comprehend is processing the job.

    + *
  • + *
  • + *

    COMPLETED - The job was successfully completed and the output is available.

    + *
  • + *
  • + *

    FAILED - The job did not complete. To get details, use the operation.

    + *
  • + *
+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StartDominantLanguageDetectionJobResponse { + export function isa(o: any): o is StartDominantLanguageDetectionJobResponse { + return _smithy.isa(o, "StartDominantLanguageDetectionJobResponse"); + } +} + +export interface StartEntitiesDetectionJobRequest { + __type?: "StartEntitiesDetectionJobRequest"; + /** + * + *

A unique identifier for the request. If you don't set the client request token, Amazon Comprehend + * generates one.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that + * grants Amazon Comprehend read access to your input data. For more information, see https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions.html#auth-role-permissions.

+ * + */ + DataAccessRoleArn: string | undefined; + + /** + * + *

The Amazon Resource Name (ARN) that identifies the specific entity recognizer to be used by + * the StartEntitiesDetectionJob. This ARN is optional and is only used for a custom entity + * recognition job.

+ * + */ + EntityRecognizerArn?: string; + + /** + * + *

Specifies the format and location of the input data for the job.

+ * + */ + InputDataConfig: InputDataConfig | undefined; + + /** + * + *

The identifier of the job.

+ * + */ + JobName?: string; + + /** + * + *

The language of the input documents. All documents must be in the same language. + * You can specify any of the languages supported by Amazon Comprehend. If custom entities recognition is used, this + * parameter is ignored and the language used for training the model is used instead.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

Specifies where to send the output files.

+ * + */ + OutputDataConfig: OutputDataConfig | undefined; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your entity detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace StartEntitiesDetectionJobRequest { + export function isa(o: any): o is StartEntitiesDetectionJobRequest { + return _smithy.isa(o, "StartEntitiesDetectionJobRequest"); + } +} + +export interface StartEntitiesDetectionJobResponse extends $MetadataBearer { + __type?: "StartEntitiesDetectionJobResponse"; + /** + * + *

The identifier generated for the job. To get the status of job, use this identifier with + * the operation.

+ * + */ + JobId?: string; + + /** + * + *

The status of the job.

+ *
    + *
  • + *

    SUBMITTED - The job has been received and is queued for processing.

    + *
  • + *
  • + *

    IN_PROGRESS - Amazon Comprehend is processing the job.

    + *
  • + *
  • + *

    COMPLETED - The job was successfully completed and the output is available.

    + *
  • + *
  • + *

    FAILED - The job did not complete. To get details, use the operation.

    + *
  • + *
  • + *

    STOP_REQUESTED - Amazon Comprehend has received a stop request for the job and is processing the request.

    + *
  • + *
  • + *

    STOPPED - The job was successfully stopped without completing.

    + *
  • + *
+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StartEntitiesDetectionJobResponse { + export function isa(o: any): o is StartEntitiesDetectionJobResponse { + return _smithy.isa(o, "StartEntitiesDetectionJobResponse"); + } +} + +export interface StartKeyPhrasesDetectionJobRequest { + __type?: "StartKeyPhrasesDetectionJobRequest"; + /** + * + *

A unique identifier for the request. If you don't set the client request token, Amazon Comprehend + * generates one.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that + * grants Amazon Comprehend read access to your input data. For more information, see https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions.html#auth-role-permissions.

+ * + */ + DataAccessRoleArn: string | undefined; + + /** + * + *

Specifies the format and location of the input data for the job.

+ * + */ + InputDataConfig: InputDataConfig | undefined; + + /** + * + *

The identifier of the job.

+ * + */ + JobName?: string; + + /** + * + *

The language of the input documents. You can specify any of the primary languages supported by Amazon + * Comprehend. All + * documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

Specifies where to send the output files.

+ * + */ + OutputDataConfig: OutputDataConfig | undefined; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your key phrases detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace StartKeyPhrasesDetectionJobRequest { + export function isa(o: any): o is StartKeyPhrasesDetectionJobRequest { + return _smithy.isa(o, "StartKeyPhrasesDetectionJobRequest"); + } +} + +export interface StartKeyPhrasesDetectionJobResponse extends $MetadataBearer { + __type?: "StartKeyPhrasesDetectionJobResponse"; + /** + * + *

The identifier generated for the job. To get the status of a job, use this identifier with + * the operation.

+ * + */ + JobId?: string; + + /** + * + *

The status of the job.

+ *
    + *
  • + *

    SUBMITTED - The job has been received and is queued for processing.

    + *
  • + *
  • + *

    IN_PROGRESS - Amazon Comprehend is processing the job.

    + *
  • + *
  • + *

    COMPLETED - The job was successfully completed and the output is available.

    + *
  • + *
  • + *

    FAILED - The job did not complete. To get details, use the operation.

    + *
  • + *
+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StartKeyPhrasesDetectionJobResponse { + export function isa(o: any): o is StartKeyPhrasesDetectionJobResponse { + return _smithy.isa(o, "StartKeyPhrasesDetectionJobResponse"); + } +} + +export interface StartSentimentDetectionJobRequest { + __type?: "StartSentimentDetectionJobRequest"; + /** + * + *

A unique identifier for the request. If you don't set the client request token, Amazon Comprehend + * generates one.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that + * grants Amazon Comprehend read access to your input data. For more information, see https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions.html#auth-role-permissions.

+ * + */ + DataAccessRoleArn: string | undefined; + + /** + * + *

Specifies the format and location of the input data for the job.

+ * + */ + InputDataConfig: InputDataConfig | undefined; + + /** + * + *

The identifier of the job.

+ * + */ + JobName?: string; + + /** + * + *

The language of the input documents. You can specify any of the primary languages supported by Amazon + * Comprehend. All + * documents must be in the same language.

+ * + */ + LanguageCode: LanguageCode | string | undefined; + + /** + * + *

Specifies where to send the output files.

+ * + */ + OutputDataConfig: OutputDataConfig | undefined; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your sentiment detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace StartSentimentDetectionJobRequest { + export function isa(o: any): o is StartSentimentDetectionJobRequest { + return _smithy.isa(o, "StartSentimentDetectionJobRequest"); + } +} + +export interface StartSentimentDetectionJobResponse extends $MetadataBearer { + __type?: "StartSentimentDetectionJobResponse"; + /** + * + *

The identifier generated for the job. To get the status of a job, use this identifier with + * the operation.

+ * + */ + JobId?: string; + + /** + * + *

The status of the job.

+ *
    + *
  • + *

    SUBMITTED - The job has been received and is queued for processing.

    + *
  • + *
  • + *

    IN_PROGRESS - Amazon Comprehend is processing the job.

    + *
  • + *
  • + *

    COMPLETED - The job was successfully completed and the output is available.

    + *
  • + *
  • + *

    FAILED - The job did not complete. To get details, use the operation.

    + *
  • + *
+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StartSentimentDetectionJobResponse { + export function isa(o: any): o is StartSentimentDetectionJobResponse { + return _smithy.isa(o, "StartSentimentDetectionJobResponse"); + } +} + +export interface StartTopicsDetectionJobRequest { + __type?: "StartTopicsDetectionJobRequest"; + /** + * + *

A unique identifier for the request. If you do not set the client request token, Amazon Comprehend + * generates one.

+ * + */ + ClientRequestToken?: string; + + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role + * that grants Amazon Comprehend read access to your input data. For more information, see https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions.html#auth-role-permissions.

+ * + */ + DataAccessRoleArn: string | undefined; + + /** + * + *

Specifies the format and location of the input data for the job.

+ * + */ + InputDataConfig: InputDataConfig | undefined; + + /** + * + *

The identifier of the job.

+ * + */ + JobName?: string; + + /** + * + *

The number of topics to detect.

+ * + */ + NumberOfTopics?: number; + + /** + * + *

Specifies where to send the output files. The output is a compressed archive with two + * files, topic-terms.csv that lists the terms associated with each topic, and + * doc-topics.csv that lists the documents associated with each topic

+ * + */ + OutputDataConfig: OutputDataConfig | undefined; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your topic detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace StartTopicsDetectionJobRequest { + export function isa(o: any): o is StartTopicsDetectionJobRequest { + return _smithy.isa(o, "StartTopicsDetectionJobRequest"); + } +} + +export interface StartTopicsDetectionJobResponse extends $MetadataBearer { + __type?: "StartTopicsDetectionJobResponse"; + /** + * + *

The identifier generated for the job. To get the status of the job, use this identifier + * with the DescribeTopicDetectionJob operation.

+ * + */ + JobId?: string; + + /** + * + *

The status of the job:

+ *
    + *
  • + *

    SUBMITTED - The job has been received and is queued for processing.

    + *
  • + *
  • + *

    IN_PROGRESS - Amazon Comprehend is processing the job.

    + *
  • + *
  • + *

    COMPLETED - The job was successfully completed and the output is + * available.

    + *
  • + *
  • + *

    FAILED - The job did not complete. To get details, use the + * DescribeTopicDetectionJob operation.

    + *
  • + *
+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StartTopicsDetectionJobResponse { + export function isa(o: any): o is StartTopicsDetectionJobResponse { + return _smithy.isa(o, "StartTopicsDetectionJobResponse"); + } +} + +export interface StopDominantLanguageDetectionJobRequest { + __type?: "StopDominantLanguageDetectionJobRequest"; + /** + * + *

The identifier of the dominant language detection job to stop.

+ * + */ + JobId: string | undefined; +} + +export namespace StopDominantLanguageDetectionJobRequest { + export function isa(o: any): o is StopDominantLanguageDetectionJobRequest { + return _smithy.isa(o, "StopDominantLanguageDetectionJobRequest"); + } +} + +export interface StopDominantLanguageDetectionJobResponse + extends $MetadataBearer { + __type?: "StopDominantLanguageDetectionJobResponse"; + /** + * + *

The identifier of the dominant language detection job to stop.

+ * + */ + JobId?: string; + + /** + * + *

Either STOP_REQUESTED if the job is currently running, or + * STOPPED if the job was previously stopped with the + * StopDominantLanguageDetectionJob operation.

+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StopDominantLanguageDetectionJobResponse { + export function isa(o: any): o is StopDominantLanguageDetectionJobResponse { + return _smithy.isa(o, "StopDominantLanguageDetectionJobResponse"); + } +} + +export interface StopEntitiesDetectionJobRequest { + __type?: "StopEntitiesDetectionJobRequest"; + /** + * + *

The identifier of the entities detection job to stop.

+ * + */ + JobId: string | undefined; +} + +export namespace StopEntitiesDetectionJobRequest { + export function isa(o: any): o is StopEntitiesDetectionJobRequest { + return _smithy.isa(o, "StopEntitiesDetectionJobRequest"); + } +} + +export interface StopEntitiesDetectionJobResponse extends $MetadataBearer { + __type?: "StopEntitiesDetectionJobResponse"; + /** + * + *

The identifier of the entities detection job to stop.

+ * + */ + JobId?: string; + + /** + * + *

Either STOP_REQUESTED if the job is currently running, or + * STOPPED if the job was previously stopped with the + * StopEntitiesDetectionJob operation.

+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StopEntitiesDetectionJobResponse { + export function isa(o: any): o is StopEntitiesDetectionJobResponse { + return _smithy.isa(o, "StopEntitiesDetectionJobResponse"); + } +} + +export interface StopKeyPhrasesDetectionJobRequest { + __type?: "StopKeyPhrasesDetectionJobRequest"; + /** + * + *

The identifier of the key phrases detection job to stop.

+ * + */ + JobId: string | undefined; +} + +export namespace StopKeyPhrasesDetectionJobRequest { + export function isa(o: any): o is StopKeyPhrasesDetectionJobRequest { + return _smithy.isa(o, "StopKeyPhrasesDetectionJobRequest"); + } +} + +export interface StopKeyPhrasesDetectionJobResponse extends $MetadataBearer { + __type?: "StopKeyPhrasesDetectionJobResponse"; + /** + * + *

The identifier of the key phrases detection job to stop.

+ * + */ + JobId?: string; + + /** + * + *

Either STOP_REQUESTED if the job is currently running, or + * STOPPED if the job was previously stopped with the + * StopKeyPhrasesDetectionJob operation.

+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StopKeyPhrasesDetectionJobResponse { + export function isa(o: any): o is StopKeyPhrasesDetectionJobResponse { + return _smithy.isa(o, "StopKeyPhrasesDetectionJobResponse"); + } +} + +export interface StopSentimentDetectionJobRequest { + __type?: "StopSentimentDetectionJobRequest"; + /** + * + *

The identifier of the sentiment detection job to stop.

+ * + */ + JobId: string | undefined; +} + +export namespace StopSentimentDetectionJobRequest { + export function isa(o: any): o is StopSentimentDetectionJobRequest { + return _smithy.isa(o, "StopSentimentDetectionJobRequest"); + } +} + +export interface StopSentimentDetectionJobResponse extends $MetadataBearer { + __type?: "StopSentimentDetectionJobResponse"; + /** + * + *

The identifier of the sentiment detection job to stop.

+ * + */ + JobId?: string; + + /** + * + *

Either STOP_REQUESTED if the job is currently running, or + * STOPPED if the job was previously stopped with the + * StopSentimentDetectionJob operation.

+ * + */ + JobStatus?: JobStatus | string; +} + +export namespace StopSentimentDetectionJobResponse { + export function isa(o: any): o is StopSentimentDetectionJobResponse { + return _smithy.isa(o, "StopSentimentDetectionJobResponse"); + } +} + +export interface StopTrainingDocumentClassifierRequest { + __type?: "StopTrainingDocumentClassifierRequest"; + /** + * + *

The Amazon Resource Name (ARN) that identifies the document classifier currently being trained.

+ * + */ + DocumentClassifierArn: string | undefined; +} + +export namespace StopTrainingDocumentClassifierRequest { + export function isa(o: any): o is StopTrainingDocumentClassifierRequest { + return _smithy.isa(o, "StopTrainingDocumentClassifierRequest"); + } +} + +export interface StopTrainingDocumentClassifierResponse + extends $MetadataBearer { + __type?: "StopTrainingDocumentClassifierResponse"; +} + +export namespace StopTrainingDocumentClassifierResponse { + export function isa(o: any): o is StopTrainingDocumentClassifierResponse { + return _smithy.isa(o, "StopTrainingDocumentClassifierResponse"); + } +} + +export interface StopTrainingEntityRecognizerRequest { + __type?: "StopTrainingEntityRecognizerRequest"; + /** + * + *

The Amazon Resource Name (ARN) that identifies the entity recognizer currently being trained.

+ * + */ + EntityRecognizerArn: string | undefined; +} + +export namespace StopTrainingEntityRecognizerRequest { + export function isa(o: any): o is StopTrainingEntityRecognizerRequest { + return _smithy.isa(o, "StopTrainingEntityRecognizerRequest"); + } +} + +export interface StopTrainingEntityRecognizerResponse extends $MetadataBearer { + __type?: "StopTrainingEntityRecognizerResponse"; +} + +export namespace StopTrainingEntityRecognizerResponse { + export function isa(o: any): o is StopTrainingEntityRecognizerResponse { + return _smithy.isa(o, "StopTrainingEntityRecognizerResponse"); + } +} + +export enum SyntaxLanguageCode { + DE = "de", + EN = "en", + ES = "es", + FR = "fr", + IT = "it", + PT = "pt" +} + +/** + * + *

Represents a work in the input text that was recognized and assigned a part of speech. + * There is one syntax token record for each word in the source text.

+ * + */ +export interface SyntaxToken { + __type?: "SyntaxToken"; + /** + * + *

The zero-based offset from the beginning of the source text to the first character in the + * word.

+ * + */ + BeginOffset?: number; + + /** + * + *

The zero-based offset from the beginning of the source text to the last character in the + * word.

+ * + */ + EndOffset?: number; + + /** + * + *

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.

+ * + */ + PartOfSpeech?: PartOfSpeechTag; + + /** + * + *

The word that was recognized in the source text.

+ * + */ + Text?: string; + + /** + * + *

A unique identifier for a token.

+ * + */ + TokenId?: number; +} + +export namespace SyntaxToken { + export function isa(o: any): o is SyntaxToken { + return _smithy.isa(o, "SyntaxToken"); + } +} + +/** + * + *

A key-value pair that adds as a metadata to a resource used by Amazon Comprehend. For example, a tag with the key-value pair ‘Department’:’Sales’ might be added to a resource to indicate its use by a particular department.

+ * + */ +export interface Tag { + __type?: "Tag"; + /** + * + *

The initial part of a key-value pair that forms a tag associated with a given resource. For instance, if you want to show which resources are used by which departments, you might use “Department” as the key portion of the pair, with multiple possible values such as “sales,” “legal,” and “administration.”

+ * + */ + Key: string | undefined; + + /** + * + *

The second part of a key-value pair that forms a tag associated with a given resource. For instance, if you want to show which resources are used by which departments, you might use “Department” as the initial (key) portion of the pair, with a value of “sales” to indicate the sales department.

+ * + */ + Value?: string; +} + +export namespace Tag { + export function isa(o: any): o is Tag { + return _smithy.isa(o, "Tag"); + } +} + +export interface TagResourceRequest { + __type?: "TagResourceRequest"; + /** + * + *

The Amazon Resource Name (ARN) of the given Amazon Comprehend resource to which you want to associate the tags.

+ * + */ + ResourceArn: string | undefined; + + /** + * + *

Tags being associated with a specific Amazon Comprehend resource. There can be a maximum of 50 tags (both existing and pending) associated with a specific resource.

+ * + */ + Tags: Array | undefined; +} + +export namespace TagResourceRequest { + export function isa(o: any): o is TagResourceRequest { + return _smithy.isa(o, "TagResourceRequest"); + } +} + +export interface TagResourceResponse extends $MetadataBearer { + __type?: "TagResourceResponse"; +} + +export namespace TagResourceResponse { + export function isa(o: any): o is TagResourceResponse { + return _smithy.isa(o, "TagResourceResponse"); + } +} + +/** + * + *

The size of the input text exceeds the limit. Use a smaller document.

+ * + */ +export interface TextSizeLimitExceededException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "TextSizeLimitExceededException"; + $fault: "client"; + Message?: string; +} + +export namespace TextSizeLimitExceededException { + export function isa(o: any): o is TextSizeLimitExceededException { + return _smithy.isa(o, "TextSizeLimitExceededException"); + } +} + +/** + * + *

The number of requests exceeds the limit. Resubmit your request later.

+ * + */ +export interface TooManyRequestsException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "TooManyRequestsException"; + $fault: "client"; + Message?: string; +} + +export namespace TooManyRequestsException { + export function isa(o: any): o is TooManyRequestsException { + return _smithy.isa(o, "TooManyRequestsException"); + } +} + +/** + * + *

The request contains more tag keys than can be associated with a resource (50 tag keys per resource).

+ * + */ +export interface TooManyTagKeysException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "TooManyTagKeysException"; + $fault: "client"; + Message?: string; +} + +export namespace TooManyTagKeysException { + export function isa(o: any): o is TooManyTagKeysException { + return _smithy.isa(o, "TooManyTagKeysException"); + } +} + +/** + * + *

The request contains more tags than can be associated with a resource (50 tags per resource). The maximum + * number of tags includes both existing tags and those included in your current request.

+ * + */ +export interface TooManyTagsException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "TooManyTagsException"; + $fault: "client"; + Message?: string; +} + +export namespace TooManyTagsException { + export function isa(o: any): o is TooManyTagsException { + return _smithy.isa(o, "TooManyTagsException"); + } +} + +/** + * + *

Provides information for filtering topic detection jobs. For more information, see + * .

+ * + */ +export interface TopicsDetectionJobFilter { + __type?: "TopicsDetectionJobFilter"; + /** + * + *

+ * + */ + JobName?: string; + + /** + * + *

Filters the list of topic detection jobs based on job status. Returns only jobs with + * the specified status.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Only returns jobs submitted after the specified time. Jobs are returned in ascending order, + * oldest to newest.

+ * + */ + SubmitTimeAfter?: Date; + + /** + * + *

Filters the list of jobs based on the time that the job was submitted for processing. + * Only returns jobs submitted before the specified time. Jobs are returned in descending order, + * newest to oldest.

+ * + */ + SubmitTimeBefore?: Date; +} + +export namespace TopicsDetectionJobFilter { + export function isa(o: any): o is TopicsDetectionJobFilter { + return _smithy.isa(o, "TopicsDetectionJobFilter"); + } +} + +/** + * + *

Provides information about a topic detection job.

+ * + */ +export interface TopicsDetectionJobProperties { + __type?: "TopicsDetectionJobProperties"; + /** + * + *

The Amazon Resource Name (ARN) of the AWS Identity and Management (IAM) role that grants Amazon Comprehend read access to your job data.

+ * + */ + DataAccessRoleArn?: string; + + /** + * + *

The time that the topic detection job was completed.

+ * + */ + EndTime?: Date; + + /** + * + *

The input data configuration supplied when you created the topic detection + * job.

+ * + */ + InputDataConfig?: InputDataConfig; + + /** + * + *

The identifier assigned to the topic detection job.

+ * + */ + JobId?: string; + + /** + * + *

The name of the topic detection job.

+ * + */ + JobName?: string; + + /** + * + *

The current status of the topic detection job. If the status is Failed, + * the reason for the failure is shown in the Message field.

+ * + */ + JobStatus?: JobStatus | string; + + /** + * + *

A description for the status of a job.

+ * + */ + Message?: string; + + /** + * + *

The number of topics to detect supplied when you created the topic detection job. The + * default is 10.

+ * + */ + NumberOfTopics?: number; + + /** + * + *

The output data configuration supplied when you created the topic detection + * job.

+ * + */ + OutputDataConfig?: OutputDataConfig; + + /** + * + *

The time that the topic detection job was submitted for processing.

+ * + */ + SubmitTime?: Date; + + /** + * + *

ID for the AWS Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that + * process the analysis job. The VolumeKmsKeyId can be either of the following formats:

+ *
    + *
  • + *

    KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
  • + *

    Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + *

    + *
  • + *
+ * + */ + VolumeKmsKeyId?: string; + + /** + * + *

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your topic detection job. + * For more information, see Amazon VPC.

+ * + */ + VpcConfig?: VpcConfig; +} + +export namespace TopicsDetectionJobProperties { + export function isa(o: any): o is TopicsDetectionJobProperties { + return _smithy.isa(o, "TopicsDetectionJobProperties"); + } +} + +/** + * + *

Amazon Comprehend can't process the language of the input text. For all custom entity recognition + * APIs (such as CreateEntityRecognizer), only English is accepted. For most other APIs, such as those for Custom Classification, Amazon Comprehend accepts text in + * all supported languages. For a list of supported languages, see supported-languages.

+ * + */ +export interface UnsupportedLanguageException + extends _smithy.SmithyException, + $MetadataBearer { + __type: "UnsupportedLanguageException"; + $fault: "client"; + Message?: string; +} + +export namespace UnsupportedLanguageException { + export function isa(o: any): o is UnsupportedLanguageException { + return _smithy.isa(o, "UnsupportedLanguageException"); + } +} + +export interface UntagResourceRequest { + __type?: "UntagResourceRequest"; + /** + * + *

The Amazon Resource Name (ARN) of the given Amazon Comprehend resource from which you want to remove the tags.

+ * + */ + ResourceArn: string | undefined; + + /** + * + *

The initial part of a key-value pair that forms a tag being removed from a given resource. + * For example, + * a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department. Keys must be unique and cannot be duplicated for a particular resource.

+ * + */ + TagKeys: Array | undefined; +} + +export namespace UntagResourceRequest { + export function isa(o: any): o is UntagResourceRequest { + return _smithy.isa(o, "UntagResourceRequest"); + } +} + +export interface UntagResourceResponse extends $MetadataBearer { + __type?: "UntagResourceResponse"; +} + +export namespace UntagResourceResponse { + export function isa(o: any): o is UntagResourceResponse { + return _smithy.isa(o, "UntagResourceResponse"); + } +} + +export interface UpdateEndpointRequest { + __type?: "UpdateEndpointRequest"; + /** + * + *

The desired number of inference units to be used by the model using this endpoint. Each + * inference unit represents of a throughput of 100 characters per second.

+ * + */ + DesiredInferenceUnits: number | undefined; + + /** + * + *

The Amazon Resource Number (ARN) of the endpoint being updated.

+ * + */ + EndpointArn: string | undefined; +} + +export namespace UpdateEndpointRequest { + export function isa(o: any): o is UpdateEndpointRequest { + return _smithy.isa(o, "UpdateEndpointRequest"); + } +} + +export interface UpdateEndpointResponse extends $MetadataBearer { + __type?: "UpdateEndpointResponse"; +} + +export namespace UpdateEndpointResponse { + export function isa(o: any): o is UpdateEndpointResponse { + return _smithy.isa(o, "UpdateEndpointResponse"); + } +} + +/** + * + *

Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job. For + * For more information, see Amazon VPC.

+ * + */ +export interface VpcConfig { + __type?: "VpcConfig"; + /** + * + *

The ID number for a security group on an instance of your private VPC. Security groups on your VPC function serve as a virtual firewall to control inbound and outbound traffic and + * provides security for the resources that you’ll be accessing on the VPC. This ID number is preceded by "sg-", for instance: "sg-03b388029b0a285ea". + * For more information, see Security Groups for your VPC.

+ * + */ + SecurityGroupIds: Array | undefined; + + /** + * + *

The ID for each subnet being used in your private VPC. This subnet is a subset of the a range of IPv4 addresses used by the + * VPC and is specific to a given availability zone in the VPC’s region. This ID number is preceded by "subnet-", for instance: "subnet-04ccf456919e69055". + * For more information, see VPCs and Subnets.

+ * + */ + Subnets: Array | undefined; +} + +export namespace VpcConfig { + export function isa(o: any): o is VpcConfig { + return _smithy.isa(o, "VpcConfig"); + } +} diff --git a/clients/client-comprehend/package.json b/clients/client-comprehend/package.json new file mode 100644 index 000000000000..fb4349bdcb4b --- /dev/null +++ b/clients/client-comprehend/package.json @@ -0,0 +1,75 @@ +{ + "name": "@aws-sdk/client-comprehend", + "description": "@aws-sdk/client-comprehend client", + "version": "1.0.0", + "scripts": { + "clean": "npm run remove-definitions && npm run remove-dist && npm run remove-js && npm run remove-maps", + "build-documentation": "npm run clean && typedoc ./", + "prepublishOnly": "yarn build", + "pretest": "tsc", + "remove-definitions": "rimraf ./types", + "remove-dist": "rimraf ./dist", + "remove-documentation": "rimraf ./docs", + "remove-js": "rimraf *.js && rimraf ./commands/*.js && rimraf ./models/*.js && rimraf ./protocols/*.js", + "remove-maps": "rimraf *.js.map && rimraf ./commands/*.js.map && rimraf ./models/*.js.map && rimraf ./protocols/*.js.map", + "test": "exit 0", + "smoke-test": "npm run pretest && node ./test/smoke/index.spec.js", + "build:es": "tsc -p tsconfig.es.json", + "build": "yarn pretest && yarn build:es" + }, + "main": "./dist/cjs/index.js", + "types": "./types/index.d.ts", + "module": "./dist/es/index.js", + "browser": { + "./runtimeConfig": "./runtimeConfig.browser" + }, + "sideEffects": false, + "dependencies": { + "tslib": "^1.8.0", + "@aws-crypto/sha256-browser": "^0.1.0-preview.1", + "@aws-sdk/config-resolver": "^0.1.0-preview.5", + "@aws-sdk/credential-provider-node": "^0.1.0-preview.7", + "@aws-sdk/fetch-http-handler": "^0.1.0-preview.5", + "@aws-sdk/hash-node": "^0.1.0-preview.5", + "@aws-sdk/invalid-dependency": "^0.1.0-preview.1", + "@aws-sdk/middleware-content-length": "^0.1.0-preview.5", + "@aws-sdk/middleware-host-header": "^0.1.0-preview.1", + "@aws-sdk/middleware-retry": "^0.1.0-preview.5", + "@aws-sdk/middleware-serde": "^0.1.0-preview.1", + "@aws-sdk/middleware-signing": "^0.1.0-preview.7", + "@aws-sdk/middleware-stack": "^0.1.0-preview.6", + "@aws-sdk/middleware-user-agent": "^0.1.0-preview.1", + "@aws-sdk/node-http-handler": "^0.1.0-preview.6", + "@aws-sdk/protocol-http": "^0.1.0-preview.1", + "@aws-sdk/region-provider": "^0.1.0-preview.5", + "@aws-sdk/smithy-client": "^0.1.0-preview.1", + "@aws-sdk/stream-collector-browser": "^0.1.0-preview.5", + "@aws-sdk/stream-collector-node": "^0.1.0-preview.6", + "@aws-sdk/types": "^0.1.0-preview.5", + "@aws-sdk/url-parser-browser": "^0.1.0-preview.5", + "@aws-sdk/url-parser-node": "^0.1.0-preview.5", + "@aws-sdk/util-base64-browser": "^0.1.0-preview.3", + "@aws-sdk/util-base64-node": "^0.1.0-preview.3", + "@aws-sdk/util-body-length-browser": "^0.1.0-preview.3", + "@aws-sdk/util-body-length-node": "^0.1.0-preview.4", + "@aws-sdk/util-user-agent-browser": "^0.1.0-preview.6", + "@aws-sdk/util-user-agent-node": "^0.1.0-preview.6", + "@aws-sdk/util-utf8-browser": "^0.1.0-preview.3", + "@aws-sdk/util-utf8-node": "^0.1.0-preview.3" + }, + "devDependencies": { + "rimraf": "^3.0.0", + "typedoc": "^0.15.0", + "typescript": "^3.6.3", + "@types/node": "^12.7.5", + "tslib": "^1.8.0" + }, + "engines": { + "node": ">=8.0.0" + }, + "author": { + "name": "AWS SDK for JavaScript Team", + "url": "https://aws.amazon.com/javascript/" + }, + "license": "Apache-2.0" +} diff --git a/clients/client-comprehend/protocols/Aws_json1_1.ts b/clients/client-comprehend/protocols/Aws_json1_1.ts new file mode 100644 index 000000000000..2fc6ca842989 --- /dev/null +++ b/clients/client-comprehend/protocols/Aws_json1_1.ts @@ -0,0 +1,10090 @@ +import { + BatchDetectDominantLanguageCommandInput, + BatchDetectDominantLanguageCommandOutput +} from "../commands/BatchDetectDominantLanguageCommand"; +import { + BatchDetectEntitiesCommandInput, + BatchDetectEntitiesCommandOutput +} from "../commands/BatchDetectEntitiesCommand"; +import { + BatchDetectKeyPhrasesCommandInput, + BatchDetectKeyPhrasesCommandOutput +} from "../commands/BatchDetectKeyPhrasesCommand"; +import { + BatchDetectSentimentCommandInput, + BatchDetectSentimentCommandOutput +} from "../commands/BatchDetectSentimentCommand"; +import { + BatchDetectSyntaxCommandInput, + BatchDetectSyntaxCommandOutput +} from "../commands/BatchDetectSyntaxCommand"; +import { + ClassifyDocumentCommandInput, + ClassifyDocumentCommandOutput +} from "../commands/ClassifyDocumentCommand"; +import { + CreateDocumentClassifierCommandInput, + CreateDocumentClassifierCommandOutput +} from "../commands/CreateDocumentClassifierCommand"; +import { + CreateEndpointCommandInput, + CreateEndpointCommandOutput +} from "../commands/CreateEndpointCommand"; +import { + CreateEntityRecognizerCommandInput, + CreateEntityRecognizerCommandOutput +} from "../commands/CreateEntityRecognizerCommand"; +import { + DeleteDocumentClassifierCommandInput, + DeleteDocumentClassifierCommandOutput +} from "../commands/DeleteDocumentClassifierCommand"; +import { + DeleteEndpointCommandInput, + DeleteEndpointCommandOutput +} from "../commands/DeleteEndpointCommand"; +import { + DeleteEntityRecognizerCommandInput, + DeleteEntityRecognizerCommandOutput +} from "../commands/DeleteEntityRecognizerCommand"; +import { + DescribeDocumentClassificationJobCommandInput, + DescribeDocumentClassificationJobCommandOutput +} from "../commands/DescribeDocumentClassificationJobCommand"; +import { + DescribeDocumentClassifierCommandInput, + DescribeDocumentClassifierCommandOutput +} from "../commands/DescribeDocumentClassifierCommand"; +import { + DescribeDominantLanguageDetectionJobCommandInput, + DescribeDominantLanguageDetectionJobCommandOutput +} from "../commands/DescribeDominantLanguageDetectionJobCommand"; +import { + DescribeEndpointCommandInput, + DescribeEndpointCommandOutput +} from "../commands/DescribeEndpointCommand"; +import { + DescribeEntitiesDetectionJobCommandInput, + DescribeEntitiesDetectionJobCommandOutput +} from "../commands/DescribeEntitiesDetectionJobCommand"; +import { + DescribeEntityRecognizerCommandInput, + DescribeEntityRecognizerCommandOutput +} from "../commands/DescribeEntityRecognizerCommand"; +import { + DescribeKeyPhrasesDetectionJobCommandInput, + DescribeKeyPhrasesDetectionJobCommandOutput +} from "../commands/DescribeKeyPhrasesDetectionJobCommand"; +import { + DescribeSentimentDetectionJobCommandInput, + DescribeSentimentDetectionJobCommandOutput +} from "../commands/DescribeSentimentDetectionJobCommand"; +import { + DescribeTopicsDetectionJobCommandInput, + DescribeTopicsDetectionJobCommandOutput +} from "../commands/DescribeTopicsDetectionJobCommand"; +import { + DetectDominantLanguageCommandInput, + DetectDominantLanguageCommandOutput +} from "../commands/DetectDominantLanguageCommand"; +import { + DetectEntitiesCommandInput, + DetectEntitiesCommandOutput +} from "../commands/DetectEntitiesCommand"; +import { + DetectKeyPhrasesCommandInput, + DetectKeyPhrasesCommandOutput +} from "../commands/DetectKeyPhrasesCommand"; +import { + DetectSentimentCommandInput, + DetectSentimentCommandOutput +} from "../commands/DetectSentimentCommand"; +import { + DetectSyntaxCommandInput, + DetectSyntaxCommandOutput +} from "../commands/DetectSyntaxCommand"; +import { + ListDocumentClassificationJobsCommandInput, + ListDocumentClassificationJobsCommandOutput +} from "../commands/ListDocumentClassificationJobsCommand"; +import { + ListDocumentClassifiersCommandInput, + ListDocumentClassifiersCommandOutput +} from "../commands/ListDocumentClassifiersCommand"; +import { + ListDominantLanguageDetectionJobsCommandInput, + ListDominantLanguageDetectionJobsCommandOutput +} from "../commands/ListDominantLanguageDetectionJobsCommand"; +import { + ListEndpointsCommandInput, + ListEndpointsCommandOutput +} from "../commands/ListEndpointsCommand"; +import { + ListEntitiesDetectionJobsCommandInput, + ListEntitiesDetectionJobsCommandOutput +} from "../commands/ListEntitiesDetectionJobsCommand"; +import { + ListEntityRecognizersCommandInput, + ListEntityRecognizersCommandOutput +} from "../commands/ListEntityRecognizersCommand"; +import { + ListKeyPhrasesDetectionJobsCommandInput, + ListKeyPhrasesDetectionJobsCommandOutput +} from "../commands/ListKeyPhrasesDetectionJobsCommand"; +import { + ListSentimentDetectionJobsCommandInput, + ListSentimentDetectionJobsCommandOutput +} from "../commands/ListSentimentDetectionJobsCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput +} from "../commands/ListTagsForResourceCommand"; +import { + ListTopicsDetectionJobsCommandInput, + ListTopicsDetectionJobsCommandOutput +} from "../commands/ListTopicsDetectionJobsCommand"; +import { + StartDocumentClassificationJobCommandInput, + StartDocumentClassificationJobCommandOutput +} from "../commands/StartDocumentClassificationJobCommand"; +import { + StartDominantLanguageDetectionJobCommandInput, + StartDominantLanguageDetectionJobCommandOutput +} from "../commands/StartDominantLanguageDetectionJobCommand"; +import { + StartEntitiesDetectionJobCommandInput, + StartEntitiesDetectionJobCommandOutput +} from "../commands/StartEntitiesDetectionJobCommand"; +import { + StartKeyPhrasesDetectionJobCommandInput, + StartKeyPhrasesDetectionJobCommandOutput +} from "../commands/StartKeyPhrasesDetectionJobCommand"; +import { + StartSentimentDetectionJobCommandInput, + StartSentimentDetectionJobCommandOutput +} from "../commands/StartSentimentDetectionJobCommand"; +import { + StartTopicsDetectionJobCommandInput, + StartTopicsDetectionJobCommandOutput +} from "../commands/StartTopicsDetectionJobCommand"; +import { + StopDominantLanguageDetectionJobCommandInput, + StopDominantLanguageDetectionJobCommandOutput +} from "../commands/StopDominantLanguageDetectionJobCommand"; +import { + StopEntitiesDetectionJobCommandInput, + StopEntitiesDetectionJobCommandOutput +} from "../commands/StopEntitiesDetectionJobCommand"; +import { + StopKeyPhrasesDetectionJobCommandInput, + StopKeyPhrasesDetectionJobCommandOutput +} from "../commands/StopKeyPhrasesDetectionJobCommand"; +import { + StopSentimentDetectionJobCommandInput, + StopSentimentDetectionJobCommandOutput +} from "../commands/StopSentimentDetectionJobCommand"; +import { + StopTrainingDocumentClassifierCommandInput, + StopTrainingDocumentClassifierCommandOutput +} from "../commands/StopTrainingDocumentClassifierCommand"; +import { + StopTrainingEntityRecognizerCommandInput, + StopTrainingEntityRecognizerCommandOutput +} from "../commands/StopTrainingEntityRecognizerCommand"; +import { + TagResourceCommandInput, + TagResourceCommandOutput +} from "../commands/TagResourceCommand"; +import { + UntagResourceCommandInput, + UntagResourceCommandOutput +} from "../commands/UntagResourceCommand"; +import { + UpdateEndpointCommandInput, + UpdateEndpointCommandOutput +} from "../commands/UpdateEndpointCommand"; +import { + BatchDetectDominantLanguageItemResult, + BatchDetectDominantLanguageRequest, + BatchDetectDominantLanguageResponse, + BatchDetectEntitiesItemResult, + BatchDetectEntitiesRequest, + BatchDetectEntitiesResponse, + BatchDetectKeyPhrasesItemResult, + BatchDetectKeyPhrasesRequest, + BatchDetectKeyPhrasesResponse, + BatchDetectSentimentItemResult, + BatchDetectSentimentRequest, + BatchDetectSentimentResponse, + BatchDetectSyntaxItemResult, + BatchDetectSyntaxRequest, + BatchDetectSyntaxResponse, + BatchItemError, + BatchSizeLimitExceededException, + ClassifierEvaluationMetrics, + ClassifierMetadata, + ClassifyDocumentRequest, + ClassifyDocumentResponse, + ConcurrentModificationException, + CreateDocumentClassifierRequest, + CreateDocumentClassifierResponse, + CreateEndpointRequest, + CreateEndpointResponse, + CreateEntityRecognizerRequest, + CreateEntityRecognizerResponse, + DeleteDocumentClassifierRequest, + DeleteDocumentClassifierResponse, + DeleteEndpointRequest, + DeleteEndpointResponse, + DeleteEntityRecognizerRequest, + DeleteEntityRecognizerResponse, + DescribeDocumentClassificationJobRequest, + DescribeDocumentClassificationJobResponse, + DescribeDocumentClassifierRequest, + DescribeDocumentClassifierResponse, + DescribeDominantLanguageDetectionJobRequest, + DescribeDominantLanguageDetectionJobResponse, + DescribeEndpointRequest, + DescribeEndpointResponse, + DescribeEntitiesDetectionJobRequest, + DescribeEntitiesDetectionJobResponse, + DescribeEntityRecognizerRequest, + DescribeEntityRecognizerResponse, + DescribeKeyPhrasesDetectionJobRequest, + DescribeKeyPhrasesDetectionJobResponse, + DescribeSentimentDetectionJobRequest, + DescribeSentimentDetectionJobResponse, + DescribeTopicsDetectionJobRequest, + DescribeTopicsDetectionJobResponse, + DetectDominantLanguageRequest, + DetectDominantLanguageResponse, + DetectEntitiesRequest, + DetectEntitiesResponse, + DetectKeyPhrasesRequest, + DetectKeyPhrasesResponse, + DetectSentimentRequest, + DetectSentimentResponse, + DetectSyntaxRequest, + DetectSyntaxResponse, + DocumentClass, + DocumentClassificationJobFilter, + DocumentClassificationJobProperties, + DocumentClassifierFilter, + DocumentClassifierInputDataConfig, + DocumentClassifierOutputDataConfig, + DocumentClassifierProperties, + DominantLanguage, + DominantLanguageDetectionJobFilter, + DominantLanguageDetectionJobProperties, + EndpointFilter, + EndpointProperties, + EntitiesDetectionJobFilter, + EntitiesDetectionJobProperties, + Entity, + EntityRecognizerAnnotations, + EntityRecognizerDocuments, + EntityRecognizerEntityList, + EntityRecognizerEvaluationMetrics, + EntityRecognizerFilter, + EntityRecognizerInputDataConfig, + EntityRecognizerMetadata, + EntityRecognizerMetadataEntityTypesListItem, + EntityRecognizerProperties, + EntityTypesEvaluationMetrics, + EntityTypesListItem, + InputDataConfig, + InternalServerException, + InvalidFilterException, + InvalidRequestException, + JobNotFoundException, + KeyPhrase, + KeyPhrasesDetectionJobFilter, + KeyPhrasesDetectionJobProperties, + KmsKeyValidationException, + ListDocumentClassificationJobsRequest, + ListDocumentClassificationJobsResponse, + ListDocumentClassifiersRequest, + ListDocumentClassifiersResponse, + ListDominantLanguageDetectionJobsRequest, + ListDominantLanguageDetectionJobsResponse, + ListEndpointsRequest, + ListEndpointsResponse, + ListEntitiesDetectionJobsRequest, + ListEntitiesDetectionJobsResponse, + ListEntityRecognizersRequest, + ListEntityRecognizersResponse, + ListKeyPhrasesDetectionJobsRequest, + ListKeyPhrasesDetectionJobsResponse, + ListSentimentDetectionJobsRequest, + ListSentimentDetectionJobsResponse, + ListTagsForResourceRequest, + ListTagsForResourceResponse, + ListTopicsDetectionJobsRequest, + ListTopicsDetectionJobsResponse, + OutputDataConfig, + PartOfSpeechTag, + ResourceInUseException, + ResourceLimitExceededException, + ResourceNotFoundException, + ResourceUnavailableException, + SentimentDetectionJobFilter, + SentimentDetectionJobProperties, + SentimentScore, + StartDocumentClassificationJobRequest, + StartDocumentClassificationJobResponse, + StartDominantLanguageDetectionJobRequest, + StartDominantLanguageDetectionJobResponse, + StartEntitiesDetectionJobRequest, + StartEntitiesDetectionJobResponse, + StartKeyPhrasesDetectionJobRequest, + StartKeyPhrasesDetectionJobResponse, + StartSentimentDetectionJobRequest, + StartSentimentDetectionJobResponse, + StartTopicsDetectionJobRequest, + StartTopicsDetectionJobResponse, + StopDominantLanguageDetectionJobRequest, + StopDominantLanguageDetectionJobResponse, + StopEntitiesDetectionJobRequest, + StopEntitiesDetectionJobResponse, + StopKeyPhrasesDetectionJobRequest, + StopKeyPhrasesDetectionJobResponse, + StopSentimentDetectionJobRequest, + StopSentimentDetectionJobResponse, + StopTrainingDocumentClassifierRequest, + StopTrainingDocumentClassifierResponse, + StopTrainingEntityRecognizerRequest, + StopTrainingEntityRecognizerResponse, + SyntaxToken, + Tag, + TagResourceRequest, + TagResourceResponse, + TextSizeLimitExceededException, + TooManyRequestsException, + TooManyTagKeysException, + TooManyTagsException, + TopicsDetectionJobFilter, + TopicsDetectionJobProperties, + UnsupportedLanguageException, + UntagResourceRequest, + UntagResourceResponse, + UpdateEndpointRequest, + UpdateEndpointResponse, + VpcConfig +} from "../models/index"; +import { + HttpRequest as __HttpRequest, + HttpResponse as __HttpResponse +} from "@aws-sdk/protocol-http"; +import { SmithyException as __SmithyException } from "@aws-sdk/smithy-client"; +import { + Endpoint as __Endpoint, + MetadataBearer as __MetadataBearer, + ResponseMetadata as __ResponseMetadata, + SerdeContext as __SerdeContext +} from "@aws-sdk/types"; + +export async function serializeAws_json1_1BatchDetectDominantLanguageCommand( + input: BatchDetectDominantLanguageCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.BatchDetectDominantLanguage"; + let body: any = {}; + const wrappedBody: any = { + BatchDetectDominantLanguageRequest: serializeAws_json1_1BatchDetectDominantLanguageRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/BatchDetectDominantLanguage", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1BatchDetectEntitiesCommand( + input: BatchDetectEntitiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.BatchDetectEntities"; + let body: any = {}; + const wrappedBody: any = { + BatchDetectEntitiesRequest: serializeAws_json1_1BatchDetectEntitiesRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/BatchDetectEntities", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1BatchDetectKeyPhrasesCommand( + input: BatchDetectKeyPhrasesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.BatchDetectKeyPhrases"; + let body: any = {}; + const wrappedBody: any = { + BatchDetectKeyPhrasesRequest: serializeAws_json1_1BatchDetectKeyPhrasesRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/BatchDetectKeyPhrases", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1BatchDetectSentimentCommand( + input: BatchDetectSentimentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.BatchDetectSentiment"; + let body: any = {}; + const wrappedBody: any = { + BatchDetectSentimentRequest: serializeAws_json1_1BatchDetectSentimentRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/BatchDetectSentiment", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1BatchDetectSyntaxCommand( + input: BatchDetectSyntaxCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.BatchDetectSyntax"; + let body: any = {}; + const wrappedBody: any = { + BatchDetectSyntaxRequest: serializeAws_json1_1BatchDetectSyntaxRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/BatchDetectSyntax", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ClassifyDocumentCommand( + input: ClassifyDocumentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ClassifyDocument"; + let body: any = {}; + const wrappedBody: any = { + ClassifyDocumentRequest: serializeAws_json1_1ClassifyDocumentRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ClassifyDocument", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1CreateDocumentClassifierCommand( + input: CreateDocumentClassifierCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.CreateDocumentClassifier"; + let body: any = {}; + const wrappedBody: any = { + CreateDocumentClassifierRequest: serializeAws_json1_1CreateDocumentClassifierRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/CreateDocumentClassifier", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1CreateEndpointCommand( + input: CreateEndpointCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.CreateEndpoint"; + let body: any = {}; + const wrappedBody: any = { + CreateEndpointRequest: serializeAws_json1_1CreateEndpointRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/CreateEndpoint", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1CreateEntityRecognizerCommand( + input: CreateEntityRecognizerCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.CreateEntityRecognizer"; + let body: any = {}; + const wrappedBody: any = { + CreateEntityRecognizerRequest: serializeAws_json1_1CreateEntityRecognizerRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/CreateEntityRecognizer", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DeleteDocumentClassifierCommand( + input: DeleteDocumentClassifierCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DeleteDocumentClassifier"; + let body: any = {}; + const wrappedBody: any = { + DeleteDocumentClassifierRequest: serializeAws_json1_1DeleteDocumentClassifierRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DeleteDocumentClassifier", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DeleteEndpointCommand( + input: DeleteEndpointCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DeleteEndpoint"; + let body: any = {}; + const wrappedBody: any = { + DeleteEndpointRequest: serializeAws_json1_1DeleteEndpointRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DeleteEndpoint", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DeleteEntityRecognizerCommand( + input: DeleteEntityRecognizerCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DeleteEntityRecognizer"; + let body: any = {}; + const wrappedBody: any = { + DeleteEntityRecognizerRequest: serializeAws_json1_1DeleteEntityRecognizerRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DeleteEntityRecognizer", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeDocumentClassificationJobCommand( + input: DescribeDocumentClassificationJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.DescribeDocumentClassificationJob"; + let body: any = {}; + const wrappedBody: any = { + DescribeDocumentClassificationJobRequest: serializeAws_json1_1DescribeDocumentClassificationJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeDocumentClassificationJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeDocumentClassifierCommand( + input: DescribeDocumentClassifierCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DescribeDocumentClassifier"; + let body: any = {}; + const wrappedBody: any = { + DescribeDocumentClassifierRequest: serializeAws_json1_1DescribeDocumentClassifierRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeDocumentClassifier", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeDominantLanguageDetectionJobCommand( + input: DescribeDominantLanguageDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.DescribeDominantLanguageDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + DescribeDominantLanguageDetectionJobRequest: serializeAws_json1_1DescribeDominantLanguageDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeDominantLanguageDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeEndpointCommand( + input: DescribeEndpointCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DescribeEndpoint"; + let body: any = {}; + const wrappedBody: any = { + DescribeEndpointRequest: serializeAws_json1_1DescribeEndpointRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeEndpoint", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeEntitiesDetectionJobCommand( + input: DescribeEntitiesDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DescribeEntitiesDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + DescribeEntitiesDetectionJobRequest: serializeAws_json1_1DescribeEntitiesDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeEntitiesDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeEntityRecognizerCommand( + input: DescribeEntityRecognizerCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DescribeEntityRecognizer"; + let body: any = {}; + const wrappedBody: any = { + DescribeEntityRecognizerRequest: serializeAws_json1_1DescribeEntityRecognizerRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeEntityRecognizer", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand( + input: DescribeKeyPhrasesDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.DescribeKeyPhrasesDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + DescribeKeyPhrasesDetectionJobRequest: serializeAws_json1_1DescribeKeyPhrasesDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeKeyPhrasesDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeSentimentDetectionJobCommand( + input: DescribeSentimentDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DescribeSentimentDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + DescribeSentimentDetectionJobRequest: serializeAws_json1_1DescribeSentimentDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeSentimentDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DescribeTopicsDetectionJobCommand( + input: DescribeTopicsDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DescribeTopicsDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + DescribeTopicsDetectionJobRequest: serializeAws_json1_1DescribeTopicsDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DescribeTopicsDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DetectDominantLanguageCommand( + input: DetectDominantLanguageCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DetectDominantLanguage"; + let body: any = {}; + const wrappedBody: any = { + DetectDominantLanguageRequest: serializeAws_json1_1DetectDominantLanguageRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DetectDominantLanguage", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DetectEntitiesCommand( + input: DetectEntitiesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DetectEntities"; + let body: any = {}; + const wrappedBody: any = { + DetectEntitiesRequest: serializeAws_json1_1DetectEntitiesRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DetectEntities", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DetectKeyPhrasesCommand( + input: DetectKeyPhrasesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DetectKeyPhrases"; + let body: any = {}; + const wrappedBody: any = { + DetectKeyPhrasesRequest: serializeAws_json1_1DetectKeyPhrasesRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DetectKeyPhrases", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DetectSentimentCommand( + input: DetectSentimentCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DetectSentiment"; + let body: any = {}; + const wrappedBody: any = { + DetectSentimentRequest: serializeAws_json1_1DetectSentimentRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DetectSentiment", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1DetectSyntaxCommand( + input: DetectSyntaxCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.DetectSyntax"; + let body: any = {}; + const wrappedBody: any = { + DetectSyntaxRequest: serializeAws_json1_1DetectSyntaxRequest(input, context) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/DetectSyntax", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListDocumentClassificationJobsCommand( + input: ListDocumentClassificationJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.ListDocumentClassificationJobs"; + let body: any = {}; + const wrappedBody: any = { + ListDocumentClassificationJobsRequest: serializeAws_json1_1ListDocumentClassificationJobsRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListDocumentClassificationJobs", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListDocumentClassifiersCommand( + input: ListDocumentClassifiersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ListDocumentClassifiers"; + let body: any = {}; + const wrappedBody: any = { + ListDocumentClassifiersRequest: serializeAws_json1_1ListDocumentClassifiersRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListDocumentClassifiers", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListDominantLanguageDetectionJobsCommand( + input: ListDominantLanguageDetectionJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.ListDominantLanguageDetectionJobs"; + let body: any = {}; + const wrappedBody: any = { + ListDominantLanguageDetectionJobsRequest: serializeAws_json1_1ListDominantLanguageDetectionJobsRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListDominantLanguageDetectionJobs", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListEndpointsCommand( + input: ListEndpointsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ListEndpoints"; + let body: any = {}; + const wrappedBody: any = { + ListEndpointsRequest: serializeAws_json1_1ListEndpointsRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListEndpoints", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListEntitiesDetectionJobsCommand( + input: ListEntitiesDetectionJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ListEntitiesDetectionJobs"; + let body: any = {}; + const wrappedBody: any = { + ListEntitiesDetectionJobsRequest: serializeAws_json1_1ListEntitiesDetectionJobsRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListEntitiesDetectionJobs", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListEntityRecognizersCommand( + input: ListEntityRecognizersCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ListEntityRecognizers"; + let body: any = {}; + const wrappedBody: any = { + ListEntityRecognizersRequest: serializeAws_json1_1ListEntityRecognizersRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListEntityRecognizers", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListKeyPhrasesDetectionJobsCommand( + input: ListKeyPhrasesDetectionJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ListKeyPhrasesDetectionJobs"; + let body: any = {}; + const wrappedBody: any = { + ListKeyPhrasesDetectionJobsRequest: serializeAws_json1_1ListKeyPhrasesDetectionJobsRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListKeyPhrasesDetectionJobs", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListSentimentDetectionJobsCommand( + input: ListSentimentDetectionJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ListSentimentDetectionJobs"; + let body: any = {}; + const wrappedBody: any = { + ListSentimentDetectionJobsRequest: serializeAws_json1_1ListSentimentDetectionJobsRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListSentimentDetectionJobs", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListTagsForResourceCommand( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ListTagsForResource"; + let body: any = {}; + const wrappedBody: any = { + ListTagsForResourceRequest: serializeAws_json1_1ListTagsForResourceRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListTagsForResource", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1ListTopicsDetectionJobsCommand( + input: ListTopicsDetectionJobsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.ListTopicsDetectionJobs"; + let body: any = {}; + const wrappedBody: any = { + ListTopicsDetectionJobsRequest: serializeAws_json1_1ListTopicsDetectionJobsRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/ListTopicsDetectionJobs", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StartDocumentClassificationJobCommand( + input: StartDocumentClassificationJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.StartDocumentClassificationJob"; + let body: any = {}; + const wrappedBody: any = { + StartDocumentClassificationJobRequest: serializeAws_json1_1StartDocumentClassificationJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StartDocumentClassificationJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StartDominantLanguageDetectionJobCommand( + input: StartDominantLanguageDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.StartDominantLanguageDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StartDominantLanguageDetectionJobRequest: serializeAws_json1_1StartDominantLanguageDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StartDominantLanguageDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StartEntitiesDetectionJobCommand( + input: StartEntitiesDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.StartEntitiesDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StartEntitiesDetectionJobRequest: serializeAws_json1_1StartEntitiesDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StartEntitiesDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StartKeyPhrasesDetectionJobCommand( + input: StartKeyPhrasesDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.StartKeyPhrasesDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StartKeyPhrasesDetectionJobRequest: serializeAws_json1_1StartKeyPhrasesDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StartKeyPhrasesDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StartSentimentDetectionJobCommand( + input: StartSentimentDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.StartSentimentDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StartSentimentDetectionJobRequest: serializeAws_json1_1StartSentimentDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StartSentimentDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StartTopicsDetectionJobCommand( + input: StartTopicsDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.StartTopicsDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StartTopicsDetectionJobRequest: serializeAws_json1_1StartTopicsDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StartTopicsDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StopDominantLanguageDetectionJobCommand( + input: StopDominantLanguageDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.StopDominantLanguageDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StopDominantLanguageDetectionJobRequest: serializeAws_json1_1StopDominantLanguageDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StopDominantLanguageDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StopEntitiesDetectionJobCommand( + input: StopEntitiesDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.StopEntitiesDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StopEntitiesDetectionJobRequest: serializeAws_json1_1StopEntitiesDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StopEntitiesDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StopKeyPhrasesDetectionJobCommand( + input: StopKeyPhrasesDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.StopKeyPhrasesDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StopKeyPhrasesDetectionJobRequest: serializeAws_json1_1StopKeyPhrasesDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StopKeyPhrasesDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StopSentimentDetectionJobCommand( + input: StopSentimentDetectionJobCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.StopSentimentDetectionJob"; + let body: any = {}; + const wrappedBody: any = { + StopSentimentDetectionJobRequest: serializeAws_json1_1StopSentimentDetectionJobRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StopSentimentDetectionJob", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StopTrainingDocumentClassifierCommand( + input: StopTrainingDocumentClassifierCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = + "Comprehend_20171127.StopTrainingDocumentClassifier"; + let body: any = {}; + const wrappedBody: any = { + StopTrainingDocumentClassifierRequest: serializeAws_json1_1StopTrainingDocumentClassifierRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StopTrainingDocumentClassifier", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1StopTrainingEntityRecognizerCommand( + input: StopTrainingEntityRecognizerCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.StopTrainingEntityRecognizer"; + let body: any = {}; + const wrappedBody: any = { + StopTrainingEntityRecognizerRequest: serializeAws_json1_1StopTrainingEntityRecognizerRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/StopTrainingEntityRecognizer", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1TagResourceCommand( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.TagResource"; + let body: any = {}; + const wrappedBody: any = { + TagResourceRequest: serializeAws_json1_1TagResourceRequest(input, context) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/TagResource", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1UntagResourceCommand( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.UntagResource"; + let body: any = {}; + const wrappedBody: any = { + UntagResourceRequest: serializeAws_json1_1UntagResourceRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/UntagResource", + headers: headers, + body: body + }); +} + +export async function serializeAws_json1_1UpdateEndpointCommand( + input: UpdateEndpointCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> { + const headers: any = {}; + headers["Content-Type"] = "application/x-amz-json-1.1"; + headers["X-Amz-Target"] = "Comprehend_20171127.UpdateEndpoint"; + let body: any = {}; + const wrappedBody: any = { + UpdateEndpointRequest: serializeAws_json1_1UpdateEndpointRequest( + input, + context + ) + }; + body = JSON.stringify(wrappedBody); + return new __HttpRequest({ + ...context.endpoint, + protocol: "https", + method: "POST", + path: "/UpdateEndpoint", + headers: headers, + body: body + }); +} + +export async function deserializeAws_json1_1BatchDetectDominantLanguageCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1BatchDetectDominantLanguageCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1BatchDetectDominantLanguageResponse( + data.BatchDetectDominantLanguageResponse, + context + ); + const response: BatchDetectDominantLanguageCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "BatchDetectDominantLanguageResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1BatchDetectDominantLanguageCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "BatchSizeLimitExceededException": + case "com.amazonaws.comprehend#BatchSizeLimitExceededException": + response = await deserializeAws_json1_1BatchSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1BatchDetectEntitiesCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1BatchDetectEntitiesCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1BatchDetectEntitiesResponse( + data.BatchDetectEntitiesResponse, + context + ); + const response: BatchDetectEntitiesCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "BatchDetectEntitiesResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1BatchDetectEntitiesCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "BatchSizeLimitExceededException": + case "com.amazonaws.comprehend#BatchSizeLimitExceededException": + response = await deserializeAws_json1_1BatchSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1BatchDetectKeyPhrasesCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1BatchDetectKeyPhrasesCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1BatchDetectKeyPhrasesResponse( + data.BatchDetectKeyPhrasesResponse, + context + ); + const response: BatchDetectKeyPhrasesCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "BatchDetectKeyPhrasesResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1BatchDetectKeyPhrasesCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "BatchSizeLimitExceededException": + case "com.amazonaws.comprehend#BatchSizeLimitExceededException": + response = await deserializeAws_json1_1BatchSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1BatchDetectSentimentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1BatchDetectSentimentCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1BatchDetectSentimentResponse( + data.BatchDetectSentimentResponse, + context + ); + const response: BatchDetectSentimentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "BatchDetectSentimentResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1BatchDetectSentimentCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "BatchSizeLimitExceededException": + case "com.amazonaws.comprehend#BatchSizeLimitExceededException": + response = await deserializeAws_json1_1BatchSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1BatchDetectSyntaxCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1BatchDetectSyntaxCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1BatchDetectSyntaxResponse( + data.BatchDetectSyntaxResponse, + context + ); + const response: BatchDetectSyntaxCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "BatchDetectSyntaxResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1BatchDetectSyntaxCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "BatchSizeLimitExceededException": + case "com.amazonaws.comprehend#BatchSizeLimitExceededException": + response = await deserializeAws_json1_1BatchSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ClassifyDocumentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ClassifyDocumentCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ClassifyDocumentResponse( + data.ClassifyDocumentResponse, + context + ); + const response: ClassifyDocumentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ClassifyDocumentResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ClassifyDocumentCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceUnavailableException": + case "com.amazonaws.comprehend#ResourceUnavailableException": + response = await deserializeAws_json1_1ResourceUnavailableExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1CreateDocumentClassifierCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1CreateDocumentClassifierCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1CreateDocumentClassifierResponse( + data.CreateDocumentClassifierResponse, + context + ); + const response: CreateDocumentClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "CreateDocumentClassifierResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1CreateDocumentClassifierCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + response = await deserializeAws_json1_1KmsKeyValidationExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceInUseException": + case "com.amazonaws.comprehend#ResourceInUseException": + response = await deserializeAws_json1_1ResourceInUseExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceLimitExceededException": + case "com.amazonaws.comprehend#ResourceLimitExceededException": + response = await deserializeAws_json1_1ResourceLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyTagsException": + case "com.amazonaws.comprehend#TooManyTagsException": + response = await deserializeAws_json1_1TooManyTagsExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1CreateEndpointCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1CreateEndpointCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1CreateEndpointResponse( + data.CreateEndpointResponse, + context + ); + const response: CreateEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "CreateEndpointResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1CreateEndpointCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceInUseException": + case "com.amazonaws.comprehend#ResourceInUseException": + response = await deserializeAws_json1_1ResourceInUseExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceLimitExceededException": + case "com.amazonaws.comprehend#ResourceLimitExceededException": + response = await deserializeAws_json1_1ResourceLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceUnavailableException": + case "com.amazonaws.comprehend#ResourceUnavailableException": + response = await deserializeAws_json1_1ResourceUnavailableExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyTagsException": + case "com.amazonaws.comprehend#TooManyTagsException": + response = await deserializeAws_json1_1TooManyTagsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1CreateEntityRecognizerCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1CreateEntityRecognizerCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1CreateEntityRecognizerResponse( + data.CreateEntityRecognizerResponse, + context + ); + const response: CreateEntityRecognizerCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "CreateEntityRecognizerResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1CreateEntityRecognizerCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + response = await deserializeAws_json1_1KmsKeyValidationExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceInUseException": + case "com.amazonaws.comprehend#ResourceInUseException": + response = await deserializeAws_json1_1ResourceInUseExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceLimitExceededException": + case "com.amazonaws.comprehend#ResourceLimitExceededException": + response = await deserializeAws_json1_1ResourceLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyTagsException": + case "com.amazonaws.comprehend#TooManyTagsException": + response = await deserializeAws_json1_1TooManyTagsExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DeleteDocumentClassifierCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DeleteDocumentClassifierCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DeleteDocumentClassifierResponse( + data.DeleteDocumentClassifierResponse, + context + ); + const response: DeleteDocumentClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DeleteDocumentClassifierResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DeleteDocumentClassifierCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceInUseException": + case "com.amazonaws.comprehend#ResourceInUseException": + response = await deserializeAws_json1_1ResourceInUseExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceUnavailableException": + case "com.amazonaws.comprehend#ResourceUnavailableException": + response = await deserializeAws_json1_1ResourceUnavailableExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DeleteEndpointCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DeleteEndpointCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DeleteEndpointResponse( + data.DeleteEndpointResponse, + context + ); + const response: DeleteEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DeleteEndpointResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DeleteEndpointCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceInUseException": + case "com.amazonaws.comprehend#ResourceInUseException": + response = await deserializeAws_json1_1ResourceInUseExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DeleteEntityRecognizerCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DeleteEntityRecognizerCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DeleteEntityRecognizerResponse( + data.DeleteEntityRecognizerResponse, + context + ); + const response: DeleteEntityRecognizerCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DeleteEntityRecognizerResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DeleteEntityRecognizerCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceInUseException": + case "com.amazonaws.comprehend#ResourceInUseException": + response = await deserializeAws_json1_1ResourceInUseExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceUnavailableException": + case "com.amazonaws.comprehend#ResourceUnavailableException": + response = await deserializeAws_json1_1ResourceUnavailableExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeDocumentClassificationJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeDocumentClassificationJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeDocumentClassificationJobResponse( + data.DescribeDocumentClassificationJobResponse, + context + ); + const response: DescribeDocumentClassificationJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeDocumentClassificationJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeDocumentClassificationJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeDocumentClassifierCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeDocumentClassifierCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeDocumentClassifierResponse( + data.DescribeDocumentClassifierResponse, + context + ); + const response: DescribeDocumentClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeDocumentClassifierResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeDocumentClassifierCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeDominantLanguageDetectionJobResponse( + data.DescribeDominantLanguageDetectionJobResponse, + context + ); + const response: DescribeDominantLanguageDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeDominantLanguageDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeDominantLanguageDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeEndpointCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeEndpointCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeEndpointResponse( + data.DescribeEndpointResponse, + context + ); + const response: DescribeEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeEndpointResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeEndpointCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeEntitiesDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeEntitiesDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeEntitiesDetectionJobResponse( + data.DescribeEntitiesDetectionJobResponse, + context + ); + const response: DescribeEntitiesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeEntitiesDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeEntitiesDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeEntityRecognizerCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeEntityRecognizerCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeEntityRecognizerResponse( + data.DescribeEntityRecognizerResponse, + context + ); + const response: DescribeEntityRecognizerCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeEntityRecognizerResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeEntityRecognizerCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeKeyPhrasesDetectionJobResponse( + data.DescribeKeyPhrasesDetectionJobResponse, + context + ); + const response: DescribeKeyPhrasesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeKeyPhrasesDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeKeyPhrasesDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeSentimentDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeSentimentDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeSentimentDetectionJobResponse( + data.DescribeSentimentDetectionJobResponse, + context + ); + const response: DescribeSentimentDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeSentimentDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeSentimentDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DescribeTopicsDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DescribeTopicsDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DescribeTopicsDetectionJobResponse( + data.DescribeTopicsDetectionJobResponse, + context + ); + const response: DescribeTopicsDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DescribeTopicsDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DescribeTopicsDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DetectDominantLanguageCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DetectDominantLanguageCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DetectDominantLanguageResponse( + data.DetectDominantLanguageResponse, + context + ); + const response: DetectDominantLanguageCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DetectDominantLanguageResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DetectDominantLanguageCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DetectEntitiesCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DetectEntitiesCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DetectEntitiesResponse( + data.DetectEntitiesResponse, + context + ); + const response: DetectEntitiesCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DetectEntitiesResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DetectEntitiesCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DetectKeyPhrasesCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DetectKeyPhrasesCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DetectKeyPhrasesResponse( + data.DetectKeyPhrasesResponse, + context + ); + const response: DetectKeyPhrasesCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DetectKeyPhrasesResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DetectKeyPhrasesCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DetectSentimentCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DetectSentimentCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DetectSentimentResponse( + data.DetectSentimentResponse, + context + ); + const response: DetectSentimentCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DetectSentimentResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DetectSentimentCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1DetectSyntaxCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1DetectSyntaxCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DetectSyntaxResponse( + data.DetectSyntaxResponse, + context + ); + const response: DetectSyntaxCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "DetectSyntaxResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1DetectSyntaxCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TextSizeLimitExceededException": + case "com.amazonaws.comprehend#TextSizeLimitExceededException": + response = await deserializeAws_json1_1TextSizeLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "UnsupportedLanguageException": + case "com.amazonaws.comprehend#UnsupportedLanguageException": + response = await deserializeAws_json1_1UnsupportedLanguageExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListDocumentClassificationJobsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListDocumentClassificationJobsCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListDocumentClassificationJobsResponse( + data.ListDocumentClassificationJobsResponse, + context + ); + const response: ListDocumentClassificationJobsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListDocumentClassificationJobsResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListDocumentClassificationJobsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + response = await deserializeAws_json1_1InvalidFilterExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListDocumentClassifiersCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListDocumentClassifiersCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListDocumentClassifiersResponse( + data.ListDocumentClassifiersResponse, + context + ); + const response: ListDocumentClassifiersCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListDocumentClassifiersResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListDocumentClassifiersCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + response = await deserializeAws_json1_1InvalidFilterExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListDominantLanguageDetectionJobsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListDominantLanguageDetectionJobsCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListDominantLanguageDetectionJobsResponse( + data.ListDominantLanguageDetectionJobsResponse, + context + ); + const response: ListDominantLanguageDetectionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListDominantLanguageDetectionJobsResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListDominantLanguageDetectionJobsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + response = await deserializeAws_json1_1InvalidFilterExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListEndpointsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListEndpointsCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListEndpointsResponse( + data.ListEndpointsResponse, + context + ); + const response: ListEndpointsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListEndpointsResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListEndpointsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListEntitiesDetectionJobsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListEntitiesDetectionJobsCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListEntitiesDetectionJobsResponse( + data.ListEntitiesDetectionJobsResponse, + context + ); + const response: ListEntitiesDetectionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListEntitiesDetectionJobsResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListEntitiesDetectionJobsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + response = await deserializeAws_json1_1InvalidFilterExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListEntityRecognizersCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListEntityRecognizersCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListEntityRecognizersResponse( + data.ListEntityRecognizersResponse, + context + ); + const response: ListEntityRecognizersCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListEntityRecognizersResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListEntityRecognizersCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + response = await deserializeAws_json1_1InvalidFilterExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListKeyPhrasesDetectionJobsResponse( + data.ListKeyPhrasesDetectionJobsResponse, + context + ); + const response: ListKeyPhrasesDetectionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListKeyPhrasesDetectionJobsResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListKeyPhrasesDetectionJobsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + response = await deserializeAws_json1_1InvalidFilterExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListSentimentDetectionJobsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListSentimentDetectionJobsCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListSentimentDetectionJobsResponse( + data.ListSentimentDetectionJobsResponse, + context + ); + const response: ListSentimentDetectionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListSentimentDetectionJobsResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListSentimentDetectionJobsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + response = await deserializeAws_json1_1InvalidFilterExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListTagsForResourceCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListTagsForResourceCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListTagsForResourceResponse( + data.ListTagsForResourceResponse, + context + ); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListTagsForResourceResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListTagsForResourceCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1ListTopicsDetectionJobsCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1ListTopicsDetectionJobsCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListTopicsDetectionJobsResponse( + data.ListTopicsDetectionJobsResponse, + context + ); + const response: ListTopicsDetectionJobsCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "ListTopicsDetectionJobsResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1ListTopicsDetectionJobsCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidFilterException": + case "com.amazonaws.comprehend#InvalidFilterException": + response = await deserializeAws_json1_1InvalidFilterExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StartDocumentClassificationJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StartDocumentClassificationJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StartDocumentClassificationJobResponse( + data.StartDocumentClassificationJobResponse, + context + ); + const response: StartDocumentClassificationJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StartDocumentClassificationJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StartDocumentClassificationJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + response = await deserializeAws_json1_1KmsKeyValidationExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceUnavailableException": + case "com.amazonaws.comprehend#ResourceUnavailableException": + response = await deserializeAws_json1_1ResourceUnavailableExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StartDominantLanguageDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StartDominantLanguageDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StartDominantLanguageDetectionJobResponse( + data.StartDominantLanguageDetectionJobResponse, + context + ); + const response: StartDominantLanguageDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StartDominantLanguageDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StartDominantLanguageDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + response = await deserializeAws_json1_1KmsKeyValidationExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StartEntitiesDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StartEntitiesDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StartEntitiesDetectionJobResponse( + data.StartEntitiesDetectionJobResponse, + context + ); + const response: StartEntitiesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StartEntitiesDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StartEntitiesDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + response = await deserializeAws_json1_1KmsKeyValidationExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceUnavailableException": + case "com.amazonaws.comprehend#ResourceUnavailableException": + response = await deserializeAws_json1_1ResourceUnavailableExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StartKeyPhrasesDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StartKeyPhrasesDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StartKeyPhrasesDetectionJobResponse( + data.StartKeyPhrasesDetectionJobResponse, + context + ); + const response: StartKeyPhrasesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StartKeyPhrasesDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StartKeyPhrasesDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + response = await deserializeAws_json1_1KmsKeyValidationExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StartSentimentDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StartSentimentDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StartSentimentDetectionJobResponse( + data.StartSentimentDetectionJobResponse, + context + ); + const response: StartSentimentDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StartSentimentDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StartSentimentDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + response = await deserializeAws_json1_1KmsKeyValidationExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StartTopicsDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StartTopicsDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StartTopicsDetectionJobResponse( + data.StartTopicsDetectionJobResponse, + context + ); + const response: StartTopicsDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StartTopicsDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StartTopicsDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "KmsKeyValidationException": + case "com.amazonaws.comprehend#KmsKeyValidationException": + response = await deserializeAws_json1_1KmsKeyValidationExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StopDominantLanguageDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StopDominantLanguageDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StopDominantLanguageDetectionJobResponse( + data.StopDominantLanguageDetectionJobResponse, + context + ); + const response: StopDominantLanguageDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StopDominantLanguageDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StopDominantLanguageDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StopEntitiesDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StopEntitiesDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StopEntitiesDetectionJobResponse( + data.StopEntitiesDetectionJobResponse, + context + ); + const response: StopEntitiesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StopEntitiesDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StopEntitiesDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StopKeyPhrasesDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StopKeyPhrasesDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StopKeyPhrasesDetectionJobResponse( + data.StopKeyPhrasesDetectionJobResponse, + context + ); + const response: StopKeyPhrasesDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StopKeyPhrasesDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StopKeyPhrasesDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StopSentimentDetectionJobCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StopSentimentDetectionJobCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StopSentimentDetectionJobResponse( + data.StopSentimentDetectionJobResponse, + context + ); + const response: StopSentimentDetectionJobCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StopSentimentDetectionJobResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StopSentimentDetectionJobCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "JobNotFoundException": + case "com.amazonaws.comprehend#JobNotFoundException": + response = await deserializeAws_json1_1JobNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StopTrainingDocumentClassifierCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StopTrainingDocumentClassifierCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StopTrainingDocumentClassifierResponse( + data.StopTrainingDocumentClassifierResponse, + context + ); + const response: StopTrainingDocumentClassifierCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StopTrainingDocumentClassifierResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StopTrainingDocumentClassifierCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1StopTrainingEntityRecognizerCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1StopTrainingEntityRecognizerCommandError( + output, + context + ); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1StopTrainingEntityRecognizerResponse( + data.StopTrainingEntityRecognizerResponse, + context + ); + const response: StopTrainingEntityRecognizerCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "StopTrainingEntityRecognizerResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1StopTrainingEntityRecognizerCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1TagResourceCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1TagResourceCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1TagResourceResponse( + data.TagResourceResponse, + context + ); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "TagResourceResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1TagResourceCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "ConcurrentModificationException": + case "com.amazonaws.comprehend#ConcurrentModificationException": + response = await deserializeAws_json1_1ConcurrentModificationExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyTagsException": + case "com.amazonaws.comprehend#TooManyTagsException": + response = await deserializeAws_json1_1TooManyTagsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1UntagResourceCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1UntagResourceCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1UntagResourceResponse( + data.UntagResourceResponse, + context + ); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "UntagResourceResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1UntagResourceCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "ConcurrentModificationException": + case "com.amazonaws.comprehend#ConcurrentModificationException": + response = await deserializeAws_json1_1ConcurrentModificationExceptionResponse( + parsedOutput, + context + ); + break; + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyTagKeysException": + case "com.amazonaws.comprehend#TooManyTagKeysException": + response = await deserializeAws_json1_1TooManyTagKeysExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +export async function deserializeAws_json1_1UpdateEndpointCommand( + output: __HttpResponse, + context: __SerdeContext +): Promise { + if (output.statusCode >= 400) { + return deserializeAws_json1_1UpdateEndpointCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1UpdateEndpointResponse( + data.UpdateEndpointResponse, + context + ); + const response: UpdateEndpointCommandOutput = { + $metadata: deserializeMetadata(output), + __type: "UpdateEndpointResponse", + ...contents + }; + return Promise.resolve(response); +} + +async function deserializeAws_json1_1UpdateEndpointCommandError( + output: __HttpResponse, + context: __SerdeContext +): Promise { + const data: any = await parseBody(output.body, context); + const parsedOutput: any = { + ...output, + body: data + }; + let response: __SmithyException & __MetadataBearer; + let errorCode: String; + const errorTypeParts: String = data["__type"].split("#"); + errorCode = + errorTypeParts[1] === undefined ? errorTypeParts[0] : errorTypeParts[1]; + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.comprehend#InternalServerException": + response = await deserializeAws_json1_1InternalServerExceptionResponse( + parsedOutput, + context + ); + break; + case "InvalidRequestException": + case "com.amazonaws.comprehend#InvalidRequestException": + response = await deserializeAws_json1_1InvalidRequestExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceInUseException": + case "com.amazonaws.comprehend#ResourceInUseException": + response = await deserializeAws_json1_1ResourceInUseExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceLimitExceededException": + case "com.amazonaws.comprehend#ResourceLimitExceededException": + response = await deserializeAws_json1_1ResourceLimitExceededExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceNotFoundException": + case "com.amazonaws.comprehend#ResourceNotFoundException": + response = await deserializeAws_json1_1ResourceNotFoundExceptionResponse( + parsedOutput, + context + ); + break; + case "ResourceUnavailableException": + case "com.amazonaws.comprehend#ResourceUnavailableException": + response = await deserializeAws_json1_1ResourceUnavailableExceptionResponse( + parsedOutput, + context + ); + break; + case "TooManyRequestsException": + case "com.amazonaws.comprehend#TooManyRequestsException": + response = await deserializeAws_json1_1TooManyRequestsExceptionResponse( + parsedOutput, + context + ); + break; + default: + errorCode = errorCode || "UnknownError"; + response = { + __type: `com.amazonaws.comprehend#${errorCode}`, + $fault: "client", + $metadata: deserializeMetadata(output) + }; + } + return Promise.reject(Object.assign(new Error(response.__type), response)); +} + +const deserializeAws_json1_1BatchSizeLimitExceededExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1BatchSizeLimitExceededException( + output.body, + context + ); + const contents: BatchSizeLimitExceededException = { + __type: "BatchSizeLimitExceededException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1ConcurrentModificationException( + output.body, + context + ); + const contents: ConcurrentModificationException = { + __type: "ConcurrentModificationException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1InternalServerExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1InternalServerException( + output.body, + context + ); + const contents: InternalServerException = { + __type: "InternalServerException", + $fault: "server", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1InvalidFilterExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1InvalidFilterException( + output.body, + context + ); + const contents: InvalidFilterException = { + __type: "InvalidFilterException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1InvalidRequestExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1InvalidRequestException( + output.body, + context + ); + const contents: InvalidRequestException = { + __type: "InvalidRequestException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1JobNotFoundExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1JobNotFoundException( + output.body, + context + ); + const contents: JobNotFoundException = { + __type: "JobNotFoundException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1KmsKeyValidationExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1KmsKeyValidationException( + output.body, + context + ); + const contents: KmsKeyValidationException = { + __type: "KmsKeyValidationException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1ResourceInUseExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1ResourceInUseException( + output.body, + context + ); + const contents: ResourceInUseException = { + __type: "ResourceInUseException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1ResourceLimitExceededExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1ResourceLimitExceededException( + output.body, + context + ); + const contents: ResourceLimitExceededException = { + __type: "ResourceLimitExceededException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1ResourceNotFoundException( + output.body, + context + ); + const contents: ResourceNotFoundException = { + __type: "ResourceNotFoundException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1ResourceUnavailableExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1ResourceUnavailableException( + output.body, + context + ); + const contents: ResourceUnavailableException = { + __type: "ResourceUnavailableException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1TextSizeLimitExceededExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1TextSizeLimitExceededException( + output.body, + context + ); + const contents: TextSizeLimitExceededException = { + __type: "TextSizeLimitExceededException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1TooManyRequestsExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1TooManyRequestsException( + output.body, + context + ); + const contents: TooManyRequestsException = { + __type: "TooManyRequestsException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1TooManyTagKeysExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1TooManyTagKeysException( + output.body, + context + ); + const contents: TooManyTagKeysException = { + __type: "TooManyTagKeysException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1TooManyTagsExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1TooManyTagsException( + output.body, + context + ); + const contents: TooManyTagsException = { + __type: "TooManyTagsException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const deserializeAws_json1_1UnsupportedLanguageExceptionResponse = async ( + output: any, + context: __SerdeContext +): Promise => { + const deserialized: any = deserializeAws_json1_1UnsupportedLanguageException( + output.body, + context + ); + const contents: UnsupportedLanguageException = { + __type: "UnsupportedLanguageException", + $fault: "client", + $metadata: deserializeMetadata(output), + ...deserialized + }; + return contents; +}; + +const serializeAws_json1_1BatchDetectDominantLanguageRequest = ( + input: BatchDetectDominantLanguageRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.TextList !== undefined) { + bodyParams["TextList"] = serializeAws_json1_1StringList( + input.TextList, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1BatchDetectEntitiesRequest = ( + input: BatchDetectEntitiesRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.TextList !== undefined) { + bodyParams["TextList"] = serializeAws_json1_1StringList( + input.TextList, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1BatchDetectKeyPhrasesRequest = ( + input: BatchDetectKeyPhrasesRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.TextList !== undefined) { + bodyParams["TextList"] = serializeAws_json1_1StringList( + input.TextList, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1BatchDetectSentimentRequest = ( + input: BatchDetectSentimentRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.TextList !== undefined) { + bodyParams["TextList"] = serializeAws_json1_1StringList( + input.TextList, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1BatchDetectSyntaxRequest = ( + input: BatchDetectSyntaxRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.TextList !== undefined) { + bodyParams["TextList"] = serializeAws_json1_1StringList( + input.TextList, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1ClassifyDocumentRequest = ( + input: ClassifyDocumentRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.EndpointArn !== undefined) { + bodyParams["EndpointArn"] = input.EndpointArn; + } + if (input.Text !== undefined) { + bodyParams["Text"] = input.Text; + } + return bodyParams; +}; + +const serializeAws_json1_1CreateDocumentClassifierRequest = ( + input: CreateDocumentClassifierRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DataAccessRoleArn !== undefined) { + bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; + } + if (input.DocumentClassifierName !== undefined) { + bodyParams["DocumentClassifierName"] = input.DocumentClassifierName; + } + if (input.InputDataConfig !== undefined) { + bodyParams[ + "InputDataConfig" + ] = serializeAws_json1_1DocumentClassifierInputDataConfig( + input.InputDataConfig, + context + ); + } + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.OutputDataConfig !== undefined) { + bodyParams[ + "OutputDataConfig" + ] = serializeAws_json1_1DocumentClassifierOutputDataConfig( + input.OutputDataConfig, + context + ); + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); + } + if (input.VolumeKmsKeyId !== undefined) { + bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; + } + if (input.VpcConfig !== undefined) { + bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( + input.VpcConfig, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1CreateEndpointRequest = ( + input: CreateEndpointRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DesiredInferenceUnits !== undefined) { + bodyParams["DesiredInferenceUnits"] = input.DesiredInferenceUnits; + } + if (input.EndpointName !== undefined) { + bodyParams["EndpointName"] = input.EndpointName; + } + if (input.ModelArn !== undefined) { + bodyParams["ModelArn"] = input.ModelArn; + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); + } + return bodyParams; +}; + +const serializeAws_json1_1CreateEntityRecognizerRequest = ( + input: CreateEntityRecognizerRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DataAccessRoleArn !== undefined) { + bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; + } + if (input.InputDataConfig !== undefined) { + bodyParams[ + "InputDataConfig" + ] = serializeAws_json1_1EntityRecognizerInputDataConfig( + input.InputDataConfig, + context + ); + } + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.RecognizerName !== undefined) { + bodyParams["RecognizerName"] = input.RecognizerName; + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); + } + if (input.VolumeKmsKeyId !== undefined) { + bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; + } + if (input.VpcConfig !== undefined) { + bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( + input.VpcConfig, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1DeleteDocumentClassifierRequest = ( + input: DeleteDocumentClassifierRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.DocumentClassifierArn !== undefined) { + bodyParams["DocumentClassifierArn"] = input.DocumentClassifierArn; + } + return bodyParams; +}; + +const serializeAws_json1_1DeleteEndpointRequest = ( + input: DeleteEndpointRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.EndpointArn !== undefined) { + bodyParams["EndpointArn"] = input.EndpointArn; + } + return bodyParams; +}; + +const serializeAws_json1_1DeleteEntityRecognizerRequest = ( + input: DeleteEntityRecognizerRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.EntityRecognizerArn !== undefined) { + bodyParams["EntityRecognizerArn"] = input.EntityRecognizerArn; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeDocumentClassificationJobRequest = ( + input: DescribeDocumentClassificationJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeDocumentClassifierRequest = ( + input: DescribeDocumentClassifierRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.DocumentClassifierArn !== undefined) { + bodyParams["DocumentClassifierArn"] = input.DocumentClassifierArn; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeDominantLanguageDetectionJobRequest = ( + input: DescribeDominantLanguageDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeEndpointRequest = ( + input: DescribeEndpointRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.EndpointArn !== undefined) { + bodyParams["EndpointArn"] = input.EndpointArn; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeEntitiesDetectionJobRequest = ( + input: DescribeEntitiesDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeEntityRecognizerRequest = ( + input: DescribeEntityRecognizerRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.EntityRecognizerArn !== undefined) { + bodyParams["EntityRecognizerArn"] = input.EntityRecognizerArn; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeKeyPhrasesDetectionJobRequest = ( + input: DescribeKeyPhrasesDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeSentimentDetectionJobRequest = ( + input: DescribeSentimentDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1DescribeTopicsDetectionJobRequest = ( + input: DescribeTopicsDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1DetectDominantLanguageRequest = ( + input: DetectDominantLanguageRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Text !== undefined) { + bodyParams["Text"] = input.Text; + } + return bodyParams; +}; + +const serializeAws_json1_1DetectEntitiesRequest = ( + input: DetectEntitiesRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.Text !== undefined) { + bodyParams["Text"] = input.Text; + } + return bodyParams; +}; + +const serializeAws_json1_1DetectKeyPhrasesRequest = ( + input: DetectKeyPhrasesRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.Text !== undefined) { + bodyParams["Text"] = input.Text; + } + return bodyParams; +}; + +const serializeAws_json1_1DetectSentimentRequest = ( + input: DetectSentimentRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.Text !== undefined) { + bodyParams["Text"] = input.Text; + } + return bodyParams; +}; + +const serializeAws_json1_1DetectSyntaxRequest = ( + input: DetectSyntaxRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.Text !== undefined) { + bodyParams["Text"] = input.Text; + } + return bodyParams; +}; + +const serializeAws_json1_1DocumentClassificationJobFilter = ( + input: DocumentClassificationJobFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.JobStatus !== undefined) { + bodyParams["JobStatus"] = input.JobStatus; + } + if (input.SubmitTimeAfter !== undefined) { + bodyParams["SubmitTimeAfter"] = Math.round( + input.SubmitTimeAfter.getTime() / 1000 + ); + } + if (input.SubmitTimeBefore !== undefined) { + bodyParams["SubmitTimeBefore"] = Math.round( + input.SubmitTimeBefore.getTime() / 1000 + ); + } + return bodyParams; +}; + +const serializeAws_json1_1DocumentClassifierFilter = ( + input: DocumentClassifierFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Status !== undefined) { + bodyParams["Status"] = input.Status; + } + if (input.SubmitTimeAfter !== undefined) { + bodyParams["SubmitTimeAfter"] = Math.round( + input.SubmitTimeAfter.getTime() / 1000 + ); + } + if (input.SubmitTimeBefore !== undefined) { + bodyParams["SubmitTimeBefore"] = Math.round( + input.SubmitTimeBefore.getTime() / 1000 + ); + } + return bodyParams; +}; + +const serializeAws_json1_1DocumentClassifierInputDataConfig = ( + input: DocumentClassifierInputDataConfig, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.S3Uri !== undefined) { + bodyParams["S3Uri"] = input.S3Uri; + } + return bodyParams; +}; + +const serializeAws_json1_1DocumentClassifierOutputDataConfig = ( + input: DocumentClassifierOutputDataConfig, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.KmsKeyId !== undefined) { + bodyParams["KmsKeyId"] = input.KmsKeyId; + } + if (input.S3Uri !== undefined) { + bodyParams["S3Uri"] = input.S3Uri; + } + return bodyParams; +}; + +const serializeAws_json1_1DominantLanguageDetectionJobFilter = ( + input: DominantLanguageDetectionJobFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.JobStatus !== undefined) { + bodyParams["JobStatus"] = input.JobStatus; + } + if (input.SubmitTimeAfter !== undefined) { + bodyParams["SubmitTimeAfter"] = Math.round( + input.SubmitTimeAfter.getTime() / 1000 + ); + } + if (input.SubmitTimeBefore !== undefined) { + bodyParams["SubmitTimeBefore"] = Math.round( + input.SubmitTimeBefore.getTime() / 1000 + ); + } + return bodyParams; +}; + +const serializeAws_json1_1EndpointFilter = ( + input: EndpointFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.CreationTimeAfter !== undefined) { + bodyParams["CreationTimeAfter"] = Math.round( + input.CreationTimeAfter.getTime() / 1000 + ); + } + if (input.CreationTimeBefore !== undefined) { + bodyParams["CreationTimeBefore"] = Math.round( + input.CreationTimeBefore.getTime() / 1000 + ); + } + if (input.ModelArn !== undefined) { + bodyParams["ModelArn"] = input.ModelArn; + } + if (input.Status !== undefined) { + bodyParams["Status"] = input.Status; + } + return bodyParams; +}; + +const serializeAws_json1_1EntitiesDetectionJobFilter = ( + input: EntitiesDetectionJobFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.JobStatus !== undefined) { + bodyParams["JobStatus"] = input.JobStatus; + } + if (input.SubmitTimeAfter !== undefined) { + bodyParams["SubmitTimeAfter"] = Math.round( + input.SubmitTimeAfter.getTime() / 1000 + ); + } + if (input.SubmitTimeBefore !== undefined) { + bodyParams["SubmitTimeBefore"] = Math.round( + input.SubmitTimeBefore.getTime() / 1000 + ); + } + return bodyParams; +}; + +const serializeAws_json1_1EntityRecognizerAnnotations = ( + input: EntityRecognizerAnnotations, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.S3Uri !== undefined) { + bodyParams["S3Uri"] = input.S3Uri; + } + return bodyParams; +}; + +const serializeAws_json1_1EntityRecognizerDocuments = ( + input: EntityRecognizerDocuments, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.S3Uri !== undefined) { + bodyParams["S3Uri"] = input.S3Uri; + } + return bodyParams; +}; + +const serializeAws_json1_1EntityRecognizerEntityList = ( + input: EntityRecognizerEntityList, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.S3Uri !== undefined) { + bodyParams["S3Uri"] = input.S3Uri; + } + return bodyParams; +}; + +const serializeAws_json1_1EntityRecognizerFilter = ( + input: EntityRecognizerFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Status !== undefined) { + bodyParams["Status"] = input.Status; + } + if (input.SubmitTimeAfter !== undefined) { + bodyParams["SubmitTimeAfter"] = Math.round( + input.SubmitTimeAfter.getTime() / 1000 + ); + } + if (input.SubmitTimeBefore !== undefined) { + bodyParams["SubmitTimeBefore"] = Math.round( + input.SubmitTimeBefore.getTime() / 1000 + ); + } + return bodyParams; +}; + +const serializeAws_json1_1EntityRecognizerInputDataConfig = ( + input: EntityRecognizerInputDataConfig, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Annotations !== undefined) { + bodyParams["Annotations"] = serializeAws_json1_1EntityRecognizerAnnotations( + input.Annotations, + context + ); + } + if (input.Documents !== undefined) { + bodyParams["Documents"] = serializeAws_json1_1EntityRecognizerDocuments( + input.Documents, + context + ); + } + if (input.EntityList !== undefined) { + bodyParams["EntityList"] = serializeAws_json1_1EntityRecognizerEntityList( + input.EntityList, + context + ); + } + if (input.EntityTypes !== undefined) { + bodyParams["EntityTypes"] = serializeAws_json1_1EntityTypesList( + input.EntityTypes, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1EntityTypesList = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => + serializeAws_json1_1EntityTypesListItem(entry, context) + ); +}; + +const serializeAws_json1_1EntityTypesListItem = ( + input: EntityTypesListItem, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Type !== undefined) { + bodyParams["Type"] = input.Type; + } + return bodyParams; +}; + +const serializeAws_json1_1InputDataConfig = ( + input: InputDataConfig, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.InputFormat !== undefined) { + bodyParams["InputFormat"] = input.InputFormat; + } + if (input.S3Uri !== undefined) { + bodyParams["S3Uri"] = input.S3Uri; + } + return bodyParams; +}; + +const serializeAws_json1_1KeyPhrasesDetectionJobFilter = ( + input: KeyPhrasesDetectionJobFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.JobStatus !== undefined) { + bodyParams["JobStatus"] = input.JobStatus; + } + if (input.SubmitTimeAfter !== undefined) { + bodyParams["SubmitTimeAfter"] = Math.round( + input.SubmitTimeAfter.getTime() / 1000 + ); + } + if (input.SubmitTimeBefore !== undefined) { + bodyParams["SubmitTimeBefore"] = Math.round( + input.SubmitTimeBefore.getTime() / 1000 + ); + } + return bodyParams; +}; + +const serializeAws_json1_1ListDocumentClassificationJobsRequest = ( + input: ListDocumentClassificationJobsRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams["Filter"] = serializeAws_json1_1DocumentClassificationJobFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1ListDocumentClassifiersRequest = ( + input: ListDocumentClassifiersRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams["Filter"] = serializeAws_json1_1DocumentClassifierFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1ListDominantLanguageDetectionJobsRequest = ( + input: ListDominantLanguageDetectionJobsRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams[ + "Filter" + ] = serializeAws_json1_1DominantLanguageDetectionJobFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1ListEndpointsRequest = ( + input: ListEndpointsRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams["Filter"] = serializeAws_json1_1EndpointFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1ListEntitiesDetectionJobsRequest = ( + input: ListEntitiesDetectionJobsRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams["Filter"] = serializeAws_json1_1EntitiesDetectionJobFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1ListEntityRecognizersRequest = ( + input: ListEntityRecognizersRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams["Filter"] = serializeAws_json1_1EntityRecognizerFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1ListKeyPhrasesDetectionJobsRequest = ( + input: ListKeyPhrasesDetectionJobsRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams["Filter"] = serializeAws_json1_1KeyPhrasesDetectionJobFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1ListSentimentDetectionJobsRequest = ( + input: ListSentimentDetectionJobsRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams["Filter"] = serializeAws_json1_1SentimentDetectionJobFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1ListTagsForResourceRequest = ( + input: ListTagsForResourceRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ResourceArn !== undefined) { + bodyParams["ResourceArn"] = input.ResourceArn; + } + return bodyParams; +}; + +const serializeAws_json1_1ListTopicsDetectionJobsRequest = ( + input: ListTopicsDetectionJobsRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.Filter !== undefined) { + bodyParams["Filter"] = serializeAws_json1_1TopicsDetectionJobFilter( + input.Filter, + context + ); + } + if (input.MaxResults !== undefined) { + bodyParams["MaxResults"] = input.MaxResults; + } + if (input.NextToken !== undefined) { + bodyParams["NextToken"] = input.NextToken; + } + return bodyParams; +}; + +const serializeAws_json1_1OutputDataConfig = ( + input: OutputDataConfig, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.KmsKeyId !== undefined) { + bodyParams["KmsKeyId"] = input.KmsKeyId; + } + if (input.S3Uri !== undefined) { + bodyParams["S3Uri"] = input.S3Uri; + } + return bodyParams; +}; + +const serializeAws_json1_1SecurityGroupIds = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => entry); +}; + +const serializeAws_json1_1SentimentDetectionJobFilter = ( + input: SentimentDetectionJobFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.JobStatus !== undefined) { + bodyParams["JobStatus"] = input.JobStatus; + } + if (input.SubmitTimeAfter !== undefined) { + bodyParams["SubmitTimeAfter"] = Math.round( + input.SubmitTimeAfter.getTime() / 1000 + ); + } + if (input.SubmitTimeBefore !== undefined) { + bodyParams["SubmitTimeBefore"] = Math.round( + input.SubmitTimeBefore.getTime() / 1000 + ); + } + return bodyParams; +}; + +const serializeAws_json1_1StartDocumentClassificationJobRequest = ( + input: StartDocumentClassificationJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DataAccessRoleArn !== undefined) { + bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; + } + if (input.DocumentClassifierArn !== undefined) { + bodyParams["DocumentClassifierArn"] = input.DocumentClassifierArn; + } + if (input.InputDataConfig !== undefined) { + bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( + input.InputDataConfig, + context + ); + } + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.OutputDataConfig !== undefined) { + bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( + input.OutputDataConfig, + context + ); + } + if (input.VolumeKmsKeyId !== undefined) { + bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; + } + if (input.VpcConfig !== undefined) { + bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( + input.VpcConfig, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1StartDominantLanguageDetectionJobRequest = ( + input: StartDominantLanguageDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DataAccessRoleArn !== undefined) { + bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; + } + if (input.InputDataConfig !== undefined) { + bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( + input.InputDataConfig, + context + ); + } + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.OutputDataConfig !== undefined) { + bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( + input.OutputDataConfig, + context + ); + } + if (input.VolumeKmsKeyId !== undefined) { + bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; + } + if (input.VpcConfig !== undefined) { + bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( + input.VpcConfig, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1StartEntitiesDetectionJobRequest = ( + input: StartEntitiesDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DataAccessRoleArn !== undefined) { + bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; + } + if (input.EntityRecognizerArn !== undefined) { + bodyParams["EntityRecognizerArn"] = input.EntityRecognizerArn; + } + if (input.InputDataConfig !== undefined) { + bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( + input.InputDataConfig, + context + ); + } + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.OutputDataConfig !== undefined) { + bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( + input.OutputDataConfig, + context + ); + } + if (input.VolumeKmsKeyId !== undefined) { + bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; + } + if (input.VpcConfig !== undefined) { + bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( + input.VpcConfig, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1StartKeyPhrasesDetectionJobRequest = ( + input: StartKeyPhrasesDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DataAccessRoleArn !== undefined) { + bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; + } + if (input.InputDataConfig !== undefined) { + bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( + input.InputDataConfig, + context + ); + } + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.OutputDataConfig !== undefined) { + bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( + input.OutputDataConfig, + context + ); + } + if (input.VolumeKmsKeyId !== undefined) { + bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; + } + if (input.VpcConfig !== undefined) { + bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( + input.VpcConfig, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1StartSentimentDetectionJobRequest = ( + input: StartSentimentDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DataAccessRoleArn !== undefined) { + bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; + } + if (input.InputDataConfig !== undefined) { + bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( + input.InputDataConfig, + context + ); + } + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.LanguageCode !== undefined) { + bodyParams["LanguageCode"] = input.LanguageCode; + } + if (input.OutputDataConfig !== undefined) { + bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( + input.OutputDataConfig, + context + ); + } + if (input.VolumeKmsKeyId !== undefined) { + bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; + } + if (input.VpcConfig !== undefined) { + bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( + input.VpcConfig, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1StartTopicsDetectionJobRequest = ( + input: StartTopicsDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ClientRequestToken !== undefined) { + bodyParams["ClientRequestToken"] = input.ClientRequestToken; + } + if (input.DataAccessRoleArn !== undefined) { + bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; + } + if (input.InputDataConfig !== undefined) { + bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( + input.InputDataConfig, + context + ); + } + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.NumberOfTopics !== undefined) { + bodyParams["NumberOfTopics"] = input.NumberOfTopics; + } + if (input.OutputDataConfig !== undefined) { + bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( + input.OutputDataConfig, + context + ); + } + if (input.VolumeKmsKeyId !== undefined) { + bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; + } + if (input.VpcConfig !== undefined) { + bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( + input.VpcConfig, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1StopDominantLanguageDetectionJobRequest = ( + input: StopDominantLanguageDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1StopEntitiesDetectionJobRequest = ( + input: StopEntitiesDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1StopKeyPhrasesDetectionJobRequest = ( + input: StopKeyPhrasesDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1StopSentimentDetectionJobRequest = ( + input: StopSentimentDetectionJobRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobId !== undefined) { + bodyParams["JobId"] = input.JobId; + } + return bodyParams; +}; + +const serializeAws_json1_1StopTrainingDocumentClassifierRequest = ( + input: StopTrainingDocumentClassifierRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.DocumentClassifierArn !== undefined) { + bodyParams["DocumentClassifierArn"] = input.DocumentClassifierArn; + } + return bodyParams; +}; + +const serializeAws_json1_1StopTrainingEntityRecognizerRequest = ( + input: StopTrainingEntityRecognizerRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.EntityRecognizerArn !== undefined) { + bodyParams["EntityRecognizerArn"] = input.EntityRecognizerArn; + } + return bodyParams; +}; + +const serializeAws_json1_1StringList = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => entry); +}; + +const serializeAws_json1_1Subnets = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => entry); +}; + +const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { + let bodyParams: any = {}; + if (input.Key !== undefined) { + bodyParams["Key"] = input.Key; + } + if (input.Value !== undefined) { + bodyParams["Value"] = input.Value; + } + return bodyParams; +}; + +const serializeAws_json1_1TagKeyList = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => entry); +}; + +const serializeAws_json1_1TagList = ( + input: Array, + context: __SerdeContext +): any => { + return (input || []).map(entry => serializeAws_json1_1Tag(entry, context)); +}; + +const serializeAws_json1_1TagResourceRequest = ( + input: TagResourceRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ResourceArn !== undefined) { + bodyParams["ResourceArn"] = input.ResourceArn; + } + if (input.Tags !== undefined) { + bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); + } + return bodyParams; +}; + +const serializeAws_json1_1TopicsDetectionJobFilter = ( + input: TopicsDetectionJobFilter, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.JobName !== undefined) { + bodyParams["JobName"] = input.JobName; + } + if (input.JobStatus !== undefined) { + bodyParams["JobStatus"] = input.JobStatus; + } + if (input.SubmitTimeAfter !== undefined) { + bodyParams["SubmitTimeAfter"] = Math.round( + input.SubmitTimeAfter.getTime() / 1000 + ); + } + if (input.SubmitTimeBefore !== undefined) { + bodyParams["SubmitTimeBefore"] = Math.round( + input.SubmitTimeBefore.getTime() / 1000 + ); + } + return bodyParams; +}; + +const serializeAws_json1_1UntagResourceRequest = ( + input: UntagResourceRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.ResourceArn !== undefined) { + bodyParams["ResourceArn"] = input.ResourceArn; + } + if (input.TagKeys !== undefined) { + bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( + input.TagKeys, + context + ); + } + return bodyParams; +}; + +const serializeAws_json1_1UpdateEndpointRequest = ( + input: UpdateEndpointRequest, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.DesiredInferenceUnits !== undefined) { + bodyParams["DesiredInferenceUnits"] = input.DesiredInferenceUnits; + } + if (input.EndpointArn !== undefined) { + bodyParams["EndpointArn"] = input.EndpointArn; + } + return bodyParams; +}; + +const serializeAws_json1_1VpcConfig = ( + input: VpcConfig, + context: __SerdeContext +): any => { + let bodyParams: any = {}; + if (input.SecurityGroupIds !== undefined) { + bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIds( + input.SecurityGroupIds, + context + ); + } + if (input.Subnets !== undefined) { + bodyParams["Subnets"] = serializeAws_json1_1Subnets(input.Subnets, context); + } + return bodyParams; +}; + +const deserializeAws_json1_1BatchDetectDominantLanguageItemResult = ( + output: any, + context: __SerdeContext +): BatchDetectDominantLanguageItemResult => { + let contents: any = { + __type: "BatchDetectDominantLanguageItemResult", + Index: undefined, + Languages: undefined + }; + if (output.Index !== undefined) { + contents.Index = output.Index; + } + if (output.Languages !== undefined) { + contents.Languages = deserializeAws_json1_1ListOfDominantLanguages( + output.Languages, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectDominantLanguageResponse = ( + output: any, + context: __SerdeContext +): BatchDetectDominantLanguageResponse => { + let contents: any = { + __type: "BatchDetectDominantLanguageResponse", + ErrorList: undefined, + ResultList: undefined + }; + if (output.ErrorList !== undefined) { + contents.ErrorList = deserializeAws_json1_1BatchItemErrorList( + output.ErrorList, + context + ); + } + if (output.ResultList !== undefined) { + contents.ResultList = deserializeAws_json1_1ListOfDetectDominantLanguageResult( + output.ResultList, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectEntitiesItemResult = ( + output: any, + context: __SerdeContext +): BatchDetectEntitiesItemResult => { + let contents: any = { + __type: "BatchDetectEntitiesItemResult", + Entities: undefined, + Index: undefined + }; + if (output.Entities !== undefined) { + contents.Entities = deserializeAws_json1_1ListOfEntities( + output.Entities, + context + ); + } + if (output.Index !== undefined) { + contents.Index = output.Index; + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectEntitiesResponse = ( + output: any, + context: __SerdeContext +): BatchDetectEntitiesResponse => { + let contents: any = { + __type: "BatchDetectEntitiesResponse", + ErrorList: undefined, + ResultList: undefined + }; + if (output.ErrorList !== undefined) { + contents.ErrorList = deserializeAws_json1_1BatchItemErrorList( + output.ErrorList, + context + ); + } + if (output.ResultList !== undefined) { + contents.ResultList = deserializeAws_json1_1ListOfDetectEntitiesResult( + output.ResultList, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectKeyPhrasesItemResult = ( + output: any, + context: __SerdeContext +): BatchDetectKeyPhrasesItemResult => { + let contents: any = { + __type: "BatchDetectKeyPhrasesItemResult", + Index: undefined, + KeyPhrases: undefined + }; + if (output.Index !== undefined) { + contents.Index = output.Index; + } + if (output.KeyPhrases !== undefined) { + contents.KeyPhrases = deserializeAws_json1_1ListOfKeyPhrases( + output.KeyPhrases, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectKeyPhrasesResponse = ( + output: any, + context: __SerdeContext +): BatchDetectKeyPhrasesResponse => { + let contents: any = { + __type: "BatchDetectKeyPhrasesResponse", + ErrorList: undefined, + ResultList: undefined + }; + if (output.ErrorList !== undefined) { + contents.ErrorList = deserializeAws_json1_1BatchItemErrorList( + output.ErrorList, + context + ); + } + if (output.ResultList !== undefined) { + contents.ResultList = deserializeAws_json1_1ListOfDetectKeyPhrasesResult( + output.ResultList, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectSentimentItemResult = ( + output: any, + context: __SerdeContext +): BatchDetectSentimentItemResult => { + let contents: any = { + __type: "BatchDetectSentimentItemResult", + Index: undefined, + Sentiment: undefined, + SentimentScore: undefined + }; + if (output.Index !== undefined) { + contents.Index = output.Index; + } + if (output.Sentiment !== undefined) { + contents.Sentiment = output.Sentiment; + } + if (output.SentimentScore !== undefined) { + contents.SentimentScore = deserializeAws_json1_1SentimentScore( + output.SentimentScore, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectSentimentResponse = ( + output: any, + context: __SerdeContext +): BatchDetectSentimentResponse => { + let contents: any = { + __type: "BatchDetectSentimentResponse", + ErrorList: undefined, + ResultList: undefined + }; + if (output.ErrorList !== undefined) { + contents.ErrorList = deserializeAws_json1_1BatchItemErrorList( + output.ErrorList, + context + ); + } + if (output.ResultList !== undefined) { + contents.ResultList = deserializeAws_json1_1ListOfDetectSentimentResult( + output.ResultList, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectSyntaxItemResult = ( + output: any, + context: __SerdeContext +): BatchDetectSyntaxItemResult => { + let contents: any = { + __type: "BatchDetectSyntaxItemResult", + Index: undefined, + SyntaxTokens: undefined + }; + if (output.Index !== undefined) { + contents.Index = output.Index; + } + if (output.SyntaxTokens !== undefined) { + contents.SyntaxTokens = deserializeAws_json1_1ListOfSyntaxTokens( + output.SyntaxTokens, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchDetectSyntaxResponse = ( + output: any, + context: __SerdeContext +): BatchDetectSyntaxResponse => { + let contents: any = { + __type: "BatchDetectSyntaxResponse", + ErrorList: undefined, + ResultList: undefined + }; + if (output.ErrorList !== undefined) { + contents.ErrorList = deserializeAws_json1_1BatchItemErrorList( + output.ErrorList, + context + ); + } + if (output.ResultList !== undefined) { + contents.ResultList = deserializeAws_json1_1ListOfDetectSyntaxResult( + output.ResultList, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1BatchItemError = ( + output: any, + context: __SerdeContext +): BatchItemError => { + let contents: any = { + __type: "BatchItemError", + ErrorCode: undefined, + ErrorMessage: undefined, + Index: undefined + }; + if (output.ErrorCode !== undefined) { + contents.ErrorCode = output.ErrorCode; + } + if (output.ErrorMessage !== undefined) { + contents.ErrorMessage = output.ErrorMessage; + } + if (output.Index !== undefined) { + contents.Index = output.Index; + } + return contents; +}; + +const deserializeAws_json1_1BatchItemErrorList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1BatchItemError(entry, context) + ); +}; + +const deserializeAws_json1_1BatchSizeLimitExceededException = ( + output: any, + context: __SerdeContext +): BatchSizeLimitExceededException => { + let contents: any = { + __type: "BatchSizeLimitExceededException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1ClassifierEvaluationMetrics = ( + output: any, + context: __SerdeContext +): ClassifierEvaluationMetrics => { + let contents: any = { + __type: "ClassifierEvaluationMetrics", + Accuracy: undefined, + F1Score: undefined, + Precision: undefined, + Recall: undefined + }; + if (output.Accuracy !== undefined) { + contents.Accuracy = output.Accuracy; + } + if (output.F1Score !== undefined) { + contents.F1Score = output.F1Score; + } + if (output.Precision !== undefined) { + contents.Precision = output.Precision; + } + if (output.Recall !== undefined) { + contents.Recall = output.Recall; + } + return contents; +}; + +const deserializeAws_json1_1ClassifierMetadata = ( + output: any, + context: __SerdeContext +): ClassifierMetadata => { + let contents: any = { + __type: "ClassifierMetadata", + EvaluationMetrics: undefined, + NumberOfLabels: undefined, + NumberOfTestDocuments: undefined, + NumberOfTrainedDocuments: undefined + }; + if (output.EvaluationMetrics !== undefined) { + contents.EvaluationMetrics = deserializeAws_json1_1ClassifierEvaluationMetrics( + output.EvaluationMetrics, + context + ); + } + if (output.NumberOfLabels !== undefined) { + contents.NumberOfLabels = output.NumberOfLabels; + } + if (output.NumberOfTestDocuments !== undefined) { + contents.NumberOfTestDocuments = output.NumberOfTestDocuments; + } + if (output.NumberOfTrainedDocuments !== undefined) { + contents.NumberOfTrainedDocuments = output.NumberOfTrainedDocuments; + } + return contents; +}; + +const deserializeAws_json1_1ClassifyDocumentResponse = ( + output: any, + context: __SerdeContext +): ClassifyDocumentResponse => { + let contents: any = { + __type: "ClassifyDocumentResponse", + Classes: undefined + }; + if (output.Classes !== undefined) { + contents.Classes = deserializeAws_json1_1ListOfClasses( + output.Classes, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1ConcurrentModificationException = ( + output: any, + context: __SerdeContext +): ConcurrentModificationException => { + let contents: any = { + __type: "ConcurrentModificationException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1CreateDocumentClassifierResponse = ( + output: any, + context: __SerdeContext +): CreateDocumentClassifierResponse => { + let contents: any = { + __type: "CreateDocumentClassifierResponse", + DocumentClassifierArn: undefined + }; + if (output.DocumentClassifierArn !== undefined) { + contents.DocumentClassifierArn = output.DocumentClassifierArn; + } + return contents; +}; + +const deserializeAws_json1_1CreateEndpointResponse = ( + output: any, + context: __SerdeContext +): CreateEndpointResponse => { + let contents: any = { + __type: "CreateEndpointResponse", + EndpointArn: undefined + }; + if (output.EndpointArn !== undefined) { + contents.EndpointArn = output.EndpointArn; + } + return contents; +}; + +const deserializeAws_json1_1CreateEntityRecognizerResponse = ( + output: any, + context: __SerdeContext +): CreateEntityRecognizerResponse => { + let contents: any = { + __type: "CreateEntityRecognizerResponse", + EntityRecognizerArn: undefined + }; + if (output.EntityRecognizerArn !== undefined) { + contents.EntityRecognizerArn = output.EntityRecognizerArn; + } + return contents; +}; + +const deserializeAws_json1_1DeleteDocumentClassifierResponse = ( + output: any, + context: __SerdeContext +): DeleteDocumentClassifierResponse => { + let contents: any = { + __type: "DeleteDocumentClassifierResponse" + }; + return contents; +}; + +const deserializeAws_json1_1DeleteEndpointResponse = ( + output: any, + context: __SerdeContext +): DeleteEndpointResponse => { + let contents: any = { + __type: "DeleteEndpointResponse" + }; + return contents; +}; + +const deserializeAws_json1_1DeleteEntityRecognizerResponse = ( + output: any, + context: __SerdeContext +): DeleteEntityRecognizerResponse => { + let contents: any = { + __type: "DeleteEntityRecognizerResponse" + }; + return contents; +}; + +const deserializeAws_json1_1DescribeDocumentClassificationJobResponse = ( + output: any, + context: __SerdeContext +): DescribeDocumentClassificationJobResponse => { + let contents: any = { + __type: "DescribeDocumentClassificationJobResponse", + DocumentClassificationJobProperties: undefined + }; + if (output.DocumentClassificationJobProperties !== undefined) { + contents.DocumentClassificationJobProperties = deserializeAws_json1_1DocumentClassificationJobProperties( + output.DocumentClassificationJobProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeDocumentClassifierResponse = ( + output: any, + context: __SerdeContext +): DescribeDocumentClassifierResponse => { + let contents: any = { + __type: "DescribeDocumentClassifierResponse", + DocumentClassifierProperties: undefined + }; + if (output.DocumentClassifierProperties !== undefined) { + contents.DocumentClassifierProperties = deserializeAws_json1_1DocumentClassifierProperties( + output.DocumentClassifierProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeDominantLanguageDetectionJobResponse = ( + output: any, + context: __SerdeContext +): DescribeDominantLanguageDetectionJobResponse => { + let contents: any = { + __type: "DescribeDominantLanguageDetectionJobResponse", + DominantLanguageDetectionJobProperties: undefined + }; + if (output.DominantLanguageDetectionJobProperties !== undefined) { + contents.DominantLanguageDetectionJobProperties = deserializeAws_json1_1DominantLanguageDetectionJobProperties( + output.DominantLanguageDetectionJobProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeEndpointResponse = ( + output: any, + context: __SerdeContext +): DescribeEndpointResponse => { + let contents: any = { + __type: "DescribeEndpointResponse", + EndpointProperties: undefined + }; + if (output.EndpointProperties !== undefined) { + contents.EndpointProperties = deserializeAws_json1_1EndpointProperties( + output.EndpointProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeEntitiesDetectionJobResponse = ( + output: any, + context: __SerdeContext +): DescribeEntitiesDetectionJobResponse => { + let contents: any = { + __type: "DescribeEntitiesDetectionJobResponse", + EntitiesDetectionJobProperties: undefined + }; + if (output.EntitiesDetectionJobProperties !== undefined) { + contents.EntitiesDetectionJobProperties = deserializeAws_json1_1EntitiesDetectionJobProperties( + output.EntitiesDetectionJobProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeEntityRecognizerResponse = ( + output: any, + context: __SerdeContext +): DescribeEntityRecognizerResponse => { + let contents: any = { + __type: "DescribeEntityRecognizerResponse", + EntityRecognizerProperties: undefined + }; + if (output.EntityRecognizerProperties !== undefined) { + contents.EntityRecognizerProperties = deserializeAws_json1_1EntityRecognizerProperties( + output.EntityRecognizerProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeKeyPhrasesDetectionJobResponse = ( + output: any, + context: __SerdeContext +): DescribeKeyPhrasesDetectionJobResponse => { + let contents: any = { + __type: "DescribeKeyPhrasesDetectionJobResponse", + KeyPhrasesDetectionJobProperties: undefined + }; + if (output.KeyPhrasesDetectionJobProperties !== undefined) { + contents.KeyPhrasesDetectionJobProperties = deserializeAws_json1_1KeyPhrasesDetectionJobProperties( + output.KeyPhrasesDetectionJobProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeSentimentDetectionJobResponse = ( + output: any, + context: __SerdeContext +): DescribeSentimentDetectionJobResponse => { + let contents: any = { + __type: "DescribeSentimentDetectionJobResponse", + SentimentDetectionJobProperties: undefined + }; + if (output.SentimentDetectionJobProperties !== undefined) { + contents.SentimentDetectionJobProperties = deserializeAws_json1_1SentimentDetectionJobProperties( + output.SentimentDetectionJobProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DescribeTopicsDetectionJobResponse = ( + output: any, + context: __SerdeContext +): DescribeTopicsDetectionJobResponse => { + let contents: any = { + __type: "DescribeTopicsDetectionJobResponse", + TopicsDetectionJobProperties: undefined + }; + if (output.TopicsDetectionJobProperties !== undefined) { + contents.TopicsDetectionJobProperties = deserializeAws_json1_1TopicsDetectionJobProperties( + output.TopicsDetectionJobProperties, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DetectDominantLanguageResponse = ( + output: any, + context: __SerdeContext +): DetectDominantLanguageResponse => { + let contents: any = { + __type: "DetectDominantLanguageResponse", + Languages: undefined + }; + if (output.Languages !== undefined) { + contents.Languages = deserializeAws_json1_1ListOfDominantLanguages( + output.Languages, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DetectEntitiesResponse = ( + output: any, + context: __SerdeContext +): DetectEntitiesResponse => { + let contents: any = { + __type: "DetectEntitiesResponse", + Entities: undefined + }; + if (output.Entities !== undefined) { + contents.Entities = deserializeAws_json1_1ListOfEntities( + output.Entities, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DetectKeyPhrasesResponse = ( + output: any, + context: __SerdeContext +): DetectKeyPhrasesResponse => { + let contents: any = { + __type: "DetectKeyPhrasesResponse", + KeyPhrases: undefined + }; + if (output.KeyPhrases !== undefined) { + contents.KeyPhrases = deserializeAws_json1_1ListOfKeyPhrases( + output.KeyPhrases, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DetectSentimentResponse = ( + output: any, + context: __SerdeContext +): DetectSentimentResponse => { + let contents: any = { + __type: "DetectSentimentResponse", + Sentiment: undefined, + SentimentScore: undefined + }; + if (output.Sentiment !== undefined) { + contents.Sentiment = output.Sentiment; + } + if (output.SentimentScore !== undefined) { + contents.SentimentScore = deserializeAws_json1_1SentimentScore( + output.SentimentScore, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DetectSyntaxResponse = ( + output: any, + context: __SerdeContext +): DetectSyntaxResponse => { + let contents: any = { + __type: "DetectSyntaxResponse", + SyntaxTokens: undefined + }; + if (output.SyntaxTokens !== undefined) { + contents.SyntaxTokens = deserializeAws_json1_1ListOfSyntaxTokens( + output.SyntaxTokens, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DocumentClass = ( + output: any, + context: __SerdeContext +): DocumentClass => { + let contents: any = { + __type: "DocumentClass", + Name: undefined, + Score: undefined + }; + if (output.Name !== undefined) { + contents.Name = output.Name; + } + if (output.Score !== undefined) { + contents.Score = output.Score; + } + return contents; +}; + +const deserializeAws_json1_1DocumentClassificationJobProperties = ( + output: any, + context: __SerdeContext +): DocumentClassificationJobProperties => { + let contents: any = { + __type: "DocumentClassificationJobProperties", + DataAccessRoleArn: undefined, + DocumentClassifierArn: undefined, + EndTime: undefined, + InputDataConfig: undefined, + JobId: undefined, + JobName: undefined, + JobStatus: undefined, + Message: undefined, + OutputDataConfig: undefined, + SubmitTime: undefined, + VolumeKmsKeyId: undefined, + VpcConfig: undefined + }; + if (output.DataAccessRoleArn !== undefined) { + contents.DataAccessRoleArn = output.DataAccessRoleArn; + } + if (output.DocumentClassifierArn !== undefined) { + contents.DocumentClassifierArn = output.DocumentClassifierArn; + } + if (output.EndTime !== undefined) { + contents.EndTime = new Date( + output.EndTime % 1 != 0 + ? Math.round(output.EndTime * 1000) + : output.EndTime + ); + } + if (output.InputDataConfig !== undefined) { + contents.InputDataConfig = deserializeAws_json1_1InputDataConfig( + output.InputDataConfig, + context + ); + } + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobName !== undefined) { + contents.JobName = output.JobName; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.OutputDataConfig !== undefined) { + contents.OutputDataConfig = deserializeAws_json1_1OutputDataConfig( + output.OutputDataConfig, + context + ); + } + if (output.SubmitTime !== undefined) { + contents.SubmitTime = new Date( + output.SubmitTime % 1 != 0 + ? Math.round(output.SubmitTime * 1000) + : output.SubmitTime + ); + } + if (output.VolumeKmsKeyId !== undefined) { + contents.VolumeKmsKeyId = output.VolumeKmsKeyId; + } + if (output.VpcConfig !== undefined) { + contents.VpcConfig = deserializeAws_json1_1VpcConfig( + output.VpcConfig, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DocumentClassificationJobPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1DocumentClassificationJobProperties(entry, context) + ); +}; + +const deserializeAws_json1_1DocumentClassifierInputDataConfig = ( + output: any, + context: __SerdeContext +): DocumentClassifierInputDataConfig => { + let contents: any = { + __type: "DocumentClassifierInputDataConfig", + S3Uri: undefined + }; + if (output.S3Uri !== undefined) { + contents.S3Uri = output.S3Uri; + } + return contents; +}; + +const deserializeAws_json1_1DocumentClassifierOutputDataConfig = ( + output: any, + context: __SerdeContext +): DocumentClassifierOutputDataConfig => { + let contents: any = { + __type: "DocumentClassifierOutputDataConfig", + KmsKeyId: undefined, + S3Uri: undefined + }; + if (output.KmsKeyId !== undefined) { + contents.KmsKeyId = output.KmsKeyId; + } + if (output.S3Uri !== undefined) { + contents.S3Uri = output.S3Uri; + } + return contents; +}; + +const deserializeAws_json1_1DocumentClassifierProperties = ( + output: any, + context: __SerdeContext +): DocumentClassifierProperties => { + let contents: any = { + __type: "DocumentClassifierProperties", + ClassifierMetadata: undefined, + DataAccessRoleArn: undefined, + DocumentClassifierArn: undefined, + EndTime: undefined, + InputDataConfig: undefined, + LanguageCode: undefined, + Message: undefined, + OutputDataConfig: undefined, + Status: undefined, + SubmitTime: undefined, + TrainingEndTime: undefined, + TrainingStartTime: undefined, + VolumeKmsKeyId: undefined, + VpcConfig: undefined + }; + if (output.ClassifierMetadata !== undefined) { + contents.ClassifierMetadata = deserializeAws_json1_1ClassifierMetadata( + output.ClassifierMetadata, + context + ); + } + if (output.DataAccessRoleArn !== undefined) { + contents.DataAccessRoleArn = output.DataAccessRoleArn; + } + if (output.DocumentClassifierArn !== undefined) { + contents.DocumentClassifierArn = output.DocumentClassifierArn; + } + if (output.EndTime !== undefined) { + contents.EndTime = new Date( + output.EndTime % 1 != 0 + ? Math.round(output.EndTime * 1000) + : output.EndTime + ); + } + if (output.InputDataConfig !== undefined) { + contents.InputDataConfig = deserializeAws_json1_1DocumentClassifierInputDataConfig( + output.InputDataConfig, + context + ); + } + if (output.LanguageCode !== undefined) { + contents.LanguageCode = output.LanguageCode; + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.OutputDataConfig !== undefined) { + contents.OutputDataConfig = deserializeAws_json1_1DocumentClassifierOutputDataConfig( + output.OutputDataConfig, + context + ); + } + if (output.Status !== undefined) { + contents.Status = output.Status; + } + if (output.SubmitTime !== undefined) { + contents.SubmitTime = new Date( + output.SubmitTime % 1 != 0 + ? Math.round(output.SubmitTime * 1000) + : output.SubmitTime + ); + } + if (output.TrainingEndTime !== undefined) { + contents.TrainingEndTime = new Date( + output.TrainingEndTime % 1 != 0 + ? Math.round(output.TrainingEndTime * 1000) + : output.TrainingEndTime + ); + } + if (output.TrainingStartTime !== undefined) { + contents.TrainingStartTime = new Date( + output.TrainingStartTime % 1 != 0 + ? Math.round(output.TrainingStartTime * 1000) + : output.TrainingStartTime + ); + } + if (output.VolumeKmsKeyId !== undefined) { + contents.VolumeKmsKeyId = output.VolumeKmsKeyId; + } + if (output.VpcConfig !== undefined) { + contents.VpcConfig = deserializeAws_json1_1VpcConfig( + output.VpcConfig, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DocumentClassifierPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1DocumentClassifierProperties(entry, context) + ); +}; + +const deserializeAws_json1_1DominantLanguage = ( + output: any, + context: __SerdeContext +): DominantLanguage => { + let contents: any = { + __type: "DominantLanguage", + LanguageCode: undefined, + Score: undefined + }; + if (output.LanguageCode !== undefined) { + contents.LanguageCode = output.LanguageCode; + } + if (output.Score !== undefined) { + contents.Score = output.Score; + } + return contents; +}; + +const deserializeAws_json1_1DominantLanguageDetectionJobProperties = ( + output: any, + context: __SerdeContext +): DominantLanguageDetectionJobProperties => { + let contents: any = { + __type: "DominantLanguageDetectionJobProperties", + DataAccessRoleArn: undefined, + EndTime: undefined, + InputDataConfig: undefined, + JobId: undefined, + JobName: undefined, + JobStatus: undefined, + Message: undefined, + OutputDataConfig: undefined, + SubmitTime: undefined, + VolumeKmsKeyId: undefined, + VpcConfig: undefined + }; + if (output.DataAccessRoleArn !== undefined) { + contents.DataAccessRoleArn = output.DataAccessRoleArn; + } + if (output.EndTime !== undefined) { + contents.EndTime = new Date( + output.EndTime % 1 != 0 + ? Math.round(output.EndTime * 1000) + : output.EndTime + ); + } + if (output.InputDataConfig !== undefined) { + contents.InputDataConfig = deserializeAws_json1_1InputDataConfig( + output.InputDataConfig, + context + ); + } + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobName !== undefined) { + contents.JobName = output.JobName; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.OutputDataConfig !== undefined) { + contents.OutputDataConfig = deserializeAws_json1_1OutputDataConfig( + output.OutputDataConfig, + context + ); + } + if (output.SubmitTime !== undefined) { + contents.SubmitTime = new Date( + output.SubmitTime % 1 != 0 + ? Math.round(output.SubmitTime * 1000) + : output.SubmitTime + ); + } + if (output.VolumeKmsKeyId !== undefined) { + contents.VolumeKmsKeyId = output.VolumeKmsKeyId; + } + if (output.VpcConfig !== undefined) { + contents.VpcConfig = deserializeAws_json1_1VpcConfig( + output.VpcConfig, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1DominantLanguageDetectionJobPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1DominantLanguageDetectionJobProperties(entry, context) + ); +}; + +const deserializeAws_json1_1EndpointProperties = ( + output: any, + context: __SerdeContext +): EndpointProperties => { + let contents: any = { + __type: "EndpointProperties", + CreationTime: undefined, + CurrentInferenceUnits: undefined, + DesiredInferenceUnits: undefined, + EndpointArn: undefined, + LastModifiedTime: undefined, + Message: undefined, + ModelArn: undefined, + Status: undefined + }; + if (output.CreationTime !== undefined) { + contents.CreationTime = new Date( + output.CreationTime % 1 != 0 + ? Math.round(output.CreationTime * 1000) + : output.CreationTime + ); + } + if (output.CurrentInferenceUnits !== undefined) { + contents.CurrentInferenceUnits = output.CurrentInferenceUnits; + } + if (output.DesiredInferenceUnits !== undefined) { + contents.DesiredInferenceUnits = output.DesiredInferenceUnits; + } + if (output.EndpointArn !== undefined) { + contents.EndpointArn = output.EndpointArn; + } + if (output.LastModifiedTime !== undefined) { + contents.LastModifiedTime = new Date( + output.LastModifiedTime % 1 != 0 + ? Math.round(output.LastModifiedTime * 1000) + : output.LastModifiedTime + ); + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.ModelArn !== undefined) { + contents.ModelArn = output.ModelArn; + } + if (output.Status !== undefined) { + contents.Status = output.Status; + } + return contents; +}; + +const deserializeAws_json1_1EndpointPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1EndpointProperties(entry, context) + ); +}; + +const deserializeAws_json1_1EntitiesDetectionJobProperties = ( + output: any, + context: __SerdeContext +): EntitiesDetectionJobProperties => { + let contents: any = { + __type: "EntitiesDetectionJobProperties", + DataAccessRoleArn: undefined, + EndTime: undefined, + EntityRecognizerArn: undefined, + InputDataConfig: undefined, + JobId: undefined, + JobName: undefined, + JobStatus: undefined, + LanguageCode: undefined, + Message: undefined, + OutputDataConfig: undefined, + SubmitTime: undefined, + VolumeKmsKeyId: undefined, + VpcConfig: undefined + }; + if (output.DataAccessRoleArn !== undefined) { + contents.DataAccessRoleArn = output.DataAccessRoleArn; + } + if (output.EndTime !== undefined) { + contents.EndTime = new Date( + output.EndTime % 1 != 0 + ? Math.round(output.EndTime * 1000) + : output.EndTime + ); + } + if (output.EntityRecognizerArn !== undefined) { + contents.EntityRecognizerArn = output.EntityRecognizerArn; + } + if (output.InputDataConfig !== undefined) { + contents.InputDataConfig = deserializeAws_json1_1InputDataConfig( + output.InputDataConfig, + context + ); + } + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobName !== undefined) { + contents.JobName = output.JobName; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + if (output.LanguageCode !== undefined) { + contents.LanguageCode = output.LanguageCode; + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.OutputDataConfig !== undefined) { + contents.OutputDataConfig = deserializeAws_json1_1OutputDataConfig( + output.OutputDataConfig, + context + ); + } + if (output.SubmitTime !== undefined) { + contents.SubmitTime = new Date( + output.SubmitTime % 1 != 0 + ? Math.round(output.SubmitTime * 1000) + : output.SubmitTime + ); + } + if (output.VolumeKmsKeyId !== undefined) { + contents.VolumeKmsKeyId = output.VolumeKmsKeyId; + } + if (output.VpcConfig !== undefined) { + contents.VpcConfig = deserializeAws_json1_1VpcConfig( + output.VpcConfig, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1EntitiesDetectionJobPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1EntitiesDetectionJobProperties(entry, context) + ); +}; + +const deserializeAws_json1_1Entity = ( + output: any, + context: __SerdeContext +): Entity => { + let contents: any = { + __type: "Entity", + BeginOffset: undefined, + EndOffset: undefined, + Score: undefined, + Text: undefined, + Type: undefined + }; + if (output.BeginOffset !== undefined) { + contents.BeginOffset = output.BeginOffset; + } + if (output.EndOffset !== undefined) { + contents.EndOffset = output.EndOffset; + } + if (output.Score !== undefined) { + contents.Score = output.Score; + } + if (output.Text !== undefined) { + contents.Text = output.Text; + } + if (output.Type !== undefined) { + contents.Type = output.Type; + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerAnnotations = ( + output: any, + context: __SerdeContext +): EntityRecognizerAnnotations => { + let contents: any = { + __type: "EntityRecognizerAnnotations", + S3Uri: undefined + }; + if (output.S3Uri !== undefined) { + contents.S3Uri = output.S3Uri; + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerDocuments = ( + output: any, + context: __SerdeContext +): EntityRecognizerDocuments => { + let contents: any = { + __type: "EntityRecognizerDocuments", + S3Uri: undefined + }; + if (output.S3Uri !== undefined) { + contents.S3Uri = output.S3Uri; + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerEntityList = ( + output: any, + context: __SerdeContext +): EntityRecognizerEntityList => { + let contents: any = { + __type: "EntityRecognizerEntityList", + S3Uri: undefined + }; + if (output.S3Uri !== undefined) { + contents.S3Uri = output.S3Uri; + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerEvaluationMetrics = ( + output: any, + context: __SerdeContext +): EntityRecognizerEvaluationMetrics => { + let contents: any = { + __type: "EntityRecognizerEvaluationMetrics", + F1Score: undefined, + Precision: undefined, + Recall: undefined + }; + if (output.F1Score !== undefined) { + contents.F1Score = output.F1Score; + } + if (output.Precision !== undefined) { + contents.Precision = output.Precision; + } + if (output.Recall !== undefined) { + contents.Recall = output.Recall; + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerInputDataConfig = ( + output: any, + context: __SerdeContext +): EntityRecognizerInputDataConfig => { + let contents: any = { + __type: "EntityRecognizerInputDataConfig", + Annotations: undefined, + Documents: undefined, + EntityList: undefined, + EntityTypes: undefined + }; + if (output.Annotations !== undefined) { + contents.Annotations = deserializeAws_json1_1EntityRecognizerAnnotations( + output.Annotations, + context + ); + } + if (output.Documents !== undefined) { + contents.Documents = deserializeAws_json1_1EntityRecognizerDocuments( + output.Documents, + context + ); + } + if (output.EntityList !== undefined) { + contents.EntityList = deserializeAws_json1_1EntityRecognizerEntityList( + output.EntityList, + context + ); + } + if (output.EntityTypes !== undefined) { + contents.EntityTypes = deserializeAws_json1_1EntityTypesList( + output.EntityTypes, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerMetadata = ( + output: any, + context: __SerdeContext +): EntityRecognizerMetadata => { + let contents: any = { + __type: "EntityRecognizerMetadata", + EntityTypes: undefined, + EvaluationMetrics: undefined, + NumberOfTestDocuments: undefined, + NumberOfTrainedDocuments: undefined + }; + if (output.EntityTypes !== undefined) { + contents.EntityTypes = deserializeAws_json1_1EntityRecognizerMetadataEntityTypesList( + output.EntityTypes, + context + ); + } + if (output.EvaluationMetrics !== undefined) { + contents.EvaluationMetrics = deserializeAws_json1_1EntityRecognizerEvaluationMetrics( + output.EvaluationMetrics, + context + ); + } + if (output.NumberOfTestDocuments !== undefined) { + contents.NumberOfTestDocuments = output.NumberOfTestDocuments; + } + if (output.NumberOfTrainedDocuments !== undefined) { + contents.NumberOfTrainedDocuments = output.NumberOfTrainedDocuments; + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerMetadataEntityTypesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1EntityRecognizerMetadataEntityTypesListItem( + entry, + context + ) + ); +}; + +const deserializeAws_json1_1EntityRecognizerMetadataEntityTypesListItem = ( + output: any, + context: __SerdeContext +): EntityRecognizerMetadataEntityTypesListItem => { + let contents: any = { + __type: "EntityRecognizerMetadataEntityTypesListItem", + EvaluationMetrics: undefined, + NumberOfTrainMentions: undefined, + Type: undefined + }; + if (output.EvaluationMetrics !== undefined) { + contents.EvaluationMetrics = deserializeAws_json1_1EntityTypesEvaluationMetrics( + output.EvaluationMetrics, + context + ); + } + if (output.NumberOfTrainMentions !== undefined) { + contents.NumberOfTrainMentions = output.NumberOfTrainMentions; + } + if (output.Type !== undefined) { + contents.Type = output.Type; + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerProperties = ( + output: any, + context: __SerdeContext +): EntityRecognizerProperties => { + let contents: any = { + __type: "EntityRecognizerProperties", + DataAccessRoleArn: undefined, + EndTime: undefined, + EntityRecognizerArn: undefined, + InputDataConfig: undefined, + LanguageCode: undefined, + Message: undefined, + RecognizerMetadata: undefined, + Status: undefined, + SubmitTime: undefined, + TrainingEndTime: undefined, + TrainingStartTime: undefined, + VolumeKmsKeyId: undefined, + VpcConfig: undefined + }; + if (output.DataAccessRoleArn !== undefined) { + contents.DataAccessRoleArn = output.DataAccessRoleArn; + } + if (output.EndTime !== undefined) { + contents.EndTime = new Date( + output.EndTime % 1 != 0 + ? Math.round(output.EndTime * 1000) + : output.EndTime + ); + } + if (output.EntityRecognizerArn !== undefined) { + contents.EntityRecognizerArn = output.EntityRecognizerArn; + } + if (output.InputDataConfig !== undefined) { + contents.InputDataConfig = deserializeAws_json1_1EntityRecognizerInputDataConfig( + output.InputDataConfig, + context + ); + } + if (output.LanguageCode !== undefined) { + contents.LanguageCode = output.LanguageCode; + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.RecognizerMetadata !== undefined) { + contents.RecognizerMetadata = deserializeAws_json1_1EntityRecognizerMetadata( + output.RecognizerMetadata, + context + ); + } + if (output.Status !== undefined) { + contents.Status = output.Status; + } + if (output.SubmitTime !== undefined) { + contents.SubmitTime = new Date( + output.SubmitTime % 1 != 0 + ? Math.round(output.SubmitTime * 1000) + : output.SubmitTime + ); + } + if (output.TrainingEndTime !== undefined) { + contents.TrainingEndTime = new Date( + output.TrainingEndTime % 1 != 0 + ? Math.round(output.TrainingEndTime * 1000) + : output.TrainingEndTime + ); + } + if (output.TrainingStartTime !== undefined) { + contents.TrainingStartTime = new Date( + output.TrainingStartTime % 1 != 0 + ? Math.round(output.TrainingStartTime * 1000) + : output.TrainingStartTime + ); + } + if (output.VolumeKmsKeyId !== undefined) { + contents.VolumeKmsKeyId = output.VolumeKmsKeyId; + } + if (output.VpcConfig !== undefined) { + contents.VpcConfig = deserializeAws_json1_1VpcConfig( + output.VpcConfig, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1EntityRecognizerPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1EntityRecognizerProperties(entry, context) + ); +}; + +const deserializeAws_json1_1EntityTypesEvaluationMetrics = ( + output: any, + context: __SerdeContext +): EntityTypesEvaluationMetrics => { + let contents: any = { + __type: "EntityTypesEvaluationMetrics", + F1Score: undefined, + Precision: undefined, + Recall: undefined + }; + if (output.F1Score !== undefined) { + contents.F1Score = output.F1Score; + } + if (output.Precision !== undefined) { + contents.Precision = output.Precision; + } + if (output.Recall !== undefined) { + contents.Recall = output.Recall; + } + return contents; +}; + +const deserializeAws_json1_1EntityTypesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1EntityTypesListItem(entry, context) + ); +}; + +const deserializeAws_json1_1EntityTypesListItem = ( + output: any, + context: __SerdeContext +): EntityTypesListItem => { + let contents: any = { + __type: "EntityTypesListItem", + Type: undefined + }; + if (output.Type !== undefined) { + contents.Type = output.Type; + } + return contents; +}; + +const deserializeAws_json1_1InputDataConfig = ( + output: any, + context: __SerdeContext +): InputDataConfig => { + let contents: any = { + __type: "InputDataConfig", + InputFormat: undefined, + S3Uri: undefined + }; + if (output.InputFormat !== undefined) { + contents.InputFormat = output.InputFormat; + } + if (output.S3Uri !== undefined) { + contents.S3Uri = output.S3Uri; + } + return contents; +}; + +const deserializeAws_json1_1InternalServerException = ( + output: any, + context: __SerdeContext +): InternalServerException => { + let contents: any = { + __type: "InternalServerException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1InvalidFilterException = ( + output: any, + context: __SerdeContext +): InvalidFilterException => { + let contents: any = { + __type: "InvalidFilterException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1InvalidRequestException = ( + output: any, + context: __SerdeContext +): InvalidRequestException => { + let contents: any = { + __type: "InvalidRequestException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1JobNotFoundException = ( + output: any, + context: __SerdeContext +): JobNotFoundException => { + let contents: any = { + __type: "JobNotFoundException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1KeyPhrase = ( + output: any, + context: __SerdeContext +): KeyPhrase => { + let contents: any = { + __type: "KeyPhrase", + BeginOffset: undefined, + EndOffset: undefined, + Score: undefined, + Text: undefined + }; + if (output.BeginOffset !== undefined) { + contents.BeginOffset = output.BeginOffset; + } + if (output.EndOffset !== undefined) { + contents.EndOffset = output.EndOffset; + } + if (output.Score !== undefined) { + contents.Score = output.Score; + } + if (output.Text !== undefined) { + contents.Text = output.Text; + } + return contents; +}; + +const deserializeAws_json1_1KeyPhrasesDetectionJobProperties = ( + output: any, + context: __SerdeContext +): KeyPhrasesDetectionJobProperties => { + let contents: any = { + __type: "KeyPhrasesDetectionJobProperties", + DataAccessRoleArn: undefined, + EndTime: undefined, + InputDataConfig: undefined, + JobId: undefined, + JobName: undefined, + JobStatus: undefined, + LanguageCode: undefined, + Message: undefined, + OutputDataConfig: undefined, + SubmitTime: undefined, + VolumeKmsKeyId: undefined, + VpcConfig: undefined + }; + if (output.DataAccessRoleArn !== undefined) { + contents.DataAccessRoleArn = output.DataAccessRoleArn; + } + if (output.EndTime !== undefined) { + contents.EndTime = new Date( + output.EndTime % 1 != 0 + ? Math.round(output.EndTime * 1000) + : output.EndTime + ); + } + if (output.InputDataConfig !== undefined) { + contents.InputDataConfig = deserializeAws_json1_1InputDataConfig( + output.InputDataConfig, + context + ); + } + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobName !== undefined) { + contents.JobName = output.JobName; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + if (output.LanguageCode !== undefined) { + contents.LanguageCode = output.LanguageCode; + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.OutputDataConfig !== undefined) { + contents.OutputDataConfig = deserializeAws_json1_1OutputDataConfig( + output.OutputDataConfig, + context + ); + } + if (output.SubmitTime !== undefined) { + contents.SubmitTime = new Date( + output.SubmitTime % 1 != 0 + ? Math.round(output.SubmitTime * 1000) + : output.SubmitTime + ); + } + if (output.VolumeKmsKeyId !== undefined) { + contents.VolumeKmsKeyId = output.VolumeKmsKeyId; + } + if (output.VpcConfig !== undefined) { + contents.VpcConfig = deserializeAws_json1_1VpcConfig( + output.VpcConfig, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1KeyPhrasesDetectionJobPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1KeyPhrasesDetectionJobProperties(entry, context) + ); +}; + +const deserializeAws_json1_1KmsKeyValidationException = ( + output: any, + context: __SerdeContext +): KmsKeyValidationException => { + let contents: any = { + __type: "KmsKeyValidationException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1ListDocumentClassificationJobsResponse = ( + output: any, + context: __SerdeContext +): ListDocumentClassificationJobsResponse => { + let contents: any = { + __type: "ListDocumentClassificationJobsResponse", + DocumentClassificationJobPropertiesList: undefined, + NextToken: undefined + }; + if (output.DocumentClassificationJobPropertiesList !== undefined) { + contents.DocumentClassificationJobPropertiesList = deserializeAws_json1_1DocumentClassificationJobPropertiesList( + output.DocumentClassificationJobPropertiesList, + context + ); + } + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + return contents; +}; + +const deserializeAws_json1_1ListDocumentClassifiersResponse = ( + output: any, + context: __SerdeContext +): ListDocumentClassifiersResponse => { + let contents: any = { + __type: "ListDocumentClassifiersResponse", + DocumentClassifierPropertiesList: undefined, + NextToken: undefined + }; + if (output.DocumentClassifierPropertiesList !== undefined) { + contents.DocumentClassifierPropertiesList = deserializeAws_json1_1DocumentClassifierPropertiesList( + output.DocumentClassifierPropertiesList, + context + ); + } + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + return contents; +}; + +const deserializeAws_json1_1ListDominantLanguageDetectionJobsResponse = ( + output: any, + context: __SerdeContext +): ListDominantLanguageDetectionJobsResponse => { + let contents: any = { + __type: "ListDominantLanguageDetectionJobsResponse", + DominantLanguageDetectionJobPropertiesList: undefined, + NextToken: undefined + }; + if (output.DominantLanguageDetectionJobPropertiesList !== undefined) { + contents.DominantLanguageDetectionJobPropertiesList = deserializeAws_json1_1DominantLanguageDetectionJobPropertiesList( + output.DominantLanguageDetectionJobPropertiesList, + context + ); + } + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + return contents; +}; + +const deserializeAws_json1_1ListEndpointsResponse = ( + output: any, + context: __SerdeContext +): ListEndpointsResponse => { + let contents: any = { + __type: "ListEndpointsResponse", + EndpointPropertiesList: undefined, + NextToken: undefined + }; + if (output.EndpointPropertiesList !== undefined) { + contents.EndpointPropertiesList = deserializeAws_json1_1EndpointPropertiesList( + output.EndpointPropertiesList, + context + ); + } + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + return contents; +}; + +const deserializeAws_json1_1ListEntitiesDetectionJobsResponse = ( + output: any, + context: __SerdeContext +): ListEntitiesDetectionJobsResponse => { + let contents: any = { + __type: "ListEntitiesDetectionJobsResponse", + EntitiesDetectionJobPropertiesList: undefined, + NextToken: undefined + }; + if (output.EntitiesDetectionJobPropertiesList !== undefined) { + contents.EntitiesDetectionJobPropertiesList = deserializeAws_json1_1EntitiesDetectionJobPropertiesList( + output.EntitiesDetectionJobPropertiesList, + context + ); + } + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + return contents; +}; + +const deserializeAws_json1_1ListEntityRecognizersResponse = ( + output: any, + context: __SerdeContext +): ListEntityRecognizersResponse => { + let contents: any = { + __type: "ListEntityRecognizersResponse", + EntityRecognizerPropertiesList: undefined, + NextToken: undefined + }; + if (output.EntityRecognizerPropertiesList !== undefined) { + contents.EntityRecognizerPropertiesList = deserializeAws_json1_1EntityRecognizerPropertiesList( + output.EntityRecognizerPropertiesList, + context + ); + } + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + return contents; +}; + +const deserializeAws_json1_1ListKeyPhrasesDetectionJobsResponse = ( + output: any, + context: __SerdeContext +): ListKeyPhrasesDetectionJobsResponse => { + let contents: any = { + __type: "ListKeyPhrasesDetectionJobsResponse", + KeyPhrasesDetectionJobPropertiesList: undefined, + NextToken: undefined + }; + if (output.KeyPhrasesDetectionJobPropertiesList !== undefined) { + contents.KeyPhrasesDetectionJobPropertiesList = deserializeAws_json1_1KeyPhrasesDetectionJobPropertiesList( + output.KeyPhrasesDetectionJobPropertiesList, + context + ); + } + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + return contents; +}; + +const deserializeAws_json1_1ListOfClasses = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1DocumentClass(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfDetectDominantLanguageResult = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1BatchDetectDominantLanguageItemResult(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfDetectEntitiesResult = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1BatchDetectEntitiesItemResult(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfDetectKeyPhrasesResult = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1BatchDetectKeyPhrasesItemResult(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfDetectSentimentResult = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1BatchDetectSentimentItemResult(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfDetectSyntaxResult = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1BatchDetectSyntaxItemResult(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfDominantLanguages = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1DominantLanguage(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfEntities = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1Entity(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfKeyPhrases = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1KeyPhrase(entry, context) + ); +}; + +const deserializeAws_json1_1ListOfSyntaxTokens = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1SyntaxToken(entry, context) + ); +}; + +const deserializeAws_json1_1ListSentimentDetectionJobsResponse = ( + output: any, + context: __SerdeContext +): ListSentimentDetectionJobsResponse => { + let contents: any = { + __type: "ListSentimentDetectionJobsResponse", + NextToken: undefined, + SentimentDetectionJobPropertiesList: undefined + }; + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + if (output.SentimentDetectionJobPropertiesList !== undefined) { + contents.SentimentDetectionJobPropertiesList = deserializeAws_json1_1SentimentDetectionJobPropertiesList( + output.SentimentDetectionJobPropertiesList, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1ListTagsForResourceResponse = ( + output: any, + context: __SerdeContext +): ListTagsForResourceResponse => { + let contents: any = { + __type: "ListTagsForResourceResponse", + ResourceArn: undefined, + Tags: undefined + }; + if (output.ResourceArn !== undefined) { + contents.ResourceArn = output.ResourceArn; + } + if (output.Tags !== undefined) { + contents.Tags = deserializeAws_json1_1TagList(output.Tags, context); + } + return contents; +}; + +const deserializeAws_json1_1ListTopicsDetectionJobsResponse = ( + output: any, + context: __SerdeContext +): ListTopicsDetectionJobsResponse => { + let contents: any = { + __type: "ListTopicsDetectionJobsResponse", + NextToken: undefined, + TopicsDetectionJobPropertiesList: undefined + }; + if (output.NextToken !== undefined) { + contents.NextToken = output.NextToken; + } + if (output.TopicsDetectionJobPropertiesList !== undefined) { + contents.TopicsDetectionJobPropertiesList = deserializeAws_json1_1TopicsDetectionJobPropertiesList( + output.TopicsDetectionJobPropertiesList, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1OutputDataConfig = ( + output: any, + context: __SerdeContext +): OutputDataConfig => { + let contents: any = { + __type: "OutputDataConfig", + KmsKeyId: undefined, + S3Uri: undefined + }; + if (output.KmsKeyId !== undefined) { + contents.KmsKeyId = output.KmsKeyId; + } + if (output.S3Uri !== undefined) { + contents.S3Uri = output.S3Uri; + } + return contents; +}; + +const deserializeAws_json1_1PartOfSpeechTag = ( + output: any, + context: __SerdeContext +): PartOfSpeechTag => { + let contents: any = { + __type: "PartOfSpeechTag", + Score: undefined, + Tag: undefined + }; + if (output.Score !== undefined) { + contents.Score = output.Score; + } + if (output.Tag !== undefined) { + contents.Tag = output.Tag; + } + return contents; +}; + +const deserializeAws_json1_1ResourceInUseException = ( + output: any, + context: __SerdeContext +): ResourceInUseException => { + let contents: any = { + __type: "ResourceInUseException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1ResourceLimitExceededException = ( + output: any, + context: __SerdeContext +): ResourceLimitExceededException => { + let contents: any = { + __type: "ResourceLimitExceededException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1ResourceNotFoundException = ( + output: any, + context: __SerdeContext +): ResourceNotFoundException => { + let contents: any = { + __type: "ResourceNotFoundException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1ResourceUnavailableException = ( + output: any, + context: __SerdeContext +): ResourceUnavailableException => { + let contents: any = { + __type: "ResourceUnavailableException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1SecurityGroupIds = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => entry); +}; + +const deserializeAws_json1_1SentimentDetectionJobProperties = ( + output: any, + context: __SerdeContext +): SentimentDetectionJobProperties => { + let contents: any = { + __type: "SentimentDetectionJobProperties", + DataAccessRoleArn: undefined, + EndTime: undefined, + InputDataConfig: undefined, + JobId: undefined, + JobName: undefined, + JobStatus: undefined, + LanguageCode: undefined, + Message: undefined, + OutputDataConfig: undefined, + SubmitTime: undefined, + VolumeKmsKeyId: undefined, + VpcConfig: undefined + }; + if (output.DataAccessRoleArn !== undefined) { + contents.DataAccessRoleArn = output.DataAccessRoleArn; + } + if (output.EndTime !== undefined) { + contents.EndTime = new Date( + output.EndTime % 1 != 0 + ? Math.round(output.EndTime * 1000) + : output.EndTime + ); + } + if (output.InputDataConfig !== undefined) { + contents.InputDataConfig = deserializeAws_json1_1InputDataConfig( + output.InputDataConfig, + context + ); + } + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobName !== undefined) { + contents.JobName = output.JobName; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + if (output.LanguageCode !== undefined) { + contents.LanguageCode = output.LanguageCode; + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.OutputDataConfig !== undefined) { + contents.OutputDataConfig = deserializeAws_json1_1OutputDataConfig( + output.OutputDataConfig, + context + ); + } + if (output.SubmitTime !== undefined) { + contents.SubmitTime = new Date( + output.SubmitTime % 1 != 0 + ? Math.round(output.SubmitTime * 1000) + : output.SubmitTime + ); + } + if (output.VolumeKmsKeyId !== undefined) { + contents.VolumeKmsKeyId = output.VolumeKmsKeyId; + } + if (output.VpcConfig !== undefined) { + contents.VpcConfig = deserializeAws_json1_1VpcConfig( + output.VpcConfig, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1SentimentDetectionJobPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1SentimentDetectionJobProperties(entry, context) + ); +}; + +const deserializeAws_json1_1SentimentScore = ( + output: any, + context: __SerdeContext +): SentimentScore => { + let contents: any = { + __type: "SentimentScore", + Mixed: undefined, + Negative: undefined, + Neutral: undefined, + Positive: undefined + }; + if (output.Mixed !== undefined) { + contents.Mixed = output.Mixed; + } + if (output.Negative !== undefined) { + contents.Negative = output.Negative; + } + if (output.Neutral !== undefined) { + contents.Neutral = output.Neutral; + } + if (output.Positive !== undefined) { + contents.Positive = output.Positive; + } + return contents; +}; + +const deserializeAws_json1_1StartDocumentClassificationJobResponse = ( + output: any, + context: __SerdeContext +): StartDocumentClassificationJobResponse => { + let contents: any = { + __type: "StartDocumentClassificationJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StartDominantLanguageDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StartDominantLanguageDetectionJobResponse => { + let contents: any = { + __type: "StartDominantLanguageDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StartEntitiesDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StartEntitiesDetectionJobResponse => { + let contents: any = { + __type: "StartEntitiesDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StartKeyPhrasesDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StartKeyPhrasesDetectionJobResponse => { + let contents: any = { + __type: "StartKeyPhrasesDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StartSentimentDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StartSentimentDetectionJobResponse => { + let contents: any = { + __type: "StartSentimentDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StartTopicsDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StartTopicsDetectionJobResponse => { + let contents: any = { + __type: "StartTopicsDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StopDominantLanguageDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StopDominantLanguageDetectionJobResponse => { + let contents: any = { + __type: "StopDominantLanguageDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StopEntitiesDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StopEntitiesDetectionJobResponse => { + let contents: any = { + __type: "StopEntitiesDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StopKeyPhrasesDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StopKeyPhrasesDetectionJobResponse => { + let contents: any = { + __type: "StopKeyPhrasesDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StopSentimentDetectionJobResponse = ( + output: any, + context: __SerdeContext +): StopSentimentDetectionJobResponse => { + let contents: any = { + __type: "StopSentimentDetectionJobResponse", + JobId: undefined, + JobStatus: undefined + }; + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + return contents; +}; + +const deserializeAws_json1_1StopTrainingDocumentClassifierResponse = ( + output: any, + context: __SerdeContext +): StopTrainingDocumentClassifierResponse => { + let contents: any = { + __type: "StopTrainingDocumentClassifierResponse" + }; + return contents; +}; + +const deserializeAws_json1_1StopTrainingEntityRecognizerResponse = ( + output: any, + context: __SerdeContext +): StopTrainingEntityRecognizerResponse => { + let contents: any = { + __type: "StopTrainingEntityRecognizerResponse" + }; + return contents; +}; + +const deserializeAws_json1_1Subnets = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => entry); +}; + +const deserializeAws_json1_1SyntaxToken = ( + output: any, + context: __SerdeContext +): SyntaxToken => { + let contents: any = { + __type: "SyntaxToken", + BeginOffset: undefined, + EndOffset: undefined, + PartOfSpeech: undefined, + Text: undefined, + TokenId: undefined + }; + if (output.BeginOffset !== undefined) { + contents.BeginOffset = output.BeginOffset; + } + if (output.EndOffset !== undefined) { + contents.EndOffset = output.EndOffset; + } + if (output.PartOfSpeech !== undefined) { + contents.PartOfSpeech = deserializeAws_json1_1PartOfSpeechTag( + output.PartOfSpeech, + context + ); + } + if (output.Text !== undefined) { + contents.Text = output.Text; + } + if (output.TokenId !== undefined) { + contents.TokenId = output.TokenId; + } + return contents; +}; + +const deserializeAws_json1_1Tag = ( + output: any, + context: __SerdeContext +): Tag => { + let contents: any = { + __type: "Tag", + Key: undefined, + Value: undefined + }; + if (output.Key !== undefined) { + contents.Key = output.Key; + } + if (output.Value !== undefined) { + contents.Value = output.Value; + } + return contents; +}; + +const deserializeAws_json1_1TagList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1Tag(entry, context) + ); +}; + +const deserializeAws_json1_1TagResourceResponse = ( + output: any, + context: __SerdeContext +): TagResourceResponse => { + let contents: any = { + __type: "TagResourceResponse" + }; + return contents; +}; + +const deserializeAws_json1_1TextSizeLimitExceededException = ( + output: any, + context: __SerdeContext +): TextSizeLimitExceededException => { + let contents: any = { + __type: "TextSizeLimitExceededException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1TooManyRequestsException = ( + output: any, + context: __SerdeContext +): TooManyRequestsException => { + let contents: any = { + __type: "TooManyRequestsException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1TooManyTagKeysException = ( + output: any, + context: __SerdeContext +): TooManyTagKeysException => { + let contents: any = { + __type: "TooManyTagKeysException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1TooManyTagsException = ( + output: any, + context: __SerdeContext +): TooManyTagsException => { + let contents: any = { + __type: "TooManyTagsException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1TopicsDetectionJobProperties = ( + output: any, + context: __SerdeContext +): TopicsDetectionJobProperties => { + let contents: any = { + __type: "TopicsDetectionJobProperties", + DataAccessRoleArn: undefined, + EndTime: undefined, + InputDataConfig: undefined, + JobId: undefined, + JobName: undefined, + JobStatus: undefined, + Message: undefined, + NumberOfTopics: undefined, + OutputDataConfig: undefined, + SubmitTime: undefined, + VolumeKmsKeyId: undefined, + VpcConfig: undefined + }; + if (output.DataAccessRoleArn !== undefined) { + contents.DataAccessRoleArn = output.DataAccessRoleArn; + } + if (output.EndTime !== undefined) { + contents.EndTime = new Date( + output.EndTime % 1 != 0 + ? Math.round(output.EndTime * 1000) + : output.EndTime + ); + } + if (output.InputDataConfig !== undefined) { + contents.InputDataConfig = deserializeAws_json1_1InputDataConfig( + output.InputDataConfig, + context + ); + } + if (output.JobId !== undefined) { + contents.JobId = output.JobId; + } + if (output.JobName !== undefined) { + contents.JobName = output.JobName; + } + if (output.JobStatus !== undefined) { + contents.JobStatus = output.JobStatus; + } + if (output.Message !== undefined) { + contents.Message = output.Message; + } + if (output.NumberOfTopics !== undefined) { + contents.NumberOfTopics = output.NumberOfTopics; + } + if (output.OutputDataConfig !== undefined) { + contents.OutputDataConfig = deserializeAws_json1_1OutputDataConfig( + output.OutputDataConfig, + context + ); + } + if (output.SubmitTime !== undefined) { + contents.SubmitTime = new Date( + output.SubmitTime % 1 != 0 + ? Math.round(output.SubmitTime * 1000) + : output.SubmitTime + ); + } + if (output.VolumeKmsKeyId !== undefined) { + contents.VolumeKmsKeyId = output.VolumeKmsKeyId; + } + if (output.VpcConfig !== undefined) { + contents.VpcConfig = deserializeAws_json1_1VpcConfig( + output.VpcConfig, + context + ); + } + return contents; +}; + +const deserializeAws_json1_1TopicsDetectionJobPropertiesList = ( + output: any, + context: __SerdeContext +): Array => { + return (output || []).map((entry: any) => + deserializeAws_json1_1TopicsDetectionJobProperties(entry, context) + ); +}; + +const deserializeAws_json1_1UnsupportedLanguageException = ( + output: any, + context: __SerdeContext +): UnsupportedLanguageException => { + let contents: any = { + __type: "UnsupportedLanguageException", + Message: undefined + }; + if (output.Message !== undefined) { + contents.Message = output.Message; + } + return contents; +}; + +const deserializeAws_json1_1UntagResourceResponse = ( + output: any, + context: __SerdeContext +): UntagResourceResponse => { + let contents: any = { + __type: "UntagResourceResponse" + }; + return contents; +}; + +const deserializeAws_json1_1UpdateEndpointResponse = ( + output: any, + context: __SerdeContext +): UpdateEndpointResponse => { + let contents: any = { + __type: "UpdateEndpointResponse" + }; + return contents; +}; + +const deserializeAws_json1_1VpcConfig = ( + output: any, + context: __SerdeContext +): VpcConfig => { + let contents: any = { + __type: "VpcConfig", + SecurityGroupIds: undefined, + Subnets: undefined + }; + if (output.SecurityGroupIds !== undefined) { + contents.SecurityGroupIds = deserializeAws_json1_1SecurityGroupIds( + output.SecurityGroupIds, + context + ); + } + if (output.Subnets !== undefined) { + contents.Subnets = deserializeAws_json1_1Subnets(output.Subnets, context); + } + return contents; +}; + +const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ + httpStatusCode: output.statusCode, + httpHeaders: output.headers, + requestId: output.headers["x-amzn-requestid"] +}); + +const parseBody = (streamBody: any, context: __SerdeContext): any => { + return context.streamCollector(streamBody).then((body: any) => { + const encoded = context.utf8Encoder(body); + if (encoded.length) { + return JSON.parse(encoded); + } + return {}; + }); +}; diff --git a/clients/client-comprehend/runtimeConfig.browser.ts b/clients/client-comprehend/runtimeConfig.browser.ts new file mode 100644 index 000000000000..4f524c49f674 --- /dev/null +++ b/clients/client-comprehend/runtimeConfig.browser.ts @@ -0,0 +1,30 @@ +import { invalidFunction } from "@aws-sdk/invalid-dependency"; +import { Sha256 } from "@aws-crypto/sha256-browser"; +import { FetchHttpHandler } from "@aws-sdk/fetch-http-handler"; +import { parseUrl } from "@aws-sdk/url-parser-browser"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-browser"; +import { streamCollector } from "@aws-sdk/stream-collector-browser"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser"; +import { name, version } from "./package.json"; +import { ClientDefaults } from "./ComprehendClient"; +import { ClientSharedValues } from "./runtimeConfig.shared"; + +export const ClientDefaultValues: Required = { + ...ClientSharedValues, + requestHandler: new FetchHttpHandler(), + sha256: Sha256, + urlParser: parseUrl, + bodyLengthChecker: calculateBodyLength, + streamCollector, + base64Decoder: fromBase64, + base64Encoder: toBase64, + utf8Decoder: fromUtf8, + utf8Encoder: toUtf8, + defaultUserAgent: defaultUserAgent(name, version), + runtime: "browser", + signingName: "comprehend", + credentialDefaultProvider: invalidFunction("Credential is missing") as any, + regionDefaultProvider: invalidFunction("Region is missing") as any +}; diff --git a/clients/client-comprehend/runtimeConfig.shared.ts b/clients/client-comprehend/runtimeConfig.shared.ts new file mode 100644 index 000000000000..3534bc408026 --- /dev/null +++ b/clients/client-comprehend/runtimeConfig.shared.ts @@ -0,0 +1,7 @@ +import { defaultRegionInfoProvider } from "./endpoints"; + +export const ClientSharedValues = { + apiVersion: "2017-11-27", + signingName: "comprehend", + regionInfoProvider: defaultRegionInfoProvider +}; diff --git a/clients/client-comprehend/runtimeConfig.ts b/clients/client-comprehend/runtimeConfig.ts new file mode 100644 index 000000000000..1f353bc662d2 --- /dev/null +++ b/clients/client-comprehend/runtimeConfig.ts @@ -0,0 +1,31 @@ +import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; +import { defaultProvider as regionDefaultProvider } from "@aws-sdk/region-provider"; +import { Hash } from "@aws-sdk/hash-node"; +import { NodeHttpHandler } from "@aws-sdk/node-http-handler"; +import { parseUrl } from "@aws-sdk/url-parser-node"; +import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; +import { streamCollector } from "@aws-sdk/stream-collector-node"; +import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; +import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; +import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; +import { name, version } from "./package.json"; +import { ClientDefaults } from "./ComprehendClient"; +import { ClientSharedValues } from "./runtimeConfig.shared"; + +export const ClientDefaultValues: Required = { + ...ClientSharedValues, + requestHandler: new NodeHttpHandler(), + sha256: Hash.bind(null, "sha256"), + urlParser: parseUrl, + bodyLengthChecker: calculateBodyLength, + streamCollector, + base64Decoder: fromBase64, + base64Encoder: toBase64, + utf8Decoder: fromUtf8, + utf8Encoder: toUtf8, + defaultUserAgent: defaultUserAgent(name, version), + runtime: "node", + signingName: "comprehend", + credentialDefaultProvider, + regionDefaultProvider +}; diff --git a/clients/client-comprehend/tsconfig.es.json b/clients/client-comprehend/tsconfig.es.json new file mode 100644 index 000000000000..9add6a7c2445 --- /dev/null +++ b/clients/client-comprehend/tsconfig.es.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "target": "es5", + "module": "esnext", + "moduleResolution": "node", + "declaration": false, + "declarationDir": null, + "lib": [ + "dom", + "es5", + "es2015.promise", + "es2015.collection", + "es2015.iterable", + "es2015.symbol.wellknown" + ], + "outDir": "dist/es" + } +} diff --git a/clients/client-comprehend/tsconfig.json b/clients/client-comprehend/tsconfig.json new file mode 100644 index 000000000000..ca2fadc08187 --- /dev/null +++ b/clients/client-comprehend/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "alwaysStrict": true, + "target": "es2017", + "module": "commonjs", + "declaration": true, + "strict": true, + "sourceMap": true, + "downlevelIteration": true, + "importHelpers": true, + "noEmitHelpers": true, + "incremental": true, + "resolveJsonModule": true, + "declarationDir": "./types", + "outDir": "dist/cjs" + }, + "typedocOptions": { + "exclude": "**/node_modules/**", + "excludedNotExported": true, + "excludePrivate": true, + "hideGenerator": true, + "ignoreCompilerErrors": true, + "mode": "file", + "out": "./docs", + "plugin": "@aws-sdk/client-documentation-generator" + } +}