/* * Copyright 2018-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.imagebuilder.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ImportComponentRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The name of the component. *

*/ private String name; /** *

* The semantic version of the component. This version follows the semantic version syntax. *

* *

* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign * values for the first three, and can filter on all of them. *

*

* Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most * recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in * any node, all nodes to the right of the first wildcard must also be wildcards. *

*
*/ private String semanticVersion; /** *

* The description of the component. Describes the contents of the component. *

*/ private String description; /** *

* The change description of the component. This description indicates the change that has been made in this * version, or what makes this version different from other versions of this component. *

*/ private String changeDescription; /** *

* The type of the component denotes whether the component is used to build the image, or only to test it. *

*/ private String type; /** *

* The format of the resource that you want to import as a component. *

*/ private String format; /** *

* The platform of the component. *

*/ private String platform; /** *

* The data of the component. Used to specify the data inline. Either data or uri can be * used to specify the data within the component. *

*/ private String data; /** *

* The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the Amazon S3 * bucket. If you use Amazon S3, you can specify component content up to your service quota. Either * data or uri can be used to specify the data within the component. *

*/ private String uri; /** *

* The ID of the KMS key that should be used to encrypt this component. *

*/ private String kmsKeyId; /** *

* The tags of the component. *

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

* The idempotency token of the component. *

*/ private String clientToken; /** *

* The name of the component. *

* * @param name * The name of the component. */ public void setName(String name) { this.name = name; } /** *

* The name of the component. *

* * @return The name of the component. */ public String getName() { return this.name; } /** *

* The name of the component. *

* * @param name * The name of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withName(String name) { setName(name); return this; } /** *

* The semantic version of the component. This version follows the semantic version syntax. *

* *

* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign * values for the first three, and can filter on all of them. *

*

* Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most * recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in * any node, all nodes to the right of the first wildcard must also be wildcards. *

*
* * @param semanticVersion * The semantic version of the component. This version follows the semantic version syntax.

*

* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can * assign values for the first three, and can filter on all of them. *

*

* Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the * most recent versions or nodes when selecting the base image or components for your recipe. When you use a * wildcard in any node, all nodes to the right of the first wildcard must also be wildcards. *

*/ public void setSemanticVersion(String semanticVersion) { this.semanticVersion = semanticVersion; } /** *

* The semantic version of the component. This version follows the semantic version syntax. *

* *

* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign * values for the first three, and can filter on all of them. *

*

* Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most * recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in * any node, all nodes to the right of the first wildcard must also be wildcards. *

*
* * @return The semantic version of the component. This version follows the semantic version syntax.

*

* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can * assign values for the first three, and can filter on all of them. *

*

* Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the * most recent versions or nodes when selecting the base image or components for your recipe. When you use a * wildcard in any node, all nodes to the right of the first wildcard must also be wildcards. *

*/ public String getSemanticVersion() { return this.semanticVersion; } /** *

* The semantic version of the component. This version follows the semantic version syntax. *

* *

* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can assign * values for the first three, and can filter on all of them. *

*

* Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the most * recent versions or nodes when selecting the base image or components for your recipe. When you use a wildcard in * any node, all nodes to the right of the first wildcard must also be wildcards. *

*
* * @param semanticVersion * The semantic version of the component. This version follows the semantic version syntax.

*

* The semantic version has four nodes: <major>.<minor>.<patch>/<build>. You can * assign values for the first three, and can filter on all of them. *

*

* Filtering: With semantic versioning, you have the flexibility to use wildcards (x) to specify the * most recent versions or nodes when selecting the base image or components for your recipe. When you use a * wildcard in any node, all nodes to the right of the first wildcard must also be wildcards. *

* @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withSemanticVersion(String semanticVersion) { setSemanticVersion(semanticVersion); return this; } /** *

* The description of the component. Describes the contents of the component. *

* * @param description * The description of the component. Describes the contents of the component. */ public void setDescription(String description) { this.description = description; } /** *

* The description of the component. Describes the contents of the component. *

* * @return The description of the component. Describes the contents of the component. */ public String getDescription() { return this.description; } /** *

* The description of the component. Describes the contents of the component. *

* * @param description * The description of the component. Describes the contents of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withDescription(String description) { setDescription(description); return this; } /** *

* The change description of the component. This description indicates the change that has been made in this * version, or what makes this version different from other versions of this component. *

* * @param changeDescription * The change description of the component. This description indicates the change that has been made in this * version, or what makes this version different from other versions of this component. */ public void setChangeDescription(String changeDescription) { this.changeDescription = changeDescription; } /** *

* The change description of the component. This description indicates the change that has been made in this * version, or what makes this version different from other versions of this component. *

* * @return The change description of the component. This description indicates the change that has been made in this * version, or what makes this version different from other versions of this component. */ public String getChangeDescription() { return this.changeDescription; } /** *

* The change description of the component. This description indicates the change that has been made in this * version, or what makes this version different from other versions of this component. *

* * @param changeDescription * The change description of the component. This description indicates the change that has been made in this * version, or what makes this version different from other versions of this component. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withChangeDescription(String changeDescription) { setChangeDescription(changeDescription); return this; } /** *

* The type of the component denotes whether the component is used to build the image, or only to test it. *

* * @param type * The type of the component denotes whether the component is used to build the image, or only to test it. * @see ComponentType */ public void setType(String type) { this.type = type; } /** *

* The type of the component denotes whether the component is used to build the image, or only to test it. *

* * @return The type of the component denotes whether the component is used to build the image, or only to test it. * @see ComponentType */ public String getType() { return this.type; } /** *

* The type of the component denotes whether the component is used to build the image, or only to test it. *

* * @param type * The type of the component denotes whether the component is used to build the image, or only to test it. * @return Returns a reference to this object so that method calls can be chained together. * @see ComponentType */ public ImportComponentRequest withType(String type) { setType(type); return this; } /** *

* The type of the component denotes whether the component is used to build the image, or only to test it. *

* * @param type * The type of the component denotes whether the component is used to build the image, or only to test it. * @return Returns a reference to this object so that method calls can be chained together. * @see ComponentType */ public ImportComponentRequest withType(ComponentType type) { this.type = type.toString(); return this; } /** *

* The format of the resource that you want to import as a component. *

* * @param format * The format of the resource that you want to import as a component. * @see ComponentFormat */ public void setFormat(String format) { this.format = format; } /** *

* The format of the resource that you want to import as a component. *

* * @return The format of the resource that you want to import as a component. * @see ComponentFormat */ public String getFormat() { return this.format; } /** *

* The format of the resource that you want to import as a component. *

* * @param format * The format of the resource that you want to import as a component. * @return Returns a reference to this object so that method calls can be chained together. * @see ComponentFormat */ public ImportComponentRequest withFormat(String format) { setFormat(format); return this; } /** *

* The format of the resource that you want to import as a component. *

* * @param format * The format of the resource that you want to import as a component. * @return Returns a reference to this object so that method calls can be chained together. * @see ComponentFormat */ public ImportComponentRequest withFormat(ComponentFormat format) { this.format = format.toString(); return this; } /** *

* The platform of the component. *

* * @param platform * The platform of the component. * @see Platform */ public void setPlatform(String platform) { this.platform = platform; } /** *

* The platform of the component. *

* * @return The platform of the component. * @see Platform */ public String getPlatform() { return this.platform; } /** *

* The platform of the component. *

* * @param platform * The platform of the component. * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ public ImportComponentRequest withPlatform(String platform) { setPlatform(platform); return this; } /** *

* The platform of the component. *

* * @param platform * The platform of the component. * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ public ImportComponentRequest withPlatform(Platform platform) { this.platform = platform.toString(); return this; } /** *

* The data of the component. Used to specify the data inline. Either data or uri can be * used to specify the data within the component. *

* * @param data * The data of the component. Used to specify the data inline. Either data or uri * can be used to specify the data within the component. */ public void setData(String data) { this.data = data; } /** *

* The data of the component. Used to specify the data inline. Either data or uri can be * used to specify the data within the component. *

* * @return The data of the component. Used to specify the data inline. Either data or uri * can be used to specify the data within the component. */ public String getData() { return this.data; } /** *

* The data of the component. Used to specify the data inline. Either data or uri can be * used to specify the data within the component. *

* * @param data * The data of the component. Used to specify the data inline. Either data or uri * can be used to specify the data within the component. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withData(String data) { setData(data); return this; } /** *

* The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the Amazon S3 * bucket. If you use Amazon S3, you can specify component content up to your service quota. Either * data or uri can be used to specify the data within the component. *

* * @param uri * The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the * Amazon S3 bucket. If you use Amazon S3, you can specify component content up to your service quota. Either * data or uri can be used to specify the data within the component. */ public void setUri(String uri) { this.uri = uri; } /** *

* The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the Amazon S3 * bucket. If you use Amazon S3, you can specify component content up to your service quota. Either * data or uri can be used to specify the data within the component. *

* * @return The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the * Amazon S3 bucket. If you use Amazon S3, you can specify component content up to your service quota. * Either data or uri can be used to specify the data within the component. */ public String getUri() { return this.uri; } /** *

* The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the Amazon S3 * bucket. If you use Amazon S3, you can specify component content up to your service quota. Either * data or uri can be used to specify the data within the component. *

* * @param uri * The uri of the component. Must be an Amazon S3 URL and the requester must have permission to access the * Amazon S3 bucket. If you use Amazon S3, you can specify component content up to your service quota. Either * data or uri can be used to specify the data within the component. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withUri(String uri) { setUri(uri); return this; } /** *

* The ID of the KMS key that should be used to encrypt this component. *

* * @param kmsKeyId * The ID of the KMS key that should be used to encrypt this component. */ public void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } /** *

* The ID of the KMS key that should be used to encrypt this component. *

* * @return The ID of the KMS key that should be used to encrypt this component. */ public String getKmsKeyId() { return this.kmsKeyId; } /** *

* The ID of the KMS key that should be used to encrypt this component. *

* * @param kmsKeyId * The ID of the KMS key that should be used to encrypt this component. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withKmsKeyId(String kmsKeyId) { setKmsKeyId(kmsKeyId); return this; } /** *

* The tags of the component. *

* * @return The tags of the component. */ public java.util.Map getTags() { return tags; } /** *

* The tags of the component. *

* * @param tags * The tags of the component. */ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* The tags of the component. *

