text:
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: comprehend
using AWS.Compat
using AWS.UUIDs
"""
    BatchDetectDominantLanguage()

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.

# Required Parameters
- `TextList`: A list containing the text of the input documents. The list can contain a maximum of 25 documents. Each document should contain at least 20 characters and must contain fewer than 5,000 bytes of UTF-8 encoded characters.

"""

batch_detect_dominant_language(TextList; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectDominantLanguage", Dict{String, Any}("TextList"=>TextList); aws_config=aws_config)
batch_detect_dominant_language(TextList, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectDominantLanguage", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("TextList"=>TextList), args)); aws_config=aws_config)

"""
    BatchDetectEntities()

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

# Required Parameters
- `LanguageCode`: 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.
- `TextList`: A list containing the text of the input documents. The list can contain a maximum of 25 documents. Each document must contain fewer than 5,000 bytes of UTF-8 encoded characters.

"""

batch_detect_entities(LanguageCode, TextList; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectEntities", Dict{String, Any}("LanguageCode"=>LanguageCode, "TextList"=>TextList); aws_config=aws_config)
batch_detect_entities(LanguageCode, TextList, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectEntities", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("LanguageCode"=>LanguageCode, "TextList"=>TextList), args)); aws_config=aws_config)

"""
    BatchDetectKeyPhrases()

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

# Required Parameters
- `LanguageCode`: 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.
- `TextList`: A list containing the text of the input documents. The list can contain a maximum of 25 documents. Each document must contain fewer that 5,000 bytes of UTF-8 encoded characters.

"""

batch_detect_key_phrases(LanguageCode, TextList; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectKeyPhrases", Dict{String, Any}("LanguageCode"=>LanguageCode, "TextList"=>TextList); aws_config=aws_config)
batch_detect_key_phrases(LanguageCode, TextList, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectKeyPhrases", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("LanguageCode"=>LanguageCode, "TextList"=>TextList), args)); aws_config=aws_config)

"""
    BatchDetectSentiment()

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

# Required Parameters
- `LanguageCode`: 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.
- `TextList`: A list containing the text of the input documents. The list can contain a maximum of 25 documents. Each document must contain fewer that 5,000 bytes of UTF-8 encoded characters.

"""

batch_detect_sentiment(LanguageCode, TextList; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectSentiment", Dict{String, Any}("LanguageCode"=>LanguageCode, "TextList"=>TextList); aws_config=aws_config)
batch_detect_sentiment(LanguageCode, TextList, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectSentiment", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("LanguageCode"=>LanguageCode, "TextList"=>TextList), args)); aws_config=aws_config)

"""
    BatchDetectSyntax()

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.

# Required Parameters
- `LanguageCode`: 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.
- `TextList`: A list containing the text of the input documents. The list can contain a maximum of 25 documents. Each document must contain fewer that 5,000 bytes of UTF-8 encoded characters.

"""

batch_detect_syntax(LanguageCode, TextList; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectSyntax", Dict{String, Any}("LanguageCode"=>LanguageCode, "TextList"=>TextList); aws_config=aws_config)
batch_detect_syntax(LanguageCode, TextList, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("BatchDetectSyntax", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("LanguageCode"=>LanguageCode, "TextList"=>TextList), args)); aws_config=aws_config)

"""
    ClassifyDocument()

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.

# Required Parameters
- `EndpointArn`: The Amazon Resource Number (ARN) of the endpoint.
- `Text`: The document text to be analyzed.

"""

classify_document(EndpointArn, Text; aws_config::AWSConfig=global_aws_config()) = comprehend("ClassifyDocument", Dict{String, Any}("EndpointArn"=>EndpointArn, "Text"=>Text); aws_config=aws_config)
classify_document(EndpointArn, Text, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ClassifyDocument", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EndpointArn"=>EndpointArn, "Text"=>Text), args)); aws_config=aws_config)

"""
    CreateDocumentClassifier()

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.

# Required Parameters
- `DataAccessRoleArn`: The Amazon Resource Name (ARN) of the AWS Identity and Management (IAM) role that grants Amazon Comprehend read access to your input data.
- `DocumentClassifierName`: The name of the document classifier.
- `InputDataConfig`: Specifies the format and location of the input data for the job.
- `LanguageCode`: 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.

# Optional Parameters
- `ClientRequestToken`: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
- `Mode`: Indicates the mode in which the classifier will be trained. The classifier can be trained in multi-class mode, which identifies one and only one class for each document, or multi-label mode, which identifies one or more labels for each document. In multi-label mode, multiple labels for an individual document are separated by a delimiter. The default delimiter between labels is a pipe (|).
- `OutputDataConfig`: Enables the addition of output results configuration parameters for custom classifier jobs.
- `Tags`: 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.
- `VolumeKmsKeyId`: 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\"
- `VpcConfig`: 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.
"""

create_document_classifier(DataAccessRoleArn, DocumentClassifierName, InputDataConfig, LanguageCode; aws_config::AWSConfig=global_aws_config()) = comprehend("CreateDocumentClassifier", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "DocumentClassifierName"=>DocumentClassifierName, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
create_document_classifier(DataAccessRoleArn, DocumentClassifierName, InputDataConfig, LanguageCode, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("CreateDocumentClassifier", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "DocumentClassifierName"=>DocumentClassifierName, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    CreateEndpoint()

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

# Required Parameters
- `DesiredInferenceUnits`:  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.
- `EndpointName`: This is the descriptive suffix that becomes part of the EndpointArn used for all subsequent requests to this resource.
- `ModelArn`: The Amazon Resource Number (ARN) of the model to which the endpoint will be attached.

# Optional Parameters
- `ClientRequestToken`: An idempotency token provided by the customer. If this token matches a previous endpoint creation request, Amazon Comprehend will not return a ResourceInUseException.
- `Tags`: 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.
"""

create_endpoint(DesiredInferenceUnits, EndpointName, ModelArn; aws_config::AWSConfig=global_aws_config()) = comprehend("CreateEndpoint", Dict{String, Any}("DesiredInferenceUnits"=>DesiredInferenceUnits, "EndpointName"=>EndpointName, "ModelArn"=>ModelArn, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
create_endpoint(DesiredInferenceUnits, EndpointName, ModelArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("CreateEndpoint", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DesiredInferenceUnits"=>DesiredInferenceUnits, "EndpointName"=>EndpointName, "ModelArn"=>ModelArn, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    CreateEntityRecognizer()

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

# Required Parameters
- `DataAccessRoleArn`: The Amazon Resource Name (ARN) of the AWS Identity and Management (IAM) role that grants Amazon Comprehend read access to your input data.
- `InputDataConfig`: 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.
- `LanguageCode`:  You can specify any of the following languages supported by Amazon Comprehend: English (\"en\"), Spanish (\"es\"), French (\"fr\"), Italian (\"it\"), German (\"de\"), or Portuguese (\"pt\"). All documents must be in the same language.
- `RecognizerName`: 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.

# Optional Parameters
- `ClientRequestToken`:  A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
- `Tags`: 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.
- `VolumeKmsKeyId`: 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\"
- `VpcConfig`: 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.
"""

create_entity_recognizer(DataAccessRoleArn, InputDataConfig, LanguageCode, RecognizerName; aws_config::AWSConfig=global_aws_config()) = comprehend("CreateEntityRecognizer", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "RecognizerName"=>RecognizerName, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
create_entity_recognizer(DataAccessRoleArn, InputDataConfig, LanguageCode, RecognizerName, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("CreateEntityRecognizer", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "RecognizerName"=>RecognizerName, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    DeleteDocumentClassifier()

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.

# Required Parameters
- `DocumentClassifierArn`: The Amazon Resource Name (ARN) that identifies the document classifier.

"""

delete_document_classifier(DocumentClassifierArn; aws_config::AWSConfig=global_aws_config()) = comprehend("DeleteDocumentClassifier", Dict{String, Any}("DocumentClassifierArn"=>DocumentClassifierArn); aws_config=aws_config)
delete_document_classifier(DocumentClassifierArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DeleteDocumentClassifier", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DocumentClassifierArn"=>DocumentClassifierArn), args)); aws_config=aws_config)

"""
    DeleteEndpoint()

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

# Required Parameters
- `EndpointArn`: The Amazon Resource Number (ARN) of the endpoint being deleted.

"""

delete_endpoint(EndpointArn; aws_config::AWSConfig=global_aws_config()) = comprehend("DeleteEndpoint", Dict{String, Any}("EndpointArn"=>EndpointArn); aws_config=aws_config)
delete_endpoint(EndpointArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DeleteEndpoint", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EndpointArn"=>EndpointArn), args)); aws_config=aws_config)

"""
    DeleteEntityRecognizer()

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.

# Required Parameters
- `EntityRecognizerArn`: The Amazon Resource Name (ARN) that identifies the entity recognizer.

"""

delete_entity_recognizer(EntityRecognizerArn; aws_config::AWSConfig=global_aws_config()) = comprehend("DeleteEntityRecognizer", Dict{String, Any}("EntityRecognizerArn"=>EntityRecognizerArn); aws_config=aws_config)
delete_entity_recognizer(EntityRecognizerArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DeleteEntityRecognizer", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EntityRecognizerArn"=>EntityRecognizerArn), args)); aws_config=aws_config)

"""
    DescribeDocumentClassificationJob()

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

# Required Parameters
- `JobId`: The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its response.

"""

describe_document_classification_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeDocumentClassificationJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
describe_document_classification_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeDocumentClassificationJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    DescribeDocumentClassifier()

Gets the properties associated with a document classifier.

# Required Parameters
- `DocumentClassifierArn`: The Amazon Resource Name (ARN) that identifies the document classifier. The operation returns this identifier in its response.

"""

describe_document_classifier(DocumentClassifierArn; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeDocumentClassifier", Dict{String, Any}("DocumentClassifierArn"=>DocumentClassifierArn); aws_config=aws_config)
describe_document_classifier(DocumentClassifierArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeDocumentClassifier", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DocumentClassifierArn"=>DocumentClassifierArn), args)); aws_config=aws_config)

"""
    DescribeDominantLanguageDetectionJob()

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

# Required Parameters
- `JobId`: The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its response.

"""

describe_dominant_language_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeDominantLanguageDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
describe_dominant_language_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeDominantLanguageDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    DescribeEndpoint()

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

# Required Parameters
- `EndpointArn`: The Amazon Resource Number (ARN) of the endpoint being described.

"""

describe_endpoint(EndpointArn; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeEndpoint", Dict{String, Any}("EndpointArn"=>EndpointArn); aws_config=aws_config)
describe_endpoint(EndpointArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeEndpoint", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EndpointArn"=>EndpointArn), args)); aws_config=aws_config)

"""
    DescribeEntitiesDetectionJob()

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

# Required Parameters
- `JobId`: The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its response.

"""

describe_entities_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeEntitiesDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
describe_entities_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeEntitiesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    DescribeEntityRecognizer()

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

# Required Parameters
- `EntityRecognizerArn`: The Amazon Resource Name (ARN) that identifies the entity recognizer.

"""

describe_entity_recognizer(EntityRecognizerArn; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeEntityRecognizer", Dict{String, Any}("EntityRecognizerArn"=>EntityRecognizerArn); aws_config=aws_config)
describe_entity_recognizer(EntityRecognizerArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeEntityRecognizer", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EntityRecognizerArn"=>EntityRecognizerArn), args)); aws_config=aws_config)

"""
    DescribeKeyPhrasesDetectionJob()

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

# Required Parameters
- `JobId`: The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its response.

"""

describe_key_phrases_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeKeyPhrasesDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
describe_key_phrases_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeKeyPhrasesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    DescribePiiEntitiesDetectionJob()

Gets the properties associated with a PII entities detection job. For example, you can use this operation to get the job status.

# Required Parameters
- `JobId`: The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its response.

"""

describe_pii_entities_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribePiiEntitiesDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
describe_pii_entities_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribePiiEntitiesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    DescribeSentimentDetectionJob()

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

# Required Parameters
- `JobId`: The identifier that Amazon Comprehend generated for the job. The operation returns this identifier in its response.

"""

describe_sentiment_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeSentimentDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
describe_sentiment_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeSentimentDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    DescribeTopicsDetectionJob()

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

# Required Parameters
- `JobId`: The identifier assigned by the user to the detection job.

"""

describe_topics_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeTopicsDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
describe_topics_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DescribeTopicsDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    DetectDominantLanguage()

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

# Required Parameters
- `Text`: A UTF-8 text string. Each string should contain at least 20 characters and must contain fewer that 5,000 bytes of UTF-8 encoded characters.

"""

detect_dominant_language(Text; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectDominantLanguage", Dict{String, Any}("Text"=>Text); aws_config=aws_config)
detect_dominant_language(Text, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectDominantLanguage", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Text"=>Text), args)); aws_config=aws_config)

"""
    DetectEntities()

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

# Required Parameters
- `Text`: A UTF-8 text string. Each string must contain fewer that 5,000 bytes of UTF-8 encoded characters.

# Optional Parameters
- `EndpointArn`: The Amazon Resource Name of an endpoint that is associated with a custom entity recognition model. Provide an endpoint if you want to detect entities by using your own custom model instead of the default model that is used by Amazon Comprehend. If you specify an endpoint, Amazon Comprehend uses the language of your custom model, and it ignores any language code that you provide in your request.
- `LanguageCode`: 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. If your request includes the endpoint for a custom entity recognition model, Amazon Comprehend uses the language of your custom model, and it ignores any language code that you specify here.
"""

detect_entities(Text; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectEntities", Dict{String, Any}("Text"=>Text); aws_config=aws_config)
detect_entities(Text, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectEntities", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("Text"=>Text), args)); aws_config=aws_config)

"""
    DetectKeyPhrases()

Detects the key noun phrases found in the text.

# Required Parameters
- `LanguageCode`: 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.
- `Text`: A UTF-8 text string. Each string must contain fewer that 5,000 bytes of UTF-8 encoded characters.

"""

detect_key_phrases(LanguageCode, Text; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectKeyPhrases", Dict{String, Any}("LanguageCode"=>LanguageCode, "Text"=>Text); aws_config=aws_config)
detect_key_phrases(LanguageCode, Text, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectKeyPhrases", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("LanguageCode"=>LanguageCode, "Text"=>Text), args)); aws_config=aws_config)

"""
    DetectPiiEntities()

Inspects the input text for entities that contain personally identifiable information (PII) and returns information about them.

# Required Parameters
- `LanguageCode`: The language of the input documents.
- `Text`: A UTF-8 text string. Each string must contain fewer that 5,000 bytes of UTF-8 encoded characters.

"""

detect_pii_entities(LanguageCode, Text; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectPiiEntities", Dict{String, Any}("LanguageCode"=>LanguageCode, "Text"=>Text); aws_config=aws_config)
detect_pii_entities(LanguageCode, Text, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectPiiEntities", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("LanguageCode"=>LanguageCode, "Text"=>Text), args)); aws_config=aws_config)

"""
    DetectSentiment()

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

# Required Parameters
- `LanguageCode`: 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.
- `Text`: A UTF-8 text string. Each string must contain fewer that 5,000 bytes of UTF-8 encoded characters.

"""

detect_sentiment(LanguageCode, Text; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectSentiment", Dict{String, Any}("LanguageCode"=>LanguageCode, "Text"=>Text); aws_config=aws_config)
detect_sentiment(LanguageCode, Text, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectSentiment", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("LanguageCode"=>LanguageCode, "Text"=>Text), args)); aws_config=aws_config)

"""
    DetectSyntax()

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

# Required Parameters
- `LanguageCode`: 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\").
- `Text`: A UTF-8 string. Each string must contain fewer that 5,000 bytes of UTF encoded characters.

"""

detect_syntax(LanguageCode, Text; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectSyntax", Dict{String, Any}("LanguageCode"=>LanguageCode, "Text"=>Text); aws_config=aws_config)
detect_syntax(LanguageCode, Text, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("DetectSyntax", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("LanguageCode"=>LanguageCode, "Text"=>Text), args)); aws_config=aws_config)

"""
    ListDocumentClassificationJobs()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_document_classification_jobs(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListDocumentClassificationJobs"; aws_config=aws_config)
list_document_classification_jobs(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListDocumentClassificationJobs", args; aws_config=aws_config)

"""
    ListDocumentClassifiers()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_document_classifiers(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListDocumentClassifiers"; aws_config=aws_config)
list_document_classifiers(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListDocumentClassifiers", args; aws_config=aws_config)

"""
    ListDominantLanguageDetectionJobs()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_dominant_language_detection_jobs(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListDominantLanguageDetectionJobs"; aws_config=aws_config)
list_dominant_language_detection_jobs(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListDominantLanguageDetectionJobs", args; aws_config=aws_config)

"""
    ListEndpoints()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_endpoints(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListEndpoints"; aws_config=aws_config)
list_endpoints(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListEndpoints", args; aws_config=aws_config)

"""
    ListEntitiesDetectionJobs()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_entities_detection_jobs(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListEntitiesDetectionJobs"; aws_config=aws_config)
list_entities_detection_jobs(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListEntitiesDetectionJobs", args; aws_config=aws_config)

"""
    ListEntityRecognizers()

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.

# Optional Parameters
- `Filter`: Filters the list of entities returned. You can filter on Status, SubmitTimeBefore, or SubmitTimeAfter. You can only set one filter at a time.
- `MaxResults`:  The maximum number of results to return on each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_entity_recognizers(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListEntityRecognizers"; aws_config=aws_config)
list_entity_recognizers(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListEntityRecognizers", args; aws_config=aws_config)

"""
    ListKeyPhrasesDetectionJobs()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_key_phrases_detection_jobs(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListKeyPhrasesDetectionJobs"; aws_config=aws_config)
list_key_phrases_detection_jobs(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListKeyPhrasesDetectionJobs", args; aws_config=aws_config)

"""
    ListPiiEntitiesDetectionJobs()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page.
- `NextToken`: Identifies the next page of results to return.
"""

list_pii_entities_detection_jobs(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListPiiEntitiesDetectionJobs"; aws_config=aws_config)
list_pii_entities_detection_jobs(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListPiiEntitiesDetectionJobs", args; aws_config=aws_config)

"""
    ListSentimentDetectionJobs()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_sentiment_detection_jobs(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListSentimentDetectionJobs"; aws_config=aws_config)
list_sentiment_detection_jobs(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListSentimentDetectionJobs", args; aws_config=aws_config)

"""
    ListTagsForResource()

Lists all tags associated with a given Amazon Comprehend resource.

# Required Parameters
- `ResourceArn`: The Amazon Resource Name (ARN) of the given Amazon Comprehend resource you are querying.

"""

list_tags_for_resource(ResourceArn; aws_config::AWSConfig=global_aws_config()) = comprehend("ListTagsForResource", Dict{String, Any}("ResourceArn"=>ResourceArn); aws_config=aws_config)
list_tags_for_resource(ResourceArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListTagsForResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn), args)); aws_config=aws_config)

"""
    ListTopicsDetectionJobs()

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

# Optional Parameters
- `Filter`: 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.
- `MaxResults`: The maximum number of results to return in each page. The default is 100.
- `NextToken`: Identifies the next page of results to return.
"""

list_topics_detection_jobs(; aws_config::AWSConfig=global_aws_config()) = comprehend("ListTopicsDetectionJobs"; aws_config=aws_config)
list_topics_detection_jobs(args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("ListTopicsDetectionJobs", args; aws_config=aws_config)

"""
    StartDocumentClassificationJob()

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

# Required Parameters
- `DataAccessRoleArn`: The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend read access to your input data.
- `DocumentClassifierArn`: The Amazon Resource Name (ARN) of the document classifier to use to process the job.
- `InputDataConfig`: Specifies the format and location of the input data for the job.
- `OutputDataConfig`: Specifies where to send the output files.

# Optional Parameters
- `ClientRequestToken`: A unique identifier for the request. If you do not set the client request token, Amazon Comprehend generates one.
- `JobName`: The identifier of the job.
- `VolumeKmsKeyId`: 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\"
- `VpcConfig`: 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.
"""

start_document_classification_job(DataAccessRoleArn, DocumentClassifierArn, InputDataConfig, OutputDataConfig; aws_config::AWSConfig=global_aws_config()) = comprehend("StartDocumentClassificationJob", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "DocumentClassifierArn"=>DocumentClassifierArn, "InputDataConfig"=>InputDataConfig, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
start_document_classification_job(DataAccessRoleArn, DocumentClassifierArn, InputDataConfig, OutputDataConfig, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StartDocumentClassificationJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "DocumentClassifierArn"=>DocumentClassifierArn, "InputDataConfig"=>InputDataConfig, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    StartDominantLanguageDetectionJob()

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

# Required Parameters
- `DataAccessRoleArn`: 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.
- `InputDataConfig`: Specifies the format and location of the input data for the job.
- `OutputDataConfig`: Specifies where to send the output files.

# Optional Parameters
- `ClientRequestToken`: A unique identifier for the request. If you do not set the client request token, Amazon Comprehend generates one.
- `JobName`: An identifier for the job.
- `VolumeKmsKeyId`: 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\"
- `VpcConfig`: 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.
"""

start_dominant_language_detection_job(DataAccessRoleArn, InputDataConfig, OutputDataConfig; aws_config::AWSConfig=global_aws_config()) = comprehend("StartDominantLanguageDetectionJob", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
start_dominant_language_detection_job(DataAccessRoleArn, InputDataConfig, OutputDataConfig, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StartDominantLanguageDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    StartEntitiesDetectionJob()

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.

# Required Parameters
- `DataAccessRoleArn`: 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.
- `InputDataConfig`: Specifies the format and location of the input data for the job.
- `LanguageCode`: 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.
- `OutputDataConfig`: Specifies where to send the output files.

# Optional Parameters
- `ClientRequestToken`: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
- `EntityRecognizerArn`: 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.
- `JobName`: The identifier of the job.
- `VolumeKmsKeyId`: 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\"
- `VpcConfig`: 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.
"""

start_entities_detection_job(DataAccessRoleArn, InputDataConfig, LanguageCode, OutputDataConfig; aws_config::AWSConfig=global_aws_config()) = comprehend("StartEntitiesDetectionJob", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
start_entities_detection_job(DataAccessRoleArn, InputDataConfig, LanguageCode, OutputDataConfig, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StartEntitiesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    StartKeyPhrasesDetectionJob()

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

# Required Parameters
- `DataAccessRoleArn`: 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.
- `InputDataConfig`: Specifies the format and location of the input data for the job.
- `LanguageCode`: 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.
- `OutputDataConfig`: Specifies where to send the output files.

# Optional Parameters
- `ClientRequestToken`: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
- `JobName`: The identifier of the job.
- `VolumeKmsKeyId`: 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\"
- `VpcConfig`:  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.
"""

start_key_phrases_detection_job(DataAccessRoleArn, InputDataConfig, LanguageCode, OutputDataConfig; aws_config::AWSConfig=global_aws_config()) = comprehend("StartKeyPhrasesDetectionJob", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
start_key_phrases_detection_job(DataAccessRoleArn, InputDataConfig, LanguageCode, OutputDataConfig, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StartKeyPhrasesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    StartPiiEntitiesDetectionJob()

Starts an asynchronous PII entity detection job for a collection of documents.

# Required Parameters
- `DataAccessRoleArn`: The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that grants Amazon Comprehend read access to your input data.
- `InputDataConfig`: The input properties for a PII entities detection job.
- `LanguageCode`: The language of the input documents.
- `Mode`: Specifies whether the output provides the locations (offsets) of PII entities or a file in which PII entities are redacted.
- `OutputDataConfig`: Provides conﬁguration parameters for the output of PII entity detection jobs.

# Optional Parameters
- `ClientRequestToken`: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
- `JobName`: The identifier of the job.
- `RedactionConfig`: Provides configuration parameters for PII entity redaction. This parameter is required if you set the Mode parameter to ONLY_REDACTION. In that case, you must provide a RedactionConfig definition that includes the PiiEntityTypes parameter.
"""

start_pii_entities_detection_job(DataAccessRoleArn, InputDataConfig, LanguageCode, Mode, OutputDataConfig; aws_config::AWSConfig=global_aws_config()) = comprehend("StartPiiEntitiesDetectionJob", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "Mode"=>Mode, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
start_pii_entities_detection_job(DataAccessRoleArn, InputDataConfig, LanguageCode, Mode, OutputDataConfig, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StartPiiEntitiesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "Mode"=>Mode, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    StartSentimentDetectionJob()

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

# Required Parameters
- `DataAccessRoleArn`: 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.
- `InputDataConfig`: Specifies the format and location of the input data for the job.
- `LanguageCode`: 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.
- `OutputDataConfig`: Specifies where to send the output files.

# Optional Parameters
- `ClientRequestToken`: A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
- `JobName`: The identifier of the job.
- `VolumeKmsKeyId`: 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\"
- `VpcConfig`: 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.
"""

start_sentiment_detection_job(DataAccessRoleArn, InputDataConfig, LanguageCode, OutputDataConfig; aws_config::AWSConfig=global_aws_config()) = comprehend("StartSentimentDetectionJob", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
start_sentiment_detection_job(DataAccessRoleArn, InputDataConfig, LanguageCode, OutputDataConfig, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StartSentimentDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "LanguageCode"=>LanguageCode, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    StartTopicsDetectionJob()

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

# Required Parameters
- `DataAccessRoleArn`: 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.
- `InputDataConfig`: Specifies the format and location of the input data for the job.
- `OutputDataConfig`: 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

# Optional Parameters
- `ClientRequestToken`: A unique identifier for the request. If you do not set the client request token, Amazon Comprehend generates one.
- `JobName`: The identifier of the job.
- `NumberOfTopics`: The number of topics to detect.
- `VolumeKmsKeyId`: 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\"
- `VpcConfig`: 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.
"""

start_topics_detection_job(DataAccessRoleArn, InputDataConfig, OutputDataConfig; aws_config::AWSConfig=global_aws_config()) = comprehend("StartTopicsDetectionJob", Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())); aws_config=aws_config)
start_topics_detection_job(DataAccessRoleArn, InputDataConfig, OutputDataConfig, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StartTopicsDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DataAccessRoleArn"=>DataAccessRoleArn, "InputDataConfig"=>InputDataConfig, "OutputDataConfig"=>OutputDataConfig, "ClientRequestToken"=>string(uuid4())), args)); aws_config=aws_config)

"""
    StopDominantLanguageDetectionJob()

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.

# Required Parameters
- `JobId`: The identifier of the dominant language detection job to stop.

"""

stop_dominant_language_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("StopDominantLanguageDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
stop_dominant_language_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StopDominantLanguageDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    StopEntitiesDetectionJob()

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.

# Required Parameters
- `JobId`: The identifier of the entities detection job to stop.

"""

stop_entities_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("StopEntitiesDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
stop_entities_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StopEntitiesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    StopKeyPhrasesDetectionJob()

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.

# Required Parameters
- `JobId`: The identifier of the key phrases detection job to stop.

"""

stop_key_phrases_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("StopKeyPhrasesDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
stop_key_phrases_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StopKeyPhrasesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    StopPiiEntitiesDetectionJob()

Stops a PII entities detection job in progress.

# Required Parameters
- `JobId`: The identifier of the PII entities detection job to stop.

"""

stop_pii_entities_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("StopPiiEntitiesDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
stop_pii_entities_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StopPiiEntitiesDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    StopSentimentDetectionJob()

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.

# Required Parameters
- `JobId`: The identifier of the sentiment detection job to stop.

"""

stop_sentiment_detection_job(JobId; aws_config::AWSConfig=global_aws_config()) = comprehend("StopSentimentDetectionJob", Dict{String, Any}("JobId"=>JobId); aws_config=aws_config)
stop_sentiment_detection_job(JobId, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StopSentimentDetectionJob", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("JobId"=>JobId), args)); aws_config=aws_config)

"""
    StopTrainingDocumentClassifier()

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.

# Required Parameters
- `DocumentClassifierArn`: The Amazon Resource Name (ARN) that identifies the document classifier currently being trained.

"""

stop_training_document_classifier(DocumentClassifierArn; aws_config::AWSConfig=global_aws_config()) = comprehend("StopTrainingDocumentClassifier", Dict{String, Any}("DocumentClassifierArn"=>DocumentClassifierArn); aws_config=aws_config)
stop_training_document_classifier(DocumentClassifierArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StopTrainingDocumentClassifier", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DocumentClassifierArn"=>DocumentClassifierArn), args)); aws_config=aws_config)

"""
    StopTrainingEntityRecognizer()

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.

# Required Parameters
- `EntityRecognizerArn`: The Amazon Resource Name (ARN) that identifies the entity recognizer currently being trained.

"""

stop_training_entity_recognizer(EntityRecognizerArn; aws_config::AWSConfig=global_aws_config()) = comprehend("StopTrainingEntityRecognizer", Dict{String, Any}("EntityRecognizerArn"=>EntityRecognizerArn); aws_config=aws_config)
stop_training_entity_recognizer(EntityRecognizerArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("StopTrainingEntityRecognizer", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("EntityRecognizerArn"=>EntityRecognizerArn), args)); aws_config=aws_config)

"""
    TagResource()

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.

# Required Parameters
- `ResourceArn`: The Amazon Resource Name (ARN) of the given Amazon Comprehend resource to which you want to associate the tags.
- `Tags`: 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.

"""

tag_resource(ResourceArn, Tags; aws_config::AWSConfig=global_aws_config()) = comprehend("TagResource", Dict{String, Any}("ResourceArn"=>ResourceArn, "Tags"=>Tags); aws_config=aws_config)
tag_resource(ResourceArn, Tags, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("TagResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn, "Tags"=>Tags), args)); aws_config=aws_config)

"""
    UntagResource()

Removes a specific tag associated with an Amazon Comprehend resource.

# Required Parameters
- `ResourceArn`:  The Amazon Resource Name (ARN) of the given Amazon Comprehend resource from which you want to remove the tags.
- `TagKeys`: 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.

"""

untag_resource(ResourceArn, TagKeys; aws_config::AWSConfig=global_aws_config()) = comprehend("UntagResource", Dict{String, Any}("ResourceArn"=>ResourceArn, "TagKeys"=>TagKeys); aws_config=aws_config)
untag_resource(ResourceArn, TagKeys, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("UntagResource", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("ResourceArn"=>ResourceArn, "TagKeys"=>TagKeys), args)); aws_config=aws_config)

"""
    UpdateEndpoint()

Updates information about the specified endpoint.

# Required Parameters
- `DesiredInferenceUnits`:  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.
- `EndpointArn`: The Amazon Resource Number (ARN) of the endpoint being updated.

"""

update_endpoint(DesiredInferenceUnits, EndpointArn; aws_config::AWSConfig=global_aws_config()) = comprehend("UpdateEndpoint", Dict{String, Any}("DesiredInferenceUnits"=>DesiredInferenceUnits, "EndpointArn"=>EndpointArn); aws_config=aws_config)
update_endpoint(DesiredInferenceUnits, EndpointArn, args::AbstractDict{String, <:Any}; aws_config::AWSConfig=global_aws_config()) = comprehend("UpdateEndpoint", Dict{String, Any}(mergewith(_merge, Dict{String, Any}("DesiredInferenceUnits"=>DesiredInferenceUnits, "EndpointArn"=>EndpointArn), args)); aws_config=aws_config)


text:
using ModelingToolkit: operation
# Method of lines discretization scheme
struct MOLFiniteDifference{T} <: DiffEqBase.AbstractDiscretization
    dxs::T
    order::Int
    MOLFiniteDifference(args...;order=2) = new{typeof(args[1])}(args[1],order)
end

function throw_bc_err(bc)
    throw(BoundaryConditionError(
        "Could not read boundary condition '$(bc.lhs) ~ $(bc.rhs)'"
    ))
end
# Get boundary conditions from an array
# The returned boundary conditions will be the three coefficients (α, β, γ)
# for a RobinBC of the form α*u(0) + β*u'(0) = γ
# These are created automatically from the form of the boundary condition that is
# passed, i.e.
# u(t, 0) ~ γ                           ---> (1, 0, γ)
# Dx(u(t, 0)) ~ γ                       ---> (0, 1, γ)
# α * u(t, 0)) + β * Dx(u(t, 0)) ~ γ    ---> (α, β, γ)
# In general, all of α, β, and γ could be Expr (i.e. functions of t)
function get_bcs(bcs,tdomain,domain)
    lhs_deriv_depvars_bcs = Dict()
    num_bcs = size(bcs,1)
    for i = 1:num_bcs
        lhs = bcs[i].lhs
        # Extract the variable from the lhs
        if operation(lhs) isa Sym
            # Dirichlet boundary condition
            var = nameof(operation(lhs))
            α = 1.0
            β = 0.0
            bc_args = lhs.args
        elseif operation(lhs) isa Differential
            # Neumann boundary condition
            # Check that we don't have a second-order derivative in the
            # boundary condition, by checking that the argument is a Sym
            @assert operation(lhs.args[1]) isa Sym throw_bc_err(bcs[i])
            var = nameof(operation(lhs.args[1]))
            α = 0.0
            β = 1.0
            bc_args = lhs.args[1].args
        elseif operation(lhs) isa typeof(+)
            # Robin boundary condition
            lhs_l, lhs_r = lhs.args
            # Left side of the expression should be Sym or α * Sym
            if operation(lhs_l) isa Sym
                α = 1.0
                var_l = nameof(operation(lhs_l))
                bc_args_l = lhs_l.args
            elseif operation(lhs_l) isa typeof(*)
                α = lhs_l.args[1]
                # Convert α to a Float64 if it is an Int, leave unchanged otherwise
                α = α isa Int ? Float64(α) : α
                @assert operation(lhs_l.args[2]) isa Sym throw_bc_err(bcs[i])
                var_l = nameof(operation(lhs_l.args[2]))
                bc_args_l = lhs_l.args[2].args
            else
                throw_bc_err(bcs[i])
            end
            # Right side of the expression should be Differential or β * Differential
            if operation(lhs_r) isa Differential
                # Check that we don't have a second-order derivative in the
                # boundary condition
                @assert operation(lhs_r.args[1]) isa Sym throw_bc_err(bcs[i])
                β = 1.0
                var_r = nameof(operation(lhs_r.args[1]))
                bc_args_r = lhs_r.args[1].args
            elseif operation(lhs_r) isa typeof(*)
                β = lhs_r.args[1]
                # Convert β to a Float64 if it is an Int, leave unchanged otherwise
                β = β isa Int ? Float64(β) : β
                # Check that the bc is a derivative
                @assert operation(lhs_r.args[2]) isa Differential throw_bc_err(bcs[i])
                # But not second order (argument should be a Sym)
                @assert operation(lhs_r.args[2].args[1]) isa Sym throw_bc_err(bcs[i])
                var_r = nameof(operation(lhs_r.args[2].args[1]))
                bc_args_r = lhs_r.args[2].args[1].args
            else
                throw_bc_err(bcs[i])
            end
            # Check var and bc_args are the same in lhs and rhs, and if so assign
            # the unique value
            @assert var_l == var_r throw(BoundaryConditionError(
                "mismatched variables '$var_l' and '$var_r' "
                * "in Robin BC '$(bcs[i].lhs) ~ $(bcs[i].rhs)'"
            ))
            var = var_l
            @assert bc_args_l == bc_args_r throw(BoundaryConditionError(
                "mismatched args $bc_args_l and $bc_args_r "
                * "in Robin BC '$(bcs[i].lhs) ~ $(bcs[i].rhs)'"
            ))
            bc_args = bc_args_l
        else
            throw_bc_err(bcs[i])
        end
        if !haskey(lhs_deriv_depvars_bcs,var)
            # Initialize dict of boundary conditions for this variable
            lhs_deriv_depvars_bcs[var] = Dict()
        end
        # Create key
        if isequal(bc_args[1],tdomain.lower) # u(t=0,x)
            key = "ic"
        elseif isequal(bc_args[2],domain.lower) # u(t,x=x_init)
            key = "left bc"
        elseif isequal(bc_args[2],domain.upper) # u(t,x=x_final)
            key = "right bc"
        else
            throw(BoundaryConditionError(
                "Boundary condition '$(bcs[i].lhs) ~ $(bcs[i].rhs)' could not be read. "
                * "BCs should be applied at t=$(tdomain.lower), "
                * "x=$(domain.lower), or x=$(domain.upper)"
            ))
        end
        # Create value
        γ = toexpr(bcs[i].rhs)
        # Assign
        if key == "ic"
            # Initial conditions always take the form u(0, x) ~ γ
            lhs_deriv_depvars_bcs[var][key] = γ
        else
            # Boundary conditions can be more general
            lhs_deriv_depvars_bcs[var][key] = (toexpr(α), toexpr(β), γ)
        end
    end
    # Check each variable got all boundary conditions
    for var in keys(lhs_deriv_depvars_bcs)
        for key in ["ic", "left bc", "right bc"]
            if !haskey(lhs_deriv_depvars_bcs[var], key)
                throw(BoundaryConditionError("missing $key for $var"))
            end
        end
    end
    return lhs_deriv_depvars_bcs
end

# Recursively traverses the input expression (rhs), replacing derivatives by
# finite difference schemes. It returns a time dependent expression (expr)
# that will be evaluated in the "f" ODE function (in DiffEqBase.discretize),
# Note: 'non-derived' dependent variables are inserted into the differential equations
#       E.g., Dx(u(t,x))=v(t,x)*Dx(u(t,x)), v(t,x)=t*x
#            =>  Dx(u(t,x))=t*x*Dx(u(t,x))

function discretize_2(input,deriv_order,approx_order,dx,X,len_of_indep_vars,
                      deriv_var,dep_var_idx,indep_var_idx)
    if !(input isa ModelingToolkit.Symbolic)
        return :($(input))
    else
        if input isa Sym || (input isa Term && operation(input) isa Sym)
            expr = :(0.0)
            var = nameof(input isa Sym ? input : operation(input))
            if haskey(indep_var_idx,var) # ind. var.
                if var != :(t)
                    i = indep_var_idx[var]
                    expr = :($X[$i][2:$len_of_indep_vars[$i]-1])
                else
                    expr = :(t)
                end
            else # dep. var.
                # TODO: time and cross derivatives terms
                i = indep_var_idx[deriv_var[1]]
                j = dep_var_idx[var]
                if deriv_order == 0
                    expr = :(u[:,$j])
                elseif deriv_order == 1
                    # TODO: approx_order and forward/backward should be
                    #       input parameters of each derivative
                    approx_order = 1
                    L = UpwindDifference(deriv_order,approx_order,dx[i],len_of_indep_vars[i]-2,-1)
                    expr = :(-1*($L*Q[$j]*u[:,$j]))
                elseif deriv_order == 2
                    L = CenteredDifference(deriv_order,approx_order,dx[i],len_of_indep_vars[i]-2)
                    expr = :($L*Q[$j]*u[:,$j])
                end
            end
            return expr
        elseif input isa Term && operation(input) isa Differential
            var = nameof(input.op.x)
            push!(deriv_var,var)
            return discretize_2(input.args[1],deriv_order+1,approx_order,dx,X,
                                len_of_indep_vars,deriv_var,dep_var_idx,indep_var_idx)
        else
            name = nameof(operation(input))
            if size(input.args,1) == 1
                aux = discretize_2(input.args[1],deriv_order,approx_order,dx,X,
                                   len_of_indep_vars,deriv_var,dep_var_idx,indep_var_idx)
                return :(broadcast($name, $aux))
            else
                aux_1 = discretize_2(input.args[1],deriv_order,approx_order,dx,X,
                                     len_of_indep_vars,deriv_var,dep_var_idx,indep_var_idx)
                aux_2 = discretize_2(input.args[2],deriv_order,approx_order,dx,X,
                                     len_of_indep_vars,deriv_var,dep_var_idx,indep_var_idx)
                return :(broadcast($name, $aux_1, $aux_2))
            end
        end
    end
end

# Convert a PDE problem into an ODE problem
function DiffEqBase.discretize(pdesys::PDESystem,discretization::MOLFiniteDifference)

    # TODO: discretize the following cases
    #
    #   1) PDE System
    #        1.a) Transient
    #                There is more than one indep. variable, including  't'
    #                E.g., du/dt = d2u/dx2 + d2u/dy2 + f(t,x,y)
    #        1.b) Stationary
    #                There is more than one indep. variable, 't' is not included
    #                E.g., 0 = d2u/dx2 + d2u/dy2 + f(x,y)
    #   2) ODE System
    #        't' is the only independent variable
    #        The ODESystem is packed inside a PDESystem
    #        E.g., du/dt = f(t)
    #
    #   Note: regarding input format, lhs must be "du/dt" or "0".
    #

    # The following code deals with 1.a case for 1-D,
    # i.e., only considering 't' and 'x'.

    ### Declare and define independent-variable data structures ###############

    tdomain = 0.0
    indep_var_idx = Dict()
    num_indep_vars = size(pdesys.domain,1)
    domain = Array{Any}(undef,num_indep_vars)
    dx = Array{Any}(undef,num_indep_vars)
    X = Array{Any}(undef,num_indep_vars)
    len_of_indep_vars = Array{Any}(undef,num_indep_vars)
    k = 0
    for i = 1:num_indep_vars
        var = nameof(pdesys.domain[i].variables)
        indep_var_idx[var] = i
        domain[i] = pdesys.domain[i].domain
        if var != :(t)
            dx[i] = discretization.dxs[i-k]
            X[i] = domain[i].lower:dx[i]:domain[i].upper
            len_of_indep_vars[i] = size(X[i],1)
        else
            dx[i] = 0.0
            X[i] = 0.0
            len_of_indep_vars[i] = 0.0
            tdomain = pdesys.domain[1].domain
            @assert tdomain isa IntervalDomain
            k = 1
        end
    end

    ### Declare and define dependent-variable data structures #################

    # TODO: specify order for each derivative
    approx_order = discretization.order

    lhs_deriv_depvars = Dict()
    dep_var_idx = Dict()
    dep_var_disc = Dict() # expressions evaluated in the ODE function (f)

    # if there is only one equation
    if pdesys.eq isa Equation
        eqs = [pdesys.eq]
    else
        eqs = pdesys.eq
    end
    num_dep_vars = size(eqs,1)
    for j = 1:num_dep_vars
        input = eqs[j].lhs
        op = operation(input)
        if op isa Sym
            var = nameof(op)
        else #var isa Differential
            var = nameof(operation(input.args[1]))
            lhs_deriv_depvars[var] = j
        end
        dep_var_idx[var] = j
    end
    for (var,j) in dep_var_idx
        aux = discretize_2( eqs[j].rhs,0,approx_order,dx,X,len_of_indep_vars,
                            [],dep_var_idx,indep_var_idx)
        dep_var_disc[var] = @RuntimeGeneratedFunction(:((Q,u,t) -> $aux))
    end

    ### Declare and define boundary conditions ################################

    # TODO: extend to Neumann BCs and Robin BCs
    lhs_deriv_depvars_bcs = get_bcs(pdesys.bcs,tdomain,domain[2])
    u_ic = Array{Float64}(undef,len_of_indep_vars[2]-2,num_dep_vars)
    robin_bc_func = Array{Any}(undef,num_dep_vars)
    Q = Array{RobinBC}(undef,num_dep_vars)

    for var in keys(dep_var_idx)
        j = dep_var_idx[var]
        bcs = lhs_deriv_depvars_bcs[var]

        # Initial condition depends on space but not time
        ic = @RuntimeGeneratedFunction(:(x -> $(bcs["ic"])))
        u_ic[:,j] = ic.(X[2][2:len_of_indep_vars[2]-1])

        # Boundary conditions depend on time and so will be evaluated at t within the
        # ODE function for the discretized PDE (below)
        # We use @RuntimeGeneratedFunction to do this efficiently
        αl, βl, γl = bcs["left bc"]
        αr, βr, γr = bcs["right bc"]
        # Right now there is only one independent variable, so dx is always dx[2]
        # i.e. the spatial variable
        robin_bc_func[j] = @RuntimeGeneratedFunction(:(t -> begin
            RobinBC(($(αl), $(βl), $(γl)), ($(αr), $(βr), $(γr)), $(dx[2]))
        end))
    end

    ### Define the discretized PDE as an ODE function #########################

    function f(du,u,p,t)

        # Boundary conditions can vary with respect to time (but not space)
        for j in 1:num_dep_vars
            Q[j] = robin_bc_func[j](t)
        end

        for (var,disc) in dep_var_disc
            j = dep_var_idx[var]
            res = disc(Q,u,t)
            if haskey(lhs_deriv_depvars,var)
                du[:,j] = res
            else
                u[:,j] .= res
            end
        end

    end

    # Return problem ##########################################################
    # The second entry, robin_bc_func, is stored as the "extrapolation" in the
    # PDEProblem. Since this can in general be time-dependent, it must be evaluated
    # at the correct time when used, e.g.
    #   prob.extrapolation[1](t[i])*sol[:,1,i]
    return PDEProblem(
        ODEProblem(f,u_ic,(tdomain.lower,tdomain.upper),nothing),
        robin_bc_func,
        X
    )
end

ext: jl