
com.amazonaws.services.imagebuilder.model.ImageSummary 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.imagebuilder.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An image summary.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ImageSummary implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resource Name (ARN) of the image.
*
*/
private String arn;
/**
*
* The name of the image.
*
*/
private String name;
/**
*
* Specifies whether this image produces an AMI or a container image.
*
*/
private String type;
/**
*
* The version of the image.
*
*/
private String version;
/**
*
* The image operating system platform, such as Linux or Windows.
*
*/
private String platform;
/**
*
* The operating system version of the instances that launch from this image. For example, Amazon Linux 2, Ubuntu
* 18, or Microsoft Windows Server 2019.
*
*/
private String osVersion;
/**
*
* The state of the image.
*
*/
private ImageState state;
/**
*
* The owner of the image.
*
*/
private String owner;
/**
*
* The date on which Image Builder created this image.
*
*/
private String dateCreated;
/**
*
* The output resources that Image Builder produced when it created this image.
*
*/
private OutputResources outputResources;
/**
*
* The tags that apply to this image.
*
*/
private java.util.Map tags;
/**
*
* Indicates the type of build that created this image. The build can be initiated in the following ways:
*
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
*
*/
private String buildType;
/**
*
* The origin of the base image that Image Builder used to build this image.
*
*/
private String imageSource;
/**
*
* The time when deprecation occurs for an image resource. This can be a past or future date.
*
*/
private java.util.Date deprecationTime;
/**
*
* Identifies the last runtime instance of the lifecycle policy to take action on the image.
*
*/
private String lifecycleExecutionId;
/**
*
* The Amazon Resource Name (ARN) of the image.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the image.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of the image.
*
*
* @return The Amazon Resource Name (ARN) of the image.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of the image.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The name of the image.
*
*
* @param name
* The name of the image.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the image.
*
*
* @return The name of the image.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the image.
*
*
* @param name
* The name of the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withName(String name) {
setName(name);
return this;
}
/**
*
* Specifies whether this image produces an AMI or a container image.
*
*
* @param type
* Specifies whether this image produces an AMI or a container image.
* @see ImageType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* Specifies whether this image produces an AMI or a container image.
*
*
* @return Specifies whether this image produces an AMI or a container image.
* @see ImageType
*/
public String getType() {
return this.type;
}
/**
*
* Specifies whether this image produces an AMI or a container image.
*
*
* @param type
* Specifies whether this image produces an AMI or a container image.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ImageType
*/
public ImageSummary withType(String type) {
setType(type);
return this;
}
/**
*
* Specifies whether this image produces an AMI or a container image.
*
*
* @param type
* Specifies whether this image produces an AMI or a container image.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ImageType
*/
public ImageSummary withType(ImageType type) {
this.type = type.toString();
return this;
}
/**
*
* The version of the image.
*
*
* @param version
* The version of the image.
*/
public void setVersion(String version) {
this.version = version;
}
/**
*
* The version of the image.
*
*
* @return The version of the image.
*/
public String getVersion() {
return this.version;
}
/**
*
* The version of the image.
*
*
* @param version
* The version of the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withVersion(String version) {
setVersion(version);
return this;
}
/**
*
* The image operating system platform, such as Linux or Windows.
*
*
* @param platform
* The image operating system platform, such as Linux or Windows.
* @see Platform
*/
public void setPlatform(String platform) {
this.platform = platform;
}
/**
*
* The image operating system platform, such as Linux or Windows.
*
*
* @return The image operating system platform, such as Linux or Windows.
* @see Platform
*/
public String getPlatform() {
return this.platform;
}
/**
*
* The image operating system platform, such as Linux or Windows.
*
*
* @param platform
* The image operating system platform, such as Linux or Windows.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Platform
*/
public ImageSummary withPlatform(String platform) {
setPlatform(platform);
return this;
}
/**
*
* The image operating system platform, such as Linux or Windows.
*
*
* @param platform
* The image operating system platform, such as Linux or Windows.
* @return Returns a reference to this object so that method calls can be chained together.
* @see Platform
*/
public ImageSummary withPlatform(Platform platform) {
this.platform = platform.toString();
return this;
}
/**
*
* The operating system version of the instances that launch from this image. For example, Amazon Linux 2, Ubuntu
* 18, or Microsoft Windows Server 2019.
*
*
* @param osVersion
* The operating system version of the instances that launch from this image. For example, Amazon Linux 2,
* Ubuntu 18, or Microsoft Windows Server 2019.
*/
public void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}
/**
*
* The operating system version of the instances that launch from this image. For example, Amazon Linux 2, Ubuntu
* 18, or Microsoft Windows Server 2019.
*
*
* @return The operating system version of the instances that launch from this image. For example, Amazon Linux 2,
* Ubuntu 18, or Microsoft Windows Server 2019.
*/
public String getOsVersion() {
return this.osVersion;
}
/**
*
* The operating system version of the instances that launch from this image. For example, Amazon Linux 2, Ubuntu
* 18, or Microsoft Windows Server 2019.
*
*
* @param osVersion
* The operating system version of the instances that launch from this image. For example, Amazon Linux 2,
* Ubuntu 18, or Microsoft Windows Server 2019.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withOsVersion(String osVersion) {
setOsVersion(osVersion);
return this;
}
/**
*
* The state of the image.
*
*
* @param state
* The state of the image.
*/
public void setState(ImageState state) {
this.state = state;
}
/**
*
* The state of the image.
*
*
* @return The state of the image.
*/
public ImageState getState() {
return this.state;
}
/**
*
* The state of the image.
*
*
* @param state
* The state of the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withState(ImageState state) {
setState(state);
return this;
}
/**
*
* The owner of the image.
*
*
* @param owner
* The owner of the image.
*/
public void setOwner(String owner) {
this.owner = owner;
}
/**
*
* The owner of the image.
*
*
* @return The owner of the image.
*/
public String getOwner() {
return this.owner;
}
/**
*
* The owner of the image.
*
*
* @param owner
* The owner of the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withOwner(String owner) {
setOwner(owner);
return this;
}
/**
*
* The date on which Image Builder created this image.
*
*
* @param dateCreated
* The date on which Image Builder created this image.
*/
public void setDateCreated(String dateCreated) {
this.dateCreated = dateCreated;
}
/**
*
* The date on which Image Builder created this image.
*
*
* @return The date on which Image Builder created this image.
*/
public String getDateCreated() {
return this.dateCreated;
}
/**
*
* The date on which Image Builder created this image.
*
*
* @param dateCreated
* The date on which Image Builder created this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withDateCreated(String dateCreated) {
setDateCreated(dateCreated);
return this;
}
/**
*
* The output resources that Image Builder produced when it created this image.
*
*
* @param outputResources
* The output resources that Image Builder produced when it created this image.
*/
public void setOutputResources(OutputResources outputResources) {
this.outputResources = outputResources;
}
/**
*
* The output resources that Image Builder produced when it created this image.
*
*
* @return The output resources that Image Builder produced when it created this image.
*/
public OutputResources getOutputResources() {
return this.outputResources;
}
/**
*
* The output resources that Image Builder produced when it created this image.
*
*
* @param outputResources
* The output resources that Image Builder produced when it created this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withOutputResources(OutputResources outputResources) {
setOutputResources(outputResources);
return this;
}
/**
*
* The tags that apply to this image.
*
*
* @return The tags that apply to this image.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* The tags that apply to this image.
*
*
* @param tags
* The tags that apply to this image.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* The tags that apply to this image.
*
*
* @param tags
* The tags that apply to this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see ImageSummary#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary 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 ImageSummary clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* Indicates the type of build that created this image. The build can be initiated in the following ways:
*
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
*
*
* @param buildType
* Indicates the type of build that created this image. The build can be initiated in the following ways:
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
* @see BuildType
*/
public void setBuildType(String buildType) {
this.buildType = buildType;
}
/**
*
* Indicates the type of build that created this image. The build can be initiated in the following ways:
*
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
*
*
* @return Indicates the type of build that created this image. The build can be initiated in the following
* ways:
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
* @see BuildType
*/
public String getBuildType() {
return this.buildType;
}
/**
*
* Indicates the type of build that created this image. The build can be initiated in the following ways:
*
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
*
*
* @param buildType
* Indicates the type of build that created this image. The build can be initiated in the following ways:
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see BuildType
*/
public ImageSummary withBuildType(String buildType) {
setBuildType(buildType);
return this;
}
/**
*
* Indicates the type of build that created this image. The build can be initiated in the following ways:
*
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
*
*
* @param buildType
* Indicates the type of build that created this image. The build can be initiated in the following ways:
*
* -
*
* USER_INITIATED – A manual pipeline build request.
*
*
* -
*
* SCHEDULED – A pipeline build initiated by a cron expression in the Image Builder pipeline, or from
* EventBridge.
*
*
* -
*
* IMPORT – A VM import created the image to use as the base image for the recipe.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see BuildType
*/
public ImageSummary withBuildType(BuildType buildType) {
this.buildType = buildType.toString();
return this;
}
/**
*
* The origin of the base image that Image Builder used to build this image.
*
*
* @param imageSource
* The origin of the base image that Image Builder used to build this image.
* @see ImageSource
*/
public void setImageSource(String imageSource) {
this.imageSource = imageSource;
}
/**
*
* The origin of the base image that Image Builder used to build this image.
*
*
* @return The origin of the base image that Image Builder used to build this image.
* @see ImageSource
*/
public String getImageSource() {
return this.imageSource;
}
/**
*
* The origin of the base image that Image Builder used to build this image.
*
*
* @param imageSource
* The origin of the base image that Image Builder used to build this image.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ImageSource
*/
public ImageSummary withImageSource(String imageSource) {
setImageSource(imageSource);
return this;
}
/**
*
* The origin of the base image that Image Builder used to build this image.
*
*
* @param imageSource
* The origin of the base image that Image Builder used to build this image.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ImageSource
*/
public ImageSummary withImageSource(ImageSource imageSource) {
this.imageSource = imageSource.toString();
return this;
}
/**
*
* The time when deprecation occurs for an image resource. This can be a past or future date.
*
*
* @param deprecationTime
* The time when deprecation occurs for an image resource. This can be a past or future date.
*/
public void setDeprecationTime(java.util.Date deprecationTime) {
this.deprecationTime = deprecationTime;
}
/**
*
* The time when deprecation occurs for an image resource. This can be a past or future date.
*
*
* @return The time when deprecation occurs for an image resource. This can be a past or future date.
*/
public java.util.Date getDeprecationTime() {
return this.deprecationTime;
}
/**
*
* The time when deprecation occurs for an image resource. This can be a past or future date.
*
*
* @param deprecationTime
* The time when deprecation occurs for an image resource. This can be a past or future date.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withDeprecationTime(java.util.Date deprecationTime) {
setDeprecationTime(deprecationTime);
return this;
}
/**
*
* Identifies the last runtime instance of the lifecycle policy to take action on the image.
*
*
* @param lifecycleExecutionId
* Identifies the last runtime instance of the lifecycle policy to take action on the image.
*/
public void setLifecycleExecutionId(String lifecycleExecutionId) {
this.lifecycleExecutionId = lifecycleExecutionId;
}
/**
*
* Identifies the last runtime instance of the lifecycle policy to take action on the image.
*
*
* @return Identifies the last runtime instance of the lifecycle policy to take action on the image.
*/
public String getLifecycleExecutionId() {
return this.lifecycleExecutionId;
}
/**
*
* Identifies the last runtime instance of the lifecycle policy to take action on the image.
*
*
* @param lifecycleExecutionId
* Identifies the last runtime instance of the lifecycle policy to take action on the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ImageSummary withLifecycleExecutionId(String lifecycleExecutionId) {
setLifecycleExecutionId(lifecycleExecutionId);
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 (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getVersion() != null)
sb.append("Version: ").append(getVersion()).append(",");
if (getPlatform() != null)
sb.append("Platform: ").append(getPlatform()).append(",");
if (getOsVersion() != null)
sb.append("OsVersion: ").append(getOsVersion()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getOwner() != null)
sb.append("Owner: ").append(getOwner()).append(",");
if (getDateCreated() != null)
sb.append("DateCreated: ").append(getDateCreated()).append(",");
if (getOutputResources() != null)
sb.append("OutputResources: ").append(getOutputResources()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getBuildType() != null)
sb.append("BuildType: ").append(getBuildType()).append(",");
if (getImageSource() != null)
sb.append("ImageSource: ").append(getImageSource()).append(",");
if (getDeprecationTime() != null)
sb.append("DeprecationTime: ").append(getDeprecationTime()).append(",");
if (getLifecycleExecutionId() != null)
sb.append("LifecycleExecutionId: ").append(getLifecycleExecutionId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ImageSummary == false)
return false;
ImageSummary other = (ImageSummary) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == 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.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == 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.getOsVersion() == null ^ this.getOsVersion() == null)
return false;
if (other.getOsVersion() != null && other.getOsVersion().equals(this.getOsVersion()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getOwner() == null ^ this.getOwner() == null)
return false;
if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false)
return false;
if (other.getDateCreated() == null ^ this.getDateCreated() == null)
return false;
if (other.getDateCreated() != null && other.getDateCreated().equals(this.getDateCreated()) == false)
return false;
if (other.getOutputResources() == null ^ this.getOutputResources() == null)
return false;
if (other.getOutputResources() != null && other.getOutputResources().equals(this.getOutputResources()) == 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.getBuildType() == null ^ this.getBuildType() == null)
return false;
if (other.getBuildType() != null && other.getBuildType().equals(this.getBuildType()) == false)
return false;
if (other.getImageSource() == null ^ this.getImageSource() == null)
return false;
if (other.getImageSource() != null && other.getImageSource().equals(this.getImageSource()) == false)
return false;
if (other.getDeprecationTime() == null ^ this.getDeprecationTime() == null)
return false;
if (other.getDeprecationTime() != null && other.getDeprecationTime().equals(this.getDeprecationTime()) == false)
return false;
if (other.getLifecycleExecutionId() == null ^ this.getLifecycleExecutionId() == null)
return false;
if (other.getLifecycleExecutionId() != null && other.getLifecycleExecutionId().equals(this.getLifecycleExecutionId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode());
hashCode = prime * hashCode + ((getOsVersion() == null) ? 0 : getOsVersion().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode());
hashCode = prime * hashCode + ((getDateCreated() == null) ? 0 : getDateCreated().hashCode());
hashCode = prime * hashCode + ((getOutputResources() == null) ? 0 : getOutputResources().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getBuildType() == null) ? 0 : getBuildType().hashCode());
hashCode = prime * hashCode + ((getImageSource() == null) ? 0 : getImageSource().hashCode());
hashCode = prime * hashCode + ((getDeprecationTime() == null) ? 0 : getDeprecationTime().hashCode());
hashCode = prime * hashCode + ((getLifecycleExecutionId() == null) ? 0 : getLifecycleExecutionId().hashCode());
return hashCode;
}
@Override
public ImageSummary clone() {
try {
return (ImageSummary) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.imagebuilder.model.transform.ImageSummaryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}