* * @param tags * The tags of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see ImportComponentRequest#withTags * @returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest 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 ImportComponentRequest clearTagsEntries() { this.tags = null; return this; } /** *

* The idempotency token of the component. *

* * @param clientToken * The idempotency token of the component. */ public void setClientToken(String clientToken) { this.clientToken = clientToken; } /** *

* The idempotency token of the component. *

* * @return The idempotency token of the component. */ public String getClientToken() { return this.clientToken; } /** *

* The idempotency token of the component. *

* * @param clientToken * The idempotency token of the component. * @return Returns a reference to this object so that method calls can be chained together. */ public ImportComponentRequest withClientToken(String clientToken) { setClientToken(clientToken); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getSemanticVersion() != null) sb.append("SemanticVersion: ").append(getSemanticVersion()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getChangeDescription() != null) sb.append("ChangeDescription: ").append(getChangeDescription()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getFormat() != null) sb.append("Format: ").append(getFormat()).append(","); if (getPlatform() != null) sb.append("Platform: ").append(getPlatform()).append(","); if (getData() != null) sb.append("Data: ").append(getData()).append(","); if (getUri() != null) sb.append("Uri: ").append(getUri()).append(","); if (getKmsKeyId() != null) sb.append("KmsKeyId: ").append(getKmsKeyId()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getClientToken() != null) sb.append("ClientToken: ").append(getClientToken()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ImportComponentRequest == false) return false; ImportComponentRequest other = (ImportComponentRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getSemanticVersion() == null ^ this.getSemanticVersion() == null) return false; if (other.getSemanticVersion() != null && other.getSemanticVersion().equals(this.getSemanticVersion()) == 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.getChangeDescription() == null ^ this.getChangeDescription() == null) return false; if (other.getChangeDescription() != null && other.getChangeDescription().equals(this.getChangeDescription()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getFormat() == null ^ this.getFormat() == null) return false; if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == false) return false; if (other.getPlatform() == null ^ this.getPlatform() == null) return false; if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == false) return false; if (other.getData() == null ^ this.getData() == null) return false; if (other.getData() != null && other.getData().equals(this.getData()) == false) return false; if (other.getUri() == null ^ this.getUri() == null) return false; if (other.getUri() != null && other.getUri().equals(this.getUri()) == false) return false; if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null) return false; if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getClientToken() == null ^ this.getClientToken() == null) return false; if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getSemanticVersion() == null) ? 0 : getSemanticVersion().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getChangeDescription() == null) ? 0 : getChangeDescription().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode()); hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode()); hashCode = prime * hashCode + ((getData() == null) ? 0 : getData().hashCode()); hashCode = prime * hashCode + ((getUri() == null) ? 0 : getUri().hashCode()); hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); return hashCode; } @Override public ImportComponentRequest clone() { return (ImportComponentRequest) super.clone(); } }