
com.amazonaws.services.rekognition.model.CreateDatasetRequest Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.rekognition.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateDatasetRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket
* location of an Amazon Sagemaker format manifest file. If you don't specify datasetSource
, an empty
* dataset is created. To add labeled images to the dataset, You can use the console or call
* UpdateDatasetEntries.
*
*/
private DatasetSource datasetSource;
/**
*
* The type of the dataset. Specify TRAIN
to create a training dataset. Specify TEST
to
* create a test dataset.
*
*/
private String datasetType;
/**
*
* The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.
*
*/
private String projectArn;
/**
*
* A set of tags (key-value pairs) that you want to attach to the dataset.
*
*/
private java.util.Map tags;
/**
*
* The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket
* location of an Amazon Sagemaker format manifest file. If you don't specify datasetSource
, an empty
* dataset is created. To add labeled images to the dataset, You can use the console or call
* UpdateDatasetEntries.
*
*
* @param datasetSource
* The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3
* bucket location of an Amazon Sagemaker format manifest file. If you don't specify
* datasetSource
, an empty dataset is created. To add labeled images to the dataset, You can use
* the console or call UpdateDatasetEntries.
*/
public void setDatasetSource(DatasetSource datasetSource) {
this.datasetSource = datasetSource;
}
/**
*
* The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket
* location of an Amazon Sagemaker format manifest file. If you don't specify datasetSource
, an empty
* dataset is created. To add labeled images to the dataset, You can use the console or call
* UpdateDatasetEntries.
*
*
* @return The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3
* bucket location of an Amazon Sagemaker format manifest file. If you don't specify
* datasetSource
, an empty dataset is created. To add labeled images to the dataset, You can
* use the console or call UpdateDatasetEntries.
*/
public DatasetSource getDatasetSource() {
return this.datasetSource;
}
/**
*
* The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3 bucket
* location of an Amazon Sagemaker format manifest file. If you don't specify datasetSource
, an empty
* dataset is created. To add labeled images to the dataset, You can use the console or call
* UpdateDatasetEntries.
*
*
* @param datasetSource
* The source files for the dataset. You can specify the ARN of an existing dataset or specify the Amazon S3
* bucket location of an Amazon Sagemaker format manifest file. If you don't specify
* datasetSource
, an empty dataset is created. To add labeled images to the dataset, You can use
* the console or call UpdateDatasetEntries.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDatasetRequest withDatasetSource(DatasetSource datasetSource) {
setDatasetSource(datasetSource);
return this;
}
/**
*
* The type of the dataset. Specify TRAIN
to create a training dataset. Specify TEST
to
* create a test dataset.
*
*
* @param datasetType
* The type of the dataset. Specify TRAIN
to create a training dataset. Specify
* TEST
to create a test dataset.
* @see DatasetType
*/
public void setDatasetType(String datasetType) {
this.datasetType = datasetType;
}
/**
*
* The type of the dataset. Specify TRAIN
to create a training dataset. Specify TEST
to
* create a test dataset.
*
*
* @return The type of the dataset. Specify TRAIN
to create a training dataset. Specify
* TEST
to create a test dataset.
* @see DatasetType
*/
public String getDatasetType() {
return this.datasetType;
}
/**
*
* The type of the dataset. Specify TRAIN
to create a training dataset. Specify TEST
to
* create a test dataset.
*
*
* @param datasetType
* The type of the dataset. Specify TRAIN
to create a training dataset. Specify
* TEST
to create a test dataset.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DatasetType
*/
public CreateDatasetRequest withDatasetType(String datasetType) {
setDatasetType(datasetType);
return this;
}
/**
*
* The type of the dataset. Specify TRAIN
to create a training dataset. Specify TEST
to
* create a test dataset.
*
*
* @param datasetType
* The type of the dataset. Specify TRAIN
to create a training dataset. Specify
* TEST
to create a test dataset.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DatasetType
*/
public CreateDatasetRequest withDatasetType(DatasetType datasetType) {
this.datasetType = datasetType.toString();
return this;
}
/**
*
* The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.
*
*
* @param projectArn
* The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.
*/
public void setProjectArn(String projectArn) {
this.projectArn = projectArn;
}
/**
*
* The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.
*
*
* @return The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.
*/
public String getProjectArn() {
return this.projectArn;
}
/**
*
* The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.
*
*
* @param projectArn
* The ARN of the Amazon Rekognition Custom Labels project to which you want to asssign the dataset.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDatasetRequest withProjectArn(String projectArn) {
setProjectArn(projectArn);
return this;
}
/**
*
* A set of tags (key-value pairs) that you want to attach to the dataset.
*
*
* @return A set of tags (key-value pairs) that you want to attach to the dataset.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* A set of tags (key-value pairs) that you want to attach to the dataset.
*
*
* @param tags
* A set of tags (key-value pairs) that you want to attach to the dataset.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* A set of tags (key-value pairs) that you want to attach to the dataset.
*
*
* @param tags
* A set of tags (key-value pairs) that you want to attach to the dataset.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDatasetRequest withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see CreateDatasetRequest#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateDatasetRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDatasetRequest clearTagsEntries() {
this.tags = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDatasetSource() != null)
sb.append("DatasetSource: ").append(getDatasetSource()).append(",");
if (getDatasetType() != null)
sb.append("DatasetType: ").append(getDatasetType()).append(",");
if (getProjectArn() != null)
sb.append("ProjectArn: ").append(getProjectArn()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateDatasetRequest == false)
return false;
CreateDatasetRequest other = (CreateDatasetRequest) obj;
if (other.getDatasetSource() == null ^ this.getDatasetSource() == null)
return false;
if (other.getDatasetSource() != null && other.getDatasetSource().equals(this.getDatasetSource()) == false)
return false;
if (other.getDatasetType() == null ^ this.getDatasetType() == null)
return false;
if (other.getDatasetType() != null && other.getDatasetType().equals(this.getDatasetType()) == false)
return false;
if (other.getProjectArn() == null ^ this.getProjectArn() == null)
return false;
if (other.getProjectArn() != null && other.getProjectArn().equals(this.getProjectArn()) == 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;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDatasetSource() == null) ? 0 : getDatasetSource().hashCode());
hashCode = prime * hashCode + ((getDatasetType() == null) ? 0 : getDatasetType().hashCode());
hashCode = prime * hashCode + ((getProjectArn() == null) ? 0 : getProjectArn().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateDatasetRequest clone() {
return (CreateDatasetRequest) super.clone();
}
}