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

* Starts an asynchronous event detection job for a collection of documents. *

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

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

*/ private InputDataConfig inputDataConfig; /** *

* Specifies where to send the output files. *

*/ private OutputDataConfig outputDataConfig; /** *

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

* The identifier of the events detection job. *

*

* Constraints:
* Length: 1 - 256
* Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-%@]*)$
*/ private String jobName; /** *

* The language code of the input documents. *

*

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

* An 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 types of events to detect in the input documents. *

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

* Tags to associate with the events detection job. A tag is a key-value * pair that adds 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. *

* * @return

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

*/ public InputDataConfig 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(InputDataConfig 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 StartEventsDetectionJobRequest withInputDataConfig(InputDataConfig inputDataConfig) { this.inputDataConfig = inputDataConfig; return this; } /** *

* Specifies where to send the output files. *

* * @return

* Specifies where to send the output files. *

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

* Specifies where to send the output files. *

* * @param outputDataConfig

* Specifies where to send the output files. *

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

* Specifies where to send the output files. *

*

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

* Specifies where to send the output files. *

* @return A reference to this updated object so that method calls can be * chained together. */ public StartEventsDetectionJobRequest withOutputDataConfig(OutputDataConfig outputDataConfig) { this.outputDataConfig = outputDataConfig; 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 StartEventsDetectionJobRequest withDataAccessRoleArn(String dataAccessRoleArn) { this.dataAccessRoleArn = dataAccessRoleArn; return this; } /** *

* The identifier of the events detection job. *

*

* Constraints:
* Length: 1 - 256
* Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-%@]*)$
* * @return

* The identifier of the events detection job. *

*/ public String getJobName() { return jobName; } /** *

* The identifier of the events detection job. *

*

* Constraints:
* Length: 1 - 256
* Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-%@]*)$
* * @param jobName

* The identifier of the events detection job. *

*/ public void setJobName(String jobName) { this.jobName = jobName; } /** *

* The identifier of the events detection job. *

*

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

* Constraints:
* Length: 1 - 256
* Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-%@]*)$
* * @param jobName

* The identifier of the events detection job. *

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

* The language code of the input documents. *

*

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

* The language code of the input documents. *

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

* The language code of the input documents. *

*

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

* The language code of the input documents. *

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

* The language code of the input documents. *

*

* 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 code of the input documents. *

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

* The language code of the input documents. *

*

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

* The language code of the input documents. *

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

* The language code of the input documents. *

*

* 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 code of the input documents. *

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

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

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

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

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

* An 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; } /** *

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

* An 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 StartEventsDetectionJobRequest withClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; return this; } /** *

* The types of events to detect in the input documents. *

* * @return

* The types of events to detect in the input documents. *

*/ public java.util.List getTargetEventTypes() { return targetEventTypes; } /** *

* The types of events to detect in the input documents. *

* * @param targetEventTypes

* The types of events to detect in the input documents. *

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

* The types of events to detect in the input documents. *

*

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

* The types of events to detect in the input documents. *

* @return A reference to this updated object so that method calls can be * chained together. */ public StartEventsDetectionJobRequest withTargetEventTypes(String... targetEventTypes) { if (getTargetEventTypes() == null) { this.targetEventTypes = new java.util.ArrayList(targetEventTypes.length); } for (String value : targetEventTypes) { this.targetEventTypes.add(value); } return this; } /** *

* The types of events to detect in the input documents. *

*

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

* The types of events to detect in the input documents. *

* @return A reference to this updated object so that method calls can be * chained together. */ public StartEventsDetectionJobRequest withTargetEventTypes( java.util.Collection targetEventTypes) { setTargetEventTypes(targetEventTypes); return this; } /** *

* Tags to associate with the events detection job. A tag is a key-value * pair that adds 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 events detection job. A tag is a * key-value pair that adds 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 events detection job. A tag is a key-value * pair that adds 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 events detection job. A tag is a * key-value pair that adds 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 events detection job. A tag is a key-value * pair that adds 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 events detection job. A tag is a * key-value pair that adds 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 StartEventsDetectionJobRequest 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 events detection job. A tag is a key-value * pair that adds 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 events detection job. A tag is a * key-value pair that adds 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 StartEventsDetectionJobRequest 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 (getInputDataConfig() != null) sb.append("InputDataConfig: " + getInputDataConfig() + ","); if (getOutputDataConfig() != null) sb.append("OutputDataConfig: " + getOutputDataConfig() + ","); if (getDataAccessRoleArn() != null) sb.append("DataAccessRoleArn: " + getDataAccessRoleArn() + ","); if (getJobName() != null) sb.append("JobName: " + getJobName() + ","); if (getLanguageCode() != null) sb.append("LanguageCode: " + getLanguageCode() + ","); if (getClientRequestToken() != null) sb.append("ClientRequestToken: " + getClientRequestToken() + ","); if (getTargetEventTypes() != null) sb.append("TargetEventTypes: " + getTargetEventTypes() + ","); 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 + ((getInputDataConfig() == null) ? 0 : getInputDataConfig().hashCode()); hashCode = prime * hashCode + ((getOutputDataConfig() == null) ? 0 : getOutputDataConfig().hashCode()); hashCode = prime * hashCode + ((getDataAccessRoleArn() == null) ? 0 : getDataAccessRoleArn().hashCode()); hashCode = prime * hashCode + ((getJobName() == null) ? 0 : getJobName().hashCode()); hashCode = prime * hashCode + ((getLanguageCode() == null) ? 0 : getLanguageCode().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); hashCode = prime * hashCode + ((getTargetEventTypes() == null) ? 0 : getTargetEventTypes().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 StartEventsDetectionJobRequest == false) return false; StartEventsDetectionJobRequest other = (StartEventsDetectionJobRequest) obj; 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.getDataAccessRoleArn() == null ^ this.getDataAccessRoleArn() == null) return false; if (other.getDataAccessRoleArn() != null && other.getDataAccessRoleArn().equals(this.getDataAccessRoleArn()) == false) return false; if (other.getJobName() == null ^ this.getJobName() == null) return false; if (other.getJobName() != null && other.getJobName().equals(this.getJobName()) == 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.getClientRequestToken() == null ^ this.getClientRequestToken() == null) return false; if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) return false; if (other.getTargetEventTypes() == null ^ this.getTargetEventTypes() == null) return false; if (other.getTargetEventTypes() != null && other.getTargetEventTypes().equals(this.getTargetEventTypes()) == 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; } }