/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.comprehend.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Creates a new document classifier that you can use to categorize documents. * To create a classifier, you provide a set of training documents that are * labeled with the categories that you want to use. For more information, see * Training classifier models in the Comprehend Developer Guide. *

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

* The name of the document classifier. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*/ private String documentClassifierName; /** *

* The version name given to the newly created classifier. Version names can * have a maximum of 256 characters. Alphanumeric characters, hyphens (-) * and underscores (_) are allowed. The version name must be unique among * all models with the same classifier name in the Amazon Web Services * account/Amazon Web Services Region. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*/ private String versionName; /** *

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

*

* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
*/ private String dataAccessRoleArn; /** *

* Tags to associate with the document classifier. 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. *

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

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

*/ private DocumentClassifierInputDataConfig inputDataConfig; /** *

* Specifies the location for the output files from a custom classifier job. * This parameter is required for a request that creates a native classifier * model. *

*/ private DocumentClassifierOutputDataConfig outputDataConfig; /** *

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

*

* Constraints:
* Length: 1 - 64
* Pattern: ^[a-zA-Z0-9-]+$
*/ private String clientRequestToken; /** *

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

*

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

* ID for the Amazon Web Services 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: *

* *

* Constraints:
* Length: - 2048
* Pattern: ^\p{ASCII}+$
*/ private String volumeKmsKeyId; /** *

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

*/ private VpcConfig vpcConfig; /** *

* 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 (|). *

*

* Constraints:
* Allowed Values: MULTI_CLASS, MULTI_LABEL */ private String mode; /** *

* ID for the KMS key that Amazon Comprehend uses to encrypt trained custom * models. The ModelKmsKeyId can be either of the following formats: *

* *

* Constraints:
* Length: - 2048
* Pattern: ^\p{ASCII}+$
*/ private String modelKmsKeyId; /** *

* The resource-based policy to attach to your custom document classifier * model. You can use this policy to allow another Amazon Web Services * account to import your custom model. *

*

* Provide your policy as a JSON body that you enter as a UTF-8 encoded * string without line breaks. To provide valid JSON, enclose the attribute * names and values in double quotes. If the JSON body is also enclosed in * double quotes, then you must escape the double quotes that are inside the * policy: *

*

* "{\"attribute\": \"value\", \"attribute\": [\"value\"]}" *

*

* To avoid escaping quotes, you can use single quotes to enclose the policy * and double quotes to enclose the JSON names and values: *

*

* '{"attribute": "value", "attribute": ["value"]}' *

*

* Constraints:
* Length: 1 - 20000
* Pattern: [ -\u00FF]+
*/ private String modelPolicy; /** *

* The name of the document classifier. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
* * @return

* The name of the document classifier. *

*/ public String getDocumentClassifierName() { return documentClassifierName; } /** *

* The name of the document classifier. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
* * @param documentClassifierName

* The name of the document classifier. *

*/ public void setDocumentClassifierName(String documentClassifierName) { this.documentClassifierName = documentClassifierName; } /** *

* The name of the document classifier. *

*

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

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
* * @param documentClassifierName

* The name of the document classifier. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withDocumentClassifierName(String documentClassifierName) { this.documentClassifierName = documentClassifierName; return this; } /** *

* The version name given to the newly created classifier. Version names can * have a maximum of 256 characters. Alphanumeric characters, hyphens (-) * and underscores (_) are allowed. The version name must be unique among * all models with the same classifier name in the Amazon Web Services * account/Amazon Web Services Region. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
* * @return

* The version name given to the newly created classifier. Version * names can have a maximum of 256 characters. Alphanumeric * characters, hyphens (-) and underscores (_) are allowed. The * version name must be unique among all models with the same * classifier name in the Amazon Web Services account/Amazon Web * Services Region. *

*/ public String getVersionName() { return versionName; } /** *

* The version name given to the newly created classifier. Version names can * have a maximum of 256 characters. Alphanumeric characters, hyphens (-) * and underscores (_) are allowed. The version name must be unique among * all models with the same classifier name in the Amazon Web Services * account/Amazon Web Services Region. *

*

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
* * @param versionName

* The version name given to the newly created classifier. * Version names can have a maximum of 256 characters. * Alphanumeric characters, hyphens (-) and underscores (_) are * allowed. The version name must be unique among all models with * the same classifier name in the Amazon Web Services * account/Amazon Web Services Region. *

*/ public void setVersionName(String versionName) { this.versionName = versionName; } /** *

* The version name given to the newly created classifier. Version names can * have a maximum of 256 characters. Alphanumeric characters, hyphens (-) * and underscores (_) are allowed. The version name must be unique among * all models with the same classifier name in the Amazon Web Services * account/Amazon Web Services Region. *

*

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

* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
* * @param versionName

* The version name given to the newly created classifier. * Version names can have a maximum of 256 characters. * Alphanumeric characters, hyphens (-) and underscores (_) are * allowed. The version name must be unique among all models with * the same classifier name in the Amazon Web Services * account/Amazon Web Services Region. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withVersionName(String versionName) { this.versionName = versionName; return this; } /** *

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

*

* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
* * @return

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

*/ public String getDataAccessRoleArn() { return dataAccessRoleArn; } /** *

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

*

* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
* * @param dataAccessRoleArn

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

*/ public void setDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; } /** *

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

*

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

* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
* * @param dataAccessRoleArn

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

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; return this; } /** *

* Tags to associate with the document classifier. 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. *

* * @return

* Tags to associate with the document classifier. 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 java.util.List getTags() { return tags; } /** *

* Tags to associate with the document classifier. 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. *

* * @param tags

* Tags to associate with the document classifier. 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 void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* Tags to associate with the document classifier. 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. *

*

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

* Tags to associate with the document classifier. 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. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withTags(Tag... tags) { if (getTags() == null) { this.tags = new java.util.ArrayList(tags.length); } for (Tag value : tags) { this.tags.add(value); } return this; } /** *

* Tags to associate with the document classifier. 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. *

*

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

* Tags to associate with the document classifier. 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. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withTags(java.util.Collection tags) { setTags(tags); return this; } /** *

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

* * @return

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

*/ public DocumentClassifierInputDataConfig getInputDataConfig() { return inputDataConfig; } /** *

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

* * @param inputDataConfig

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

*/ public void setInputDataConfig(DocumentClassifierInputDataConfig inputDataConfig) { this.inputDataConfig = inputDataConfig; } /** *

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

*

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

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

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withInputDataConfig( DocumentClassifierInputDataConfig inputDataConfig) { this.inputDataConfig = inputDataConfig; return this; } /** *

* Specifies the location for the output files from a custom classifier job. * This parameter is required for a request that creates a native classifier * model. *

* * @return

* Specifies the location for the output files from a custom * classifier job. This parameter is required for a request that * creates a native classifier model. *

*/ public DocumentClassifierOutputDataConfig getOutputDataConfig() { return outputDataConfig; } /** *

* Specifies the location for the output files from a custom classifier job. * This parameter is required for a request that creates a native classifier * model. *

* * @param outputDataConfig

* Specifies the location for the output files from a custom * classifier job. This parameter is required for a request that * creates a native classifier model. *

*/ public void setOutputDataConfig(DocumentClassifierOutputDataConfig outputDataConfig) { this.outputDataConfig = outputDataConfig; } /** *

* Specifies the location for the output files from a custom classifier job. * This parameter is required for a request that creates a native classifier * model. *

*

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

* Specifies the location for the output files from a custom * classifier job. This parameter is required for a request that * creates a native classifier model. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withOutputDataConfig( DocumentClassifierOutputDataConfig outputDataConfig) { this.outputDataConfig = outputDataConfig; return this; } /** *

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

*

* Constraints:
* Length: 1 - 64
* Pattern: ^[a-zA-Z0-9-]+$
* * @return

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

*/ public String getClientRequestToken() { return clientRequestToken; } /** *

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

*

* Constraints:
* Length: 1 - 64
* Pattern: ^[a-zA-Z0-9-]+$
* * @param clientRequestToken

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

*/ public void setClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; } /** *

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

*

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

* Constraints:
* Length: 1 - 64
* Pattern: ^[a-zA-Z0-9-]+$
* * @param clientRequestToken

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

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; return this; } /** *

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

*

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

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

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

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

*

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

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

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

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

*

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

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

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

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

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

*

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

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

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

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

*

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

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

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

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

* ID for the Amazon Web Services 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" *

    *
  • *
*

* Constraints:
* Length: - 2048
* Pattern: ^\p{ASCII}+$
* * @return

* ID for the Amazon Web Services 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" *

    *
  • *
*/ public String getVolumeKmsKeyId() { return volumeKmsKeyId; } /** *

* ID for the Amazon Web Services 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" *

    *
  • *
*

* Constraints:
* Length: - 2048
* Pattern: ^\p{ASCII}+$
* * @param volumeKmsKeyId

* ID for the Amazon Web Services 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" *

    *
  • *
*/ public void setVolumeKmsKeyId(String volumeKmsKeyId) { this.volumeKmsKeyId = volumeKmsKeyId; } /** *

* ID for the Amazon Web Services 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" *

    *
  • *
*

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

* Constraints:
* Length: - 2048
* Pattern: ^\p{ASCII}+$
* * @param volumeKmsKeyId

* ID for the Amazon Web Services 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" *

    *
  • *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withVolumeKmsKeyId(String volumeKmsKeyId) { this.volumeKmsKeyId = volumeKmsKeyId; return this; } /** *

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

* * @return

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

*/ public VpcConfig getVpcConfig() { return 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. *

* * @param 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. *

*/ public void setVpcConfig(VpcConfig vpcConfig) { this.vpcConfig = 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. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param 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. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withVpcConfig(VpcConfig vpcConfig) { this.vpcConfig = vpcConfig; return this; } /** *

* 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 (|). *

*

* Constraints:
* Allowed Values: MULTI_CLASS, MULTI_LABEL * * @return

* 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 (|). *

* @see DocumentClassifierMode */ public String getMode() { return 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 (|). *

*

* Constraints:
* Allowed Values: MULTI_CLASS, MULTI_LABEL * * @param 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 (|). *

* @see DocumentClassifierMode */ public void setMode(String mode) { this.mode = 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 (|). *

*

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

* Constraints:
* Allowed Values: MULTI_CLASS, MULTI_LABEL * * @param 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 (|). *

* @return A reference to this updated object so that method calls can be * chained together. * @see DocumentClassifierMode */ public CreateDocumentClassifierRequest withMode(String mode) { this.mode = mode; return this; } /** *

* 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 (|). *

*

* Constraints:
* Allowed Values: MULTI_CLASS, MULTI_LABEL * * @param 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 (|). *

* @see DocumentClassifierMode */ public void setMode(DocumentClassifierMode mode) { this.mode = mode.toString(); } /** *

* 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 (|). *

*

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

* Constraints:
* Allowed Values: MULTI_CLASS, MULTI_LABEL * * @param 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 (|). *

* @return A reference to this updated object so that method calls can be * chained together. * @see DocumentClassifierMode */ public CreateDocumentClassifierRequest withMode(DocumentClassifierMode mode) { this.mode = mode.toString(); return this; } /** *

* ID for the KMS key that Amazon Comprehend uses to encrypt trained custom * models. The ModelKmsKeyId 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" *

    *
  • *
*

* Constraints:
* Length: - 2048
* Pattern: ^\p{ASCII}+$
* * @return

* ID for the KMS key that Amazon Comprehend uses to encrypt trained * custom models. The ModelKmsKeyId 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" *

    *
  • *
*/ public String getModelKmsKeyId() { return modelKmsKeyId; } /** *

* ID for the KMS key that Amazon Comprehend uses to encrypt trained custom * models. The ModelKmsKeyId 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" *

    *
  • *
*

* Constraints:
* Length: - 2048
* Pattern: ^\p{ASCII}+$
* * @param modelKmsKeyId

* ID for the KMS key that Amazon Comprehend uses to encrypt * trained custom models. The ModelKmsKeyId 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" *

    *
  • *
*/ public void setModelKmsKeyId(String modelKmsKeyId) { this.modelKmsKeyId = modelKmsKeyId; } /** *

* ID for the KMS key that Amazon Comprehend uses to encrypt trained custom * models. The ModelKmsKeyId 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" *

    *
  • *
*

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

* Constraints:
* Length: - 2048
* Pattern: ^\p{ASCII}+$
* * @param modelKmsKeyId

* ID for the KMS key that Amazon Comprehend uses to encrypt * trained custom models. The ModelKmsKeyId 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" *

    *
  • *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withModelKmsKeyId(String modelKmsKeyId) { this.modelKmsKeyId = modelKmsKeyId; return this; } /** *

* The resource-based policy to attach to your custom document classifier * model. You can use this policy to allow another Amazon Web Services * account to import your custom model. *

*

* Provide your policy as a JSON body that you enter as a UTF-8 encoded * string without line breaks. To provide valid JSON, enclose the attribute * names and values in double quotes. If the JSON body is also enclosed in * double quotes, then you must escape the double quotes that are inside the * policy: *

*

* "{\"attribute\": \"value\", \"attribute\": [\"value\"]}" *

*

* To avoid escaping quotes, you can use single quotes to enclose the policy * and double quotes to enclose the JSON names and values: *

*

* '{"attribute": "value", "attribute": ["value"]}' *

*

* Constraints:
* Length: 1 - 20000
* Pattern: [ -\u00FF]+
* * @return

* The resource-based policy to attach to your custom document * classifier model. You can use this policy to allow another Amazon * Web Services account to import your custom model. *

*

* Provide your policy as a JSON body that you enter as a UTF-8 * encoded string without line breaks. To provide valid JSON, * enclose the attribute names and values in double quotes. If the * JSON body is also enclosed in double quotes, then you must escape * the double quotes that are inside the policy: *

*

* "{\"attribute\": \"value\", \"attribute\": [\"value\"]}" *

*

* To avoid escaping quotes, you can use single quotes to enclose * the policy and double quotes to enclose the JSON names and * values: *

*

* '{"attribute": "value", "attribute": ["value"]}' *

*/ public String getModelPolicy() { return modelPolicy; } /** *

* The resource-based policy to attach to your custom document classifier * model. You can use this policy to allow another Amazon Web Services * account to import your custom model. *

*

* Provide your policy as a JSON body that you enter as a UTF-8 encoded * string without line breaks. To provide valid JSON, enclose the attribute * names and values in double quotes. If the JSON body is also enclosed in * double quotes, then you must escape the double quotes that are inside the * policy: *

*

* "{\"attribute\": \"value\", \"attribute\": [\"value\"]}" *

*

* To avoid escaping quotes, you can use single quotes to enclose the policy * and double quotes to enclose the JSON names and values: *

*

* '{"attribute": "value", "attribute": ["value"]}' *

*

* Constraints:
* Length: 1 - 20000
* Pattern: [ -\u00FF]+
* * @param modelPolicy

* The resource-based policy to attach to your custom document * classifier model. You can use this policy to allow another * Amazon Web Services account to import your custom model. *

*

* Provide your policy as a JSON body that you enter as a UTF-8 * encoded string without line breaks. To provide valid JSON, * enclose the attribute names and values in double quotes. If * the JSON body is also enclosed in double quotes, then you must * escape the double quotes that are inside the policy: *

*

* "{\"attribute\": \"value\", \"attribute\": [\"value\"]}" *

*

* To avoid escaping quotes, you can use single quotes to enclose * the policy and double quotes to enclose the JSON names and * values: *

*

* '{"attribute": "value", "attribute": ["value"]}' *

*/ public void setModelPolicy(String modelPolicy) { this.modelPolicy = modelPolicy; } /** *

* The resource-based policy to attach to your custom document classifier * model. You can use this policy to allow another Amazon Web Services * account to import your custom model. *

*

* Provide your policy as a JSON body that you enter as a UTF-8 encoded * string without line breaks. To provide valid JSON, enclose the attribute * names and values in double quotes. If the JSON body is also enclosed in * double quotes, then you must escape the double quotes that are inside the * policy: *

*

* "{\"attribute\": \"value\", \"attribute\": [\"value\"]}" *

*

* To avoid escaping quotes, you can use single quotes to enclose the policy * and double quotes to enclose the JSON names and values: *

*

* '{"attribute": "value", "attribute": ["value"]}' *

*

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

* Constraints:
* Length: 1 - 20000
* Pattern: [ -\u00FF]+
* * @param modelPolicy

* The resource-based policy to attach to your custom document * classifier model. You can use this policy to allow another * Amazon Web Services account to import your custom model. *

*

* Provide your policy as a JSON body that you enter as a UTF-8 * encoded string without line breaks. To provide valid JSON, * enclose the attribute names and values in double quotes. If * the JSON body is also enclosed in double quotes, then you must * escape the double quotes that are inside the policy: *

*

* "{\"attribute\": \"value\", \"attribute\": [\"value\"]}" *

*

* To avoid escaping quotes, you can use single quotes to enclose * the policy and double quotes to enclose the JSON names and * values: *

*

* '{"attribute": "value", "attribute": ["value"]}' *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateDocumentClassifierRequest withModelPolicy(String modelPolicy) { this.modelPolicy = modelPolicy; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDocumentClassifierName() != null) sb.append("DocumentClassifierName: " + getDocumentClassifierName() + ","); if (getVersionName() != null) sb.append("VersionName: " + getVersionName() + ","); if (getDataAccessRoleArn() != null) sb.append("DataAccessRoleArn: " + getDataAccessRoleArn() + ","); if (getTags() != null) sb.append("Tags: " + getTags() + ","); if (getInputDataConfig() != null) sb.append("InputDataConfig: " + getInputDataConfig() + ","); if (getOutputDataConfig() != null) sb.append("OutputDataConfig: " + getOutputDataConfig() + ","); if (getClientRequestToken() != null) sb.append("ClientRequestToken: " + getClientRequestToken() + ","); if (getLanguageCode() != null) sb.append("LanguageCode: " + getLanguageCode() + ","); if (getVolumeKmsKeyId() != null) sb.append("VolumeKmsKeyId: " + getVolumeKmsKeyId() + ","); if (getVpcConfig() != null) sb.append("VpcConfig: " + getVpcConfig() + ","); if (getMode() != null) sb.append("Mode: " + getMode() + ","); if (getModelKmsKeyId() != null) sb.append("ModelKmsKeyId: " + getModelKmsKeyId() + ","); if (getModelPolicy() != null) sb.append("ModelPolicy: " + getModelPolicy()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDocumentClassifierName() == null) ? 0 : getDocumentClassifierName() .hashCode()); hashCode = prime * hashCode + ((getVersionName() == null) ? 0 : getVersionName().hashCode()); hashCode = prime * hashCode + ((getDataAccessRoleArn() == null) ? 0 : getDataAccessRoleArn().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getInputDataConfig() == null) ? 0 : getInputDataConfig().hashCode()); hashCode = prime * hashCode + ((getOutputDataConfig() == null) ? 0 : getOutputDataConfig().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); hashCode = prime * hashCode + ((getLanguageCode() == null) ? 0 : getLanguageCode().hashCode()); hashCode = prime * hashCode + ((getVolumeKmsKeyId() == null) ? 0 : getVolumeKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getVpcConfig() == null) ? 0 : getVpcConfig().hashCode()); hashCode = prime * hashCode + ((getMode() == null) ? 0 : getMode().hashCode()); hashCode = prime * hashCode + ((getModelKmsKeyId() == null) ? 0 : getModelKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getModelPolicy() == null) ? 0 : getModelPolicy().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateDocumentClassifierRequest == false) return false; CreateDocumentClassifierRequest other = (CreateDocumentClassifierRequest) obj; if (other.getDocumentClassifierName() == null ^ this.getDocumentClassifierName() == null) return false; if (other.getDocumentClassifierName() != null && other.getDocumentClassifierName().equals(this.getDocumentClassifierName()) == false) return false; if (other.getVersionName() == null ^ this.getVersionName() == null) return false; if (other.getVersionName() != null && other.getVersionName().equals(this.getVersionName()) == false) return false; if (other.getDataAccessRoleArn() == null ^ this.getDataAccessRoleArn() == null) return false; if (other.getDataAccessRoleArn() != null && other.getDataAccessRoleArn().equals(this.getDataAccessRoleArn()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getInputDataConfig() == null ^ this.getInputDataConfig() == null) return false; if (other.getInputDataConfig() != null && other.getInputDataConfig().equals(this.getInputDataConfig()) == false) return false; if (other.getOutputDataConfig() == null ^ this.getOutputDataConfig() == null) return false; if (other.getOutputDataConfig() != null && other.getOutputDataConfig().equals(this.getOutputDataConfig()) == false) return false; if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) return false; if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) return false; if (other.getLanguageCode() == null ^ this.getLanguageCode() == null) return false; if (other.getLanguageCode() != null && other.getLanguageCode().equals(this.getLanguageCode()) == false) return false; if (other.getVolumeKmsKeyId() == null ^ this.getVolumeKmsKeyId() == null) return false; if (other.getVolumeKmsKeyId() != null && other.getVolumeKmsKeyId().equals(this.getVolumeKmsKeyId()) == false) return false; if (other.getVpcConfig() == null ^ this.getVpcConfig() == null) return false; if (other.getVpcConfig() != null && other.getVpcConfig().equals(this.getVpcConfig()) == false) return false; if (other.getMode() == null ^ this.getMode() == null) return false; if (other.getMode() != null && other.getMode().equals(this.getMode()) == false) return false; if (other.getModelKmsKeyId() == null ^ this.getModelKmsKeyId() == null) return false; if (other.getModelKmsKeyId() != null && other.getModelKmsKeyId().equals(this.getModelKmsKeyId()) == false) return false; if (other.getModelPolicy() == null ^ this.getModelPolicy() == null) return false; if (other.getModelPolicy() != null && other.getModelPolicy().equals(this.getModelPolicy()) == false) return false; return true; } }