/* * 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.translate.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Creates or updates a custom terminology, depending on whether one already * exists for the given terminology name. Importing a terminology with the same * name as an existing one will merge the terminologies based on the chosen * merge strategy. The only supported merge strategy is OVERWRITE, where the * imported terminology overwrites the existing terminology of the same name. *

*

* If you import a terminology that overwrites an existing one, the new * terminology takes up to 10 minutes to fully propagate. After that, * translations have access to the new terminology. *

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

* The name of the custom terminology being imported. *

*

* Constraints:
* Length: 1 - 256
* Pattern: ^([A-Za-z0-9-]_?)+$
*/ private String name; /** *

* The merge strategy of the custom terminology being imported. Currently, * only the OVERWRITE merge strategy is supported. In this case, the * imported terminology will overwrite an existing terminology of the same * name. *

*

* Constraints:
* Allowed Values: OVERWRITE */ private String mergeStrategy; /** *

* The description of the custom terminology being imported. *

*

* Constraints:
* Length: - 256
* Pattern: [\P{M}\p{M}]{0,256}
*/ private String description; /** *

* The terminology data for the custom terminology being imported. *

*/ private TerminologyData terminologyData; /** *

* The encryption key for the custom terminology being imported. *

*/ private EncryptionKey encryptionKey; /** *

* Tags to be associated with this resource. A tag is a key-value pair that * adds metadata to a resource. Each tag key for the resource must be * unique. For more information, see * Tagging your resources. *

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

* The name of the custom terminology being imported. *

*

* Constraints:
* Length: 1 - 256
* Pattern: ^([A-Za-z0-9-]_?)+$
* * @return

* The name of the custom terminology being imported. *

*/ public String getName() { return name; } /** *

* The name of the custom terminology being imported. *

*

* Constraints:
* Length: 1 - 256
* Pattern: ^([A-Za-z0-9-]_?)+$
* * @param name

* The name of the custom terminology being imported. *

*/ public void setName(String name) { this.name = name; } /** *

* The name of the custom terminology being imported. *

*

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

* Constraints:
* Length: 1 - 256
* Pattern: ^([A-Za-z0-9-]_?)+$
* * @param name

* The name of the custom terminology being imported. *

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

* The merge strategy of the custom terminology being imported. Currently, * only the OVERWRITE merge strategy is supported. In this case, the * imported terminology will overwrite an existing terminology of the same * name. *

*

* Constraints:
* Allowed Values: OVERWRITE * * @return

* The merge strategy of the custom terminology being imported. * Currently, only the OVERWRITE merge strategy is supported. In * this case, the imported terminology will overwrite an existing * terminology of the same name. *

* @see MergeStrategy */ public String getMergeStrategy() { return mergeStrategy; } /** *

* The merge strategy of the custom terminology being imported. Currently, * only the OVERWRITE merge strategy is supported. In this case, the * imported terminology will overwrite an existing terminology of the same * name. *

*

* Constraints:
* Allowed Values: OVERWRITE * * @param mergeStrategy

* The merge strategy of the custom terminology being imported. * Currently, only the OVERWRITE merge strategy is supported. In * this case, the imported terminology will overwrite an existing * terminology of the same name. *

* @see MergeStrategy */ public void setMergeStrategy(String mergeStrategy) { this.mergeStrategy = mergeStrategy; } /** *

* The merge strategy of the custom terminology being imported. Currently, * only the OVERWRITE merge strategy is supported. In this case, the * imported terminology will overwrite an existing terminology of the same * name. *

*

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

* Constraints:
* Allowed Values: OVERWRITE * * @param mergeStrategy

* The merge strategy of the custom terminology being imported. * Currently, only the OVERWRITE merge strategy is supported. In * this case, the imported terminology will overwrite an existing * terminology of the same name. *

* @return A reference to this updated object so that method calls can be * chained together. * @see MergeStrategy */ public ImportTerminologyRequest withMergeStrategy(String mergeStrategy) { this.mergeStrategy = mergeStrategy; return this; } /** *

* The merge strategy of the custom terminology being imported. Currently, * only the OVERWRITE merge strategy is supported. In this case, the * imported terminology will overwrite an existing terminology of the same * name. *

*

* Constraints:
* Allowed Values: OVERWRITE * * @param mergeStrategy

* The merge strategy of the custom terminology being imported. * Currently, only the OVERWRITE merge strategy is supported. In * this case, the imported terminology will overwrite an existing * terminology of the same name. *

* @see MergeStrategy */ public void setMergeStrategy(MergeStrategy mergeStrategy) { this.mergeStrategy = mergeStrategy.toString(); } /** *

* The merge strategy of the custom terminology being imported. Currently, * only the OVERWRITE merge strategy is supported. In this case, the * imported terminology will overwrite an existing terminology of the same * name. *

*

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

* Constraints:
* Allowed Values: OVERWRITE * * @param mergeStrategy

* The merge strategy of the custom terminology being imported. * Currently, only the OVERWRITE merge strategy is supported. In * this case, the imported terminology will overwrite an existing * terminology of the same name. *

* @return A reference to this updated object so that method calls can be * chained together. * @see MergeStrategy */ public ImportTerminologyRequest withMergeStrategy(MergeStrategy mergeStrategy) { this.mergeStrategy = mergeStrategy.toString(); return this; } /** *

* The description of the custom terminology being imported. *

*

* Constraints:
* Length: - 256
* Pattern: [\P{M}\p{M}]{0,256}
* * @return

* The description of the custom terminology being imported. *

*/ public String getDescription() { return description; } /** *

* The description of the custom terminology being imported. *

*

* Constraints:
* Length: - 256
* Pattern: [\P{M}\p{M}]{0,256}
* * @param description

* The description of the custom terminology being imported. *

*/ public void setDescription(String description) { this.description = description; } /** *

* The description of the custom terminology being imported. *

*

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

* Constraints:
* Length: - 256
* Pattern: [\P{M}\p{M}]{0,256}
* * @param description

* The description of the custom terminology being imported. *

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

* The terminology data for the custom terminology being imported. *

* * @return

* The terminology data for the custom terminology being imported. *

*/ public TerminologyData getTerminologyData() { return terminologyData; } /** *

* The terminology data for the custom terminology being imported. *

* * @param terminologyData

* The terminology data for the custom terminology being * imported. *

*/ public void setTerminologyData(TerminologyData terminologyData) { this.terminologyData = terminologyData; } /** *

* The terminology data for the custom terminology being imported. *

*

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

* The terminology data for the custom terminology being * imported. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ImportTerminologyRequest withTerminologyData(TerminologyData terminologyData) { this.terminologyData = terminologyData; return this; } /** *

* The encryption key for the custom terminology being imported. *

* * @return

* The encryption key for the custom terminology being imported. *

*/ public EncryptionKey getEncryptionKey() { return encryptionKey; } /** *

* The encryption key for the custom terminology being imported. *

* * @param encryptionKey

* The encryption key for the custom terminology being imported. *

*/ public void setEncryptionKey(EncryptionKey encryptionKey) { this.encryptionKey = encryptionKey; } /** *

* The encryption key for the custom terminology being imported. *

*

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

* The encryption key for the custom terminology being imported. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ImportTerminologyRequest withEncryptionKey(EncryptionKey encryptionKey) { this.encryptionKey = encryptionKey; return this; } /** *

* Tags to be associated with this resource. A tag is a key-value pair that * adds metadata to a resource. Each tag key for the resource must be * unique. For more information, see * Tagging your resources. *

* * @return

* Tags to be associated with this resource. A tag is a key-value * pair that adds metadata to a resource. Each tag key for the * resource must be unique. For more information, see * Tagging your resources. *

*/ public java.util.List getTags() { return tags; } /** *

* Tags to be associated with this resource. A tag is a key-value pair that * adds metadata to a resource. Each tag key for the resource must be * unique. For more information, see * Tagging your resources. *

* * @param tags

* Tags to be associated with this resource. A tag is a key-value * pair that adds metadata to a resource. Each tag key for the * resource must be unique. For more information, see Tagging your resources. *

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

* Tags to be associated with this resource. A tag is a key-value pair that * adds metadata to a resource. Each tag key for the resource must be * unique. For more information, see * Tagging your resources. *

*

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

* Tags to be associated with this resource. A tag is a key-value * pair that adds metadata to a resource. Each tag key for the * resource must be unique. For more information, see Tagging your resources. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ImportTerminologyRequest 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 be associated with this resource. A tag is a key-value pair that * adds metadata to a resource. Each tag key for the resource must be * unique. For more information, see * Tagging your resources. *

*

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

* Tags to be associated with this resource. A tag is a key-value * pair that adds metadata to a resource. Each tag key for the * resource must be unique. For more information, see Tagging your resources. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ImportTerminologyRequest 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 (getName() != null) sb.append("Name: " + getName() + ","); if (getMergeStrategy() != null) sb.append("MergeStrategy: " + getMergeStrategy() + ","); if (getDescription() != null) sb.append("Description: " + getDescription() + ","); if (getTerminologyData() != null) sb.append("TerminologyData: " + getTerminologyData() + ","); if (getEncryptionKey() != null) sb.append("EncryptionKey: " + getEncryptionKey() + ","); 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 + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getMergeStrategy() == null) ? 0 : getMergeStrategy().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getTerminologyData() == null) ? 0 : getTerminologyData().hashCode()); hashCode = prime * hashCode + ((getEncryptionKey() == null) ? 0 : getEncryptionKey().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 ImportTerminologyRequest == false) return false; ImportTerminologyRequest other = (ImportTerminologyRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getMergeStrategy() == null ^ this.getMergeStrategy() == null) return false; if (other.getMergeStrategy() != null && other.getMergeStrategy().equals(this.getMergeStrategy()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getTerminologyData() == null ^ this.getTerminologyData() == null) return false; if (other.getTerminologyData() != null && other.getTerminologyData().equals(this.getTerminologyData()) == false) return false; if (other.getEncryptionKey() == null ^ this.getEncryptionKey() == null) return false; if (other.getEncryptionKey() != null && other.getEncryptionKey().equals(this.getEncryptionKey()) == 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; } }