/* * 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 custom model that replicates a source custom model that you * import. The source model can be in your Amazon Web Services account or * another one. *
** If the source model is in another Amazon Web Services account, then it must * have a resource-based policy that authorizes you to import it. *
** The source model must be in the same Amazon Web Services Region that you're * using when you import. You can't import a model that's in a different Region. *
*/ public class ImportModelRequest extends AmazonWebServiceRequest implements Serializable { /** ** The Amazon Resource Name (ARN) of the custom model to import. *
*
* Constraints:
* Length: - 256
* Pattern:
* arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document
* -classifier
* |entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA-
* Z0-9](-*[a-zA-Z0-9])*)?
*/
private String sourceModelArn;
/**
*
* The name to assign to the custom model that is created in Amazon * Comprehend by this import. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*/
private String modelName;
/**
*
* The version name given to the custom model that is created by this * import. 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 * account/Region. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*/
private String versionName;
/**
*
* 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}+$
*/
private String modelKmsKeyId;
/**
*
* The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend permission to use Amazon Key Management Service (KMS) to * encrypt or decrypt the custom model. *
*
* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
*/
private String dataAccessRoleArn;
/**
*
* Tags to associate with the custom model that is created by this import. 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* The Amazon Resource Name (ARN) of the custom model to import. *
*
* Constraints:
* Length: - 256
* Pattern:
* arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document
* -classifier
* |entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA-
* Z0-9](-*[a-zA-Z0-9])*)?
*
* @return
* The Amazon Resource Name (ARN) of the custom model to import. *
*/ public String getSourceModelArn() { return sourceModelArn; } /** ** The Amazon Resource Name (ARN) of the custom model to import. *
*
* Constraints:
* Length: - 256
* Pattern:
* arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document
* -classifier
* |entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA-
* Z0-9](-*[a-zA-Z0-9])*)?
*
* @param sourceModelArn
* The Amazon Resource Name (ARN) of the custom model to import. *
*/ public void setSourceModelArn(String sourceModelArn) { this.sourceModelArn = sourceModelArn; } /** ** The Amazon Resource Name (ARN) of the custom model to import. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 256
* Pattern:
* arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document
* -classifier
* |entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA-
* Z0-9](-*[a-zA-Z0-9])*)?
*
* @param sourceModelArn
* The Amazon Resource Name (ARN) of the custom model to import. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ImportModelRequest withSourceModelArn(String sourceModelArn) { this.sourceModelArn = sourceModelArn; return this; } /** ** The name to assign to the custom model that is created in Amazon * Comprehend by this import. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*
* @return
* The name to assign to the custom model that is created in Amazon * Comprehend by this import. *
*/ public String getModelName() { return modelName; } /** ** The name to assign to the custom model that is created in Amazon * Comprehend by this import. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*
* @param modelName
* The name to assign to the custom model that is created in * Amazon Comprehend by this import. *
*/ public void setModelName(String modelName) { this.modelName = modelName; } /** ** The name to assign to the custom model that is created in Amazon * Comprehend by this import. *
** 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 modelName
* The name to assign to the custom model that is created in * Amazon Comprehend by this import. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ImportModelRequest withModelName(String modelName) { this.modelName = modelName; return this; } /** ** The version name given to the custom model that is created by this * import. 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 * account/Region. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*
* @return
* The version name given to the custom model that is created by * this import. 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 account/Region. *
*/ public String getVersionName() { return versionName; } /** ** The version name given to the custom model that is created by this * import. 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 * account/Region. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*
* @param versionName
* The version name given to the custom model that is created by * this import. 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 * account/Region. *
*/ public void setVersionName(String versionName) { this.versionName = versionName; } /** ** The version name given to the custom model that is created by this * import. 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 * account/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 custom model that is created by * this import. 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 * account/Region. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ImportModelRequest withVersionName(String versionName) { this.versionName = versionName; 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"
*
* 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"
*
* 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"
*
* The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend permission to use Amazon Key Management Service (KMS) to * encrypt or decrypt the custom model. *
*
* 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 permission to use Amazon Key Management Service (KMS) * to encrypt or decrypt the custom model. *
*/ public String getDataAccessRoleArn() { return dataAccessRoleArn; } /** ** The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend permission to use Amazon Key Management Service (KMS) to * encrypt or decrypt the custom model. *
*
* 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 permission to use Amazon Key Management * Service (KMS) to encrypt or decrypt the custom model. *
*/ public void setDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; } /** ** The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend permission to use Amazon Key Management Service (KMS) to * encrypt or decrypt the custom model. *
** 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 permission to use Amazon Key Management * Service (KMS) to encrypt or decrypt the custom model. *
* @return A reference to this updated object so that method calls can be * chained together. */ public ImportModelRequest withDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; return this; } /** ** Tags to associate with the custom model that is created by this import. 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 custom model that is created by this * import. 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* Tags to associate with the custom model that is created by this import. 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 custom model that is created by * this import. 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 to associate with the custom model that is created by this import. 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 custom model that is created by * this import. 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 ImportModelRequest withTags(Tag... tags) { if (getTags() == null) { this.tags = new java.util.ArrayList* Tags to associate with the custom model that is created by this import. 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 custom model that is created by * this import. 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 ImportModelRequest withTags(java.util.Collection