/* * 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 tags; /** *

* 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 getTags() { return tags; } /** *

* The tags to associate with this flywheel. *

* * @param tags

* The tags to associate with this flywheel. *

*/ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* 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(tags.length); } for (Tag value : tags) { this.tags.add(value); } return this; } /** *

* 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 tags) { setTags(tags); 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 (getFlywheelName() != null) sb.append("FlywheelName: " + getFlywheelName() + ","); if (getActiveModelArn() != null) sb.append("ActiveModelArn: " + getActiveModelArn() + ","); if (getDataAccessRoleArn() != null) sb.append("DataAccessRoleArn: " + getDataAccessRoleArn() + ","); if (getTaskConfig() != null) sb.append("TaskConfig: " + getTaskConfig() + ","); if (getModelType() != null) sb.append("ModelType: " + getModelType() + ","); if (getDataLakeS3Uri() != null) sb.append("DataLakeS3Uri: " + getDataLakeS3Uri() + ","); if (getDataSecurityConfig() != null) sb.append("DataSecurityConfig: " + getDataSecurityConfig() + ","); if (getClientRequestToken() != null) sb.append("ClientRequestToken: " + getClientRequestToken() + ","); if (getTags() != null) sb.append("Tags: " + getTags()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFlywheelName() == null) ? 0 : getFlywheelName().hashCode()); hashCode = prime * hashCode + ((getActiveModelArn() == null) ? 0 : getActiveModelArn().hashCode()); hashCode = prime * hashCode + ((getDataAccessRoleArn() == null) ? 0 : getDataAccessRoleArn().hashCode()); hashCode = prime * hashCode + ((getTaskConfig() == null) ? 0 : getTaskConfig().hashCode()); hashCode = prime * hashCode + ((getModelType() == null) ? 0 : getModelType().hashCode()); hashCode = prime * hashCode + ((getDataLakeS3Uri() == null) ? 0 : getDataLakeS3Uri().hashCode()); hashCode = prime * hashCode + ((getDataSecurityConfig() == null) ? 0 : getDataSecurityConfig().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateFlywheelRequest == false) return false; CreateFlywheelRequest other = (CreateFlywheelRequest) obj; if (other.getFlywheelName() == null ^ this.getFlywheelName() == null) return false; if (other.getFlywheelName() != null && other.getFlywheelName().equals(this.getFlywheelName()) == false) return false; if (other.getActiveModelArn() == null ^ this.getActiveModelArn() == null) return false; if (other.getActiveModelArn() != null && other.getActiveModelArn().equals(this.getActiveModelArn()) == 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.getTaskConfig() == null ^ this.getTaskConfig() == null) return false; if (other.getTaskConfig() != null && other.getTaskConfig().equals(this.getTaskConfig()) == false) return false; if (other.getModelType() == null ^ this.getModelType() == null) return false; if (other.getModelType() != null && other.getModelType().equals(this.getModelType()) == false) return false; if (other.getDataLakeS3Uri() == null ^ this.getDataLakeS3Uri() == null) return false; if (other.getDataLakeS3Uri() != null && other.getDataLakeS3Uri().equals(this.getDataLakeS3Uri()) == false) return false; if (other.getDataSecurityConfig() == null ^ this.getDataSecurityConfig() == null) return false; if (other.getDataSecurityConfig() != null && other.getDataSecurityConfig().equals(this.getDataSecurityConfig()) == 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.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } }