/* * 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 CreateImageRecipeRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The name of the image recipe. *
*/ private String name; /** ** The description of the image recipe. *
*/ private String description; /** ** The semantic version of the image recipe. 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. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, with an * upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the * fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that * you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as * 2021.01.01. *
** The components included in the image recipe. *
*/ private java.util.List
* The base image of the image recipe. The value of the string can be the ARN of the base image or an AMI ID. The
* format for the ARN follows this example:
* arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x
. You can
* provide the specific version that you want to use, or you can use a wildcard in all of the fields. If you enter
* an AMI ID for the string value, you must have access to the AMI, and the AMI must be in the same Region in which
* you are using Image Builder.
*
* The block device mappings of the image recipe. *
*/ private java.util.List* The tags of the image recipe. *
*/ private java.util.Map* The working directory used during build and test workflows. *
*/ private String workingDirectory; /** ** Specify additional settings and launch scripts for your build instances. *
*/ private AdditionalInstanceConfiguration additionalInstanceConfiguration; /** ** The idempotency token used to make this request idempotent. *
*/ private String clientToken; /** ** The name of the image recipe. *
* * @param name * The name of the image recipe. */ public void setName(String name) { this.name = name; } /** ** The name of the image recipe. *
* * @return The name of the image recipe. */ public String getName() { return this.name; } /** ** The name of the image recipe. *
* * @param name * The name of the image recipe. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withName(String name) { setName(name); return this; } /** ** The description of the image recipe. *
* * @param description * The description of the image recipe. */ public void setDescription(String description) { this.description = description; } /** ** The description of the image recipe. *
* * @return The description of the image recipe. */ public String getDescription() { return this.description; } /** ** The description of the image recipe. *
* * @param description * The description of the image recipe. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withDescription(String description) { setDescription(description); return this; } /** ** The semantic version of the image recipe. 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. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, with an * upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the * fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that * you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as * 2021.01.01. *
** 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. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, * with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build * number to the fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes * that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, * such as 2021.01.01. *
*/ public void setSemanticVersion(String semanticVersion) { this.semanticVersion = semanticVersion; } /** ** The semantic version of the image recipe. 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. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, with an * upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the * fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that * you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as * 2021.01.01. *
** 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. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, * with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build * number to the fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the * nodes that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a * date, such as 2021.01.01. *
*/ public String getSemanticVersion() { return this.semanticVersion; } /** ** The semantic version of the image recipe. 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. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, with an * upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build number to the * fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes that * you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, such as * 2021.01.01. *
** 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. *
** Assignment: For the first three nodes you can assign any positive integer value, including zero, * with an upper limit of 2^30-1, or 1073741823 for each node. Image Builder automatically assigns the build * number to the fourth node. *
** Patterns: You can use any numeric pattern that adheres to the assignment requirements for the nodes * that you can assign. For example, you might choose a software version pattern, such as 1.0.0, or a date, * such as 2021.01.01. *
* @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withSemanticVersion(String semanticVersion) { setSemanticVersion(semanticVersion); return this; } /** ** The components included in the image recipe. *
* * @return The components included in the image recipe. */ public java.util.List* The components included in the image recipe. *
* * @param components * The components included in the image recipe. */ public void setComponents(java.util.Collection* The components included in the image recipe. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setComponents(java.util.Collection)} or {@link #withComponents(java.util.Collection)} if you want to * override the existing values. *
* * @param components * The components included in the image recipe. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withComponents(ComponentConfiguration... components) { if (this.components == null) { setComponents(new java.util.ArrayList* The components included in the image recipe. *
* * @param components * The components included in the image recipe. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withComponents(java.util.Collection
* The base image of the image recipe. The value of the string can be the ARN of the base image or an AMI ID. The
* format for the ARN follows this example:
* arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x
. You can
* provide the specific version that you want to use, or you can use a wildcard in all of the fields. If you enter
* an AMI ID for the string value, you must have access to the AMI, and the AMI must be in the same Region in which
* you are using Image Builder.
*
arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x
. You
* can provide the specific version that you want to use, or you can use a wildcard in all of the fields. If
* you enter an AMI ID for the string value, you must have access to the AMI, and the AMI must be in the same
* Region in which you are using Image Builder.
*/
public void setParentImage(String parentImage) {
this.parentImage = parentImage;
}
/**
*
* The base image of the image recipe. The value of the string can be the ARN of the base image or an AMI ID. The
* format for the ARN follows this example:
* arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x
. You can
* provide the specific version that you want to use, or you can use a wildcard in all of the fields. If you enter
* an AMI ID for the string value, you must have access to the AMI, and the AMI must be in the same Region in which
* you are using Image Builder.
*
arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x
.
* You can provide the specific version that you want to use, or you can use a wildcard in all of the
* fields. If you enter an AMI ID for the string value, you must have access to the AMI, and the AMI must be
* in the same Region in which you are using Image Builder.
*/
public String getParentImage() {
return this.parentImage;
}
/**
*
* The base image of the image recipe. The value of the string can be the ARN of the base image or an AMI ID. The
* format for the ARN follows this example:
* arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x
. You can
* provide the specific version that you want to use, or you can use a wildcard in all of the fields. If you enter
* an AMI ID for the string value, you must have access to the AMI, and the AMI must be in the same Region in which
* you are using Image Builder.
*
arn:aws:imagebuilder:us-west-2:aws:image/windows-server-2016-english-full-base-x86/x.x.x
. You
* can provide the specific version that you want to use, or you can use a wildcard in all of the fields. If
* you enter an AMI ID for the string value, you must have access to the AMI, and the AMI must be in the same
* Region in which you are using Image Builder.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateImageRecipeRequest withParentImage(String parentImage) {
setParentImage(parentImage);
return this;
}
/**
* * The block device mappings of the image recipe. *
* * @return The block device mappings of the image recipe. */ public java.util.List* The block device mappings of the image recipe. *
* * @param blockDeviceMappings * The block device mappings of the image recipe. */ public void setBlockDeviceMappings(java.util.Collection* The block device mappings of the image recipe. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setBlockDeviceMappings(java.util.Collection)} or {@link #withBlockDeviceMappings(java.util.Collection)} * if you want to override the existing values. *
* * @param blockDeviceMappings * The block device mappings of the image recipe. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withBlockDeviceMappings(InstanceBlockDeviceMapping... blockDeviceMappings) { if (this.blockDeviceMappings == null) { setBlockDeviceMappings(new java.util.ArrayList* The block device mappings of the image recipe. *
* * @param blockDeviceMappings * The block device mappings of the image recipe. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withBlockDeviceMappings(java.util.Collection* The tags of the image recipe. *
* * @return The tags of the image recipe. */ public java.util.Map* The tags of the image recipe. *
* * @param tags * The tags of the image recipe. */ public void setTags(java.util.Map* The tags of the image recipe. *
* * @param tags * The tags of the image recipe. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withTags(java.util.Map* The working directory used during build and test workflows. *
* * @param workingDirectory * The working directory used during build and test workflows. */ public void setWorkingDirectory(String workingDirectory) { this.workingDirectory = workingDirectory; } /** ** The working directory used during build and test workflows. *
* * @return The working directory used during build and test workflows. */ public String getWorkingDirectory() { return this.workingDirectory; } /** ** The working directory used during build and test workflows. *
* * @param workingDirectory * The working directory used during build and test workflows. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withWorkingDirectory(String workingDirectory) { setWorkingDirectory(workingDirectory); return this; } /** ** Specify additional settings and launch scripts for your build instances. *
* * @param additionalInstanceConfiguration * Specify additional settings and launch scripts for your build instances. */ public void setAdditionalInstanceConfiguration(AdditionalInstanceConfiguration additionalInstanceConfiguration) { this.additionalInstanceConfiguration = additionalInstanceConfiguration; } /** ** Specify additional settings and launch scripts for your build instances. *
* * @return Specify additional settings and launch scripts for your build instances. */ public AdditionalInstanceConfiguration getAdditionalInstanceConfiguration() { return this.additionalInstanceConfiguration; } /** ** Specify additional settings and launch scripts for your build instances. *
* * @param additionalInstanceConfiguration * Specify additional settings and launch scripts for your build instances. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest withAdditionalInstanceConfiguration(AdditionalInstanceConfiguration additionalInstanceConfiguration) { setAdditionalInstanceConfiguration(additionalInstanceConfiguration); return this; } /** ** The idempotency token used to make this request idempotent. *
* * @param clientToken * The idempotency token used to make this request idempotent. */ public void setClientToken(String clientToken) { this.clientToken = clientToken; } /** ** The idempotency token used to make this request idempotent. *
* * @return The idempotency token used to make this request idempotent. */ public String getClientToken() { return this.clientToken; } /** ** The idempotency token used to make this request idempotent. *
* * @param clientToken * The idempotency token used to make this request idempotent. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateImageRecipeRequest 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 (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getSemanticVersion() != null) sb.append("SemanticVersion: ").append(getSemanticVersion()).append(","); if (getComponents() != null) sb.append("Components: ").append(getComponents()).append(","); if (getParentImage() != null) sb.append("ParentImage: ").append(getParentImage()).append(","); if (getBlockDeviceMappings() != null) sb.append("BlockDeviceMappings: ").append(getBlockDeviceMappings()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getWorkingDirectory() != null) sb.append("WorkingDirectory: ").append(getWorkingDirectory()).append(","); if (getAdditionalInstanceConfiguration() != null) sb.append("AdditionalInstanceConfiguration: ").append(getAdditionalInstanceConfiguration()).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 CreateImageRecipeRequest == false) return false; CreateImageRecipeRequest other = (CreateImageRecipeRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == 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.getSemanticVersion() == null ^ this.getSemanticVersion() == null) return false; if (other.getSemanticVersion() != null && other.getSemanticVersion().equals(this.getSemanticVersion()) == false) return false; if (other.getComponents() == null ^ this.getComponents() == null) return false; if (other.getComponents() != null && other.getComponents().equals(this.getComponents()) == false) return false; if (other.getParentImage() == null ^ this.getParentImage() == null) return false; if (other.getParentImage() != null && other.getParentImage().equals(this.getParentImage()) == false) return false; if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null) return false; if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == 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.getWorkingDirectory() == null ^ this.getWorkingDirectory() == null) return false; if (other.getWorkingDirectory() != null && other.getWorkingDirectory().equals(this.getWorkingDirectory()) == false) return false; if (other.getAdditionalInstanceConfiguration() == null ^ this.getAdditionalInstanceConfiguration() == null) return false; if (other.getAdditionalInstanceConfiguration() != null && other.getAdditionalInstanceConfiguration().equals(this.getAdditionalInstanceConfiguration()) == 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 + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getSemanticVersion() == null) ? 0 : getSemanticVersion().hashCode()); hashCode = prime * hashCode + ((getComponents() == null) ? 0 : getComponents().hashCode()); hashCode = prime * hashCode + ((getParentImage() == null) ? 0 : getParentImage().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getWorkingDirectory() == null) ? 0 : getWorkingDirectory().hashCode()); hashCode = prime * hashCode + ((getAdditionalInstanceConfiguration() == null) ? 0 : getAdditionalInstanceConfiguration().hashCode()); hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); return hashCode; } @Override public CreateImageRecipeRequest clone() { return (CreateImageRecipeRequest) super.clone(); } }