/* * 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; /** *
* A flywheel is an Amazon Web Services resource that orchestrates the ongoing * training of a model for custom classification or custom entity recognition. * You can create a flywheel to start with an existing trained model, or * Comprehend can create and train a new model. *
** When you create the flywheel, Comprehend creates a data lake in your account. * The data lake holds the training data and test data for all versions of the * model. *
** To use a flywheel with an existing trained model, you specify the active * model version. Comprehend copies the model's training data and test data into * the flywheel's data lake. *
** To use the flywheel with a new model, you need to provide a dataset for * training data (and optional test data) when you create the flywheel. *
** For more information about flywheels, see * Flywheel overview in the Amazon Comprehend Developer Guide. *
*/ public class CreateFlywheelRequest extends AmazonWebServiceRequest implements Serializable { /** ** Name for the flywheel. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*/
private String flywheelName;
/**
*
* To associate an existing model with the flywheel, specify the Amazon * Resource Number (ARN) of the model version. *
*
* 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 activeModelArn;
/**
*
* The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend the permissions required to access the flywheel data in the * data lake. *
*
* Constraints:
* Length: 20 - 2048
* Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+
*/
private String dataAccessRoleArn;
/**
*
* Configuration about the custom classifier associated with the flywheel. *
*/ private TaskConfig taskConfig; /** ** The model type. *
*
* Constraints:
* Allowed Values: DOCUMENT_CLASSIFIER, ENTITY_RECOGNIZER
*/
private String modelType;
/**
*
* Enter the S3 location for the data lake. You can specify a new S3 bucket * or a new folder of an existing S3 bucket. The flywheel creates the data * lake at this location. *
*
* Constraints:
* Length: - 512
* Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
*/
private String dataLakeS3Uri;
/**
*
* Data security configurations. *
*/ private DataSecurityConfig dataSecurityConfig; /** ** 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 tags to associate with this flywheel. *
*/ private java.util.List* Name for the flywheel. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*
* @return
* Name for the flywheel. *
*/ public String getFlywheelName() { return flywheelName; } /** ** Name for the flywheel. *
*
* Constraints:
* Length: - 63
* Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$
*
* @param flywheelName
* Name for the flywheel. *
*/ public void setFlywheelName(String flywheelName) { this.flywheelName = flywheelName; } /** ** Name for the flywheel. *
** 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 flywheelName
* Name for the flywheel. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateFlywheelRequest withFlywheelName(String flywheelName) { this.flywheelName = flywheelName; return this; } /** ** To associate an existing model with the flywheel, specify the Amazon * Resource Number (ARN) of the model version. *
*
* 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
* To associate an existing model with the flywheel, specify the * Amazon Resource Number (ARN) of the model version. *
*/ public String getActiveModelArn() { return activeModelArn; } /** ** To associate an existing model with the flywheel, specify the Amazon * Resource Number (ARN) of the model version. *
*
* 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 activeModelArn
* To associate an existing model with the flywheel, specify the * Amazon Resource Number (ARN) of the model version. *
*/ public void setActiveModelArn(String activeModelArn) { this.activeModelArn = activeModelArn; } /** ** To associate an existing model with the flywheel, specify the Amazon * Resource Number (ARN) of the model version. *
** 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 activeModelArn
* To associate an existing model with the flywheel, specify the * Amazon Resource Number (ARN) of the model version. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateFlywheelRequest withActiveModelArn(String activeModelArn) { this.activeModelArn = activeModelArn; return this; } /** ** The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend the permissions required to access the flywheel data in the * data lake. *
*
* 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 the permissions required to access the flywheel data * in the data lake. *
*/ public String getDataAccessRoleArn() { return dataAccessRoleArn; } /** ** The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend the permissions required to access the flywheel data in the * data lake. *
*
* 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 the permissions required to access the * flywheel data in the data lake. *
*/ public void setDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; } /** ** The Amazon Resource Name (ARN) of the IAM role that grants Amazon * Comprehend the permissions required to access the flywheel data in the * data lake. *
** 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 the permissions required to access the * flywheel data in the data lake. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateFlywheelRequest withDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; return this; } /** ** Configuration about the custom classifier associated with the flywheel. *
* * @return* Configuration about the custom classifier associated with the * flywheel. *
*/ public TaskConfig getTaskConfig() { return taskConfig; } /** ** Configuration about the custom classifier associated with the flywheel. *
* * @param taskConfig* Configuration about the custom classifier associated with the * flywheel. *
*/ public void setTaskConfig(TaskConfig taskConfig) { this.taskConfig = taskConfig; } /** ** Configuration about the custom classifier associated with the flywheel. *
** Returns a reference to this object so that method calls can be chained * together. * * @param taskConfig
* Configuration about the custom classifier associated with the * flywheel. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateFlywheelRequest withTaskConfig(TaskConfig taskConfig) { this.taskConfig = taskConfig; return this; } /** ** The model type. *
*
* Constraints:
* Allowed Values: DOCUMENT_CLASSIFIER, ENTITY_RECOGNIZER
*
* @return
* The model type. *
* @see ModelType */ public String getModelType() { return modelType; } /** ** The model type. *
*
* Constraints:
* Allowed Values: DOCUMENT_CLASSIFIER, ENTITY_RECOGNIZER
*
* @param modelType
* The model type. *
* @see ModelType */ public void setModelType(String modelType) { this.modelType = modelType; } /** ** The model type. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: DOCUMENT_CLASSIFIER, ENTITY_RECOGNIZER
*
* @param modelType
* The model type. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ModelType */ public CreateFlywheelRequest withModelType(String modelType) { this.modelType = modelType; return this; } /** ** The model type. *
*
* Constraints:
* Allowed Values: DOCUMENT_CLASSIFIER, ENTITY_RECOGNIZER
*
* @param modelType
* The model type. *
* @see ModelType */ public void setModelType(ModelType modelType) { this.modelType = modelType.toString(); } /** ** The model type. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: DOCUMENT_CLASSIFIER, ENTITY_RECOGNIZER
*
* @param modelType
* The model type. *
* @return A reference to this updated object so that method calls can be * chained together. * @see ModelType */ public CreateFlywheelRequest withModelType(ModelType modelType) { this.modelType = modelType.toString(); return this; } /** ** Enter the S3 location for the data lake. You can specify a new S3 bucket * or a new folder of an existing S3 bucket. The flywheel creates the data * lake at this location. *
*
* Constraints:
* Length: - 512
* Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
*
* @return
* Enter the S3 location for the data lake. You can specify a new S3 * bucket or a new folder of an existing S3 bucket. The flywheel * creates the data lake at this location. *
*/ public String getDataLakeS3Uri() { return dataLakeS3Uri; } /** ** Enter the S3 location for the data lake. You can specify a new S3 bucket * or a new folder of an existing S3 bucket. The flywheel creates the data * lake at this location. *
*
* Constraints:
* Length: - 512
* Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
*
* @param dataLakeS3Uri
* Enter the S3 location for the data lake. You can specify a new * S3 bucket or a new folder of an existing S3 bucket. The * flywheel creates the data lake at this location. *
*/ public void setDataLakeS3Uri(String dataLakeS3Uri) { this.dataLakeS3Uri = dataLakeS3Uri; } /** ** Enter the S3 location for the data lake. You can specify a new S3 bucket * or a new folder of an existing S3 bucket. The flywheel creates the data * lake at this location. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: - 512
* Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?
*
* @param dataLakeS3Uri
* Enter the S3 location for the data lake. You can specify a new * S3 bucket or a new folder of an existing S3 bucket. The * flywheel creates the data lake at this location. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateFlywheelRequest withDataLakeS3Uri(String dataLakeS3Uri) { this.dataLakeS3Uri = dataLakeS3Uri; return this; } /** ** Data security configurations. *
* * @return* Data security configurations. *
*/ public DataSecurityConfig getDataSecurityConfig() { return dataSecurityConfig; } /** ** Data security configurations. *
* * @param dataSecurityConfig* Data security configurations. *
*/ public void setDataSecurityConfig(DataSecurityConfig dataSecurityConfig) { this.dataSecurityConfig = dataSecurityConfig; } /** ** Data security configurations. *
** Returns a reference to this object so that method calls can be chained * together. * * @param dataSecurityConfig
* Data security configurations. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateFlywheelRequest withDataSecurityConfig(DataSecurityConfig dataSecurityConfig) { this.dataSecurityConfig = dataSecurityConfig; 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 CreateFlywheelRequest withClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; return this; } /** ** The tags to associate with this flywheel. *
* * @return* The tags to associate with this flywheel. *
*/ public java.util.List* The tags to associate with this flywheel. *
* * @param tags* The tags to associate with this flywheel. *
*/ public void setTags(java.util.Collection* The tags to associate with this flywheel. *
** Returns a reference to this object so that method calls can be chained * together. * * @param tags
* The tags to associate with this flywheel. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateFlywheelRequest withTags(Tag... tags) { if (getTags() == null) { this.tags = new java.util.ArrayList* The tags to associate with this flywheel. *
** Returns a reference to this object so that method calls can be chained * together. * * @param tags
* The tags to associate with this flywheel. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateFlywheelRequest withTags(java.util.Collection