Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.imagebuilder.model.Image Maven / Gradle / Ivy
/*
* Copyright 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 software.amazon.awssdk.services.imagebuilder.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* An image build version.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Image implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Image::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Image::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Image::version)).setter(setter(Builder::version))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build();
private static final SdkField PLATFORM_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Image::platformAsString)).setter(setter(Builder::platform))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("platform").build()).build();
private static final SdkField ENHANCED_IMAGE_METADATA_ENABLED_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.getter(getter(Image::enhancedImageMetadataEnabled))
.setter(setter(Builder::enhancedImageMetadataEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("enhancedImageMetadataEnabled")
.build()).build();
private static final SdkField OS_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Image::osVersion)).setter(setter(Builder::osVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("osVersion").build()).build();
private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(Image::state)).setter(setter(Builder::state)).constructor(ImageState::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("state").build()).build();
private static final SdkField IMAGE_RECIPE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(Image::imageRecipe)).setter(setter(Builder::imageRecipe)).constructor(ImageRecipe::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imageRecipe").build()).build();
private static final SdkField SOURCE_PIPELINE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Image::sourcePipelineName)).setter(setter(Builder::sourcePipelineName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourcePipelineName").build())
.build();
private static final SdkField SOURCE_PIPELINE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Image::sourcePipelineArn)).setter(setter(Builder::sourcePipelineArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sourcePipelineArn").build()).build();
private static final SdkField INFRASTRUCTURE_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(Image::infrastructureConfiguration))
.setter(setter(Builder::infrastructureConfiguration))
.constructor(InfrastructureConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("infrastructureConfiguration")
.build()).build();
private static final SdkField DISTRIBUTION_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(Image::distributionConfiguration))
.setter(setter(Builder::distributionConfiguration)).constructor(DistributionConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("distributionConfiguration").build())
.build();
private static final SdkField IMAGE_TESTS_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(Image::imageTestsConfiguration))
.setter(setter(Builder::imageTestsConfiguration)).constructor(ImageTestsConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imageTestsConfiguration").build())
.build();
private static final SdkField DATE_CREATED_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Image::dateCreated)).setter(setter(Builder::dateCreated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dateCreated").build()).build();
private static final SdkField OUTPUT_RESOURCES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(Image::outputResources))
.setter(setter(Builder::outputResources)).constructor(OutputResources::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("outputResources").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.getter(getter(Image::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, NAME_FIELD,
VERSION_FIELD, PLATFORM_FIELD, ENHANCED_IMAGE_METADATA_ENABLED_FIELD, OS_VERSION_FIELD, STATE_FIELD,
IMAGE_RECIPE_FIELD, SOURCE_PIPELINE_NAME_FIELD, SOURCE_PIPELINE_ARN_FIELD, INFRASTRUCTURE_CONFIGURATION_FIELD,
DISTRIBUTION_CONFIGURATION_FIELD, IMAGE_TESTS_CONFIGURATION_FIELD, DATE_CREATED_FIELD, OUTPUT_RESOURCES_FIELD,
TAGS_FIELD));
private static final long serialVersionUID = 1L;
private final String arn;
private final String name;
private final String version;
private final String platform;
private final Boolean enhancedImageMetadataEnabled;
private final String osVersion;
private final ImageState state;
private final ImageRecipe imageRecipe;
private final String sourcePipelineName;
private final String sourcePipelineArn;
private final InfrastructureConfiguration infrastructureConfiguration;
private final DistributionConfiguration distributionConfiguration;
private final ImageTestsConfiguration imageTestsConfiguration;
private final String dateCreated;
private final OutputResources outputResources;
private final Map tags;
private Image(BuilderImpl builder) {
this.arn = builder.arn;
this.name = builder.name;
this.version = builder.version;
this.platform = builder.platform;
this.enhancedImageMetadataEnabled = builder.enhancedImageMetadataEnabled;
this.osVersion = builder.osVersion;
this.state = builder.state;
this.imageRecipe = builder.imageRecipe;
this.sourcePipelineName = builder.sourcePipelineName;
this.sourcePipelineArn = builder.sourcePipelineArn;
this.infrastructureConfiguration = builder.infrastructureConfiguration;
this.distributionConfiguration = builder.distributionConfiguration;
this.imageTestsConfiguration = builder.imageTestsConfiguration;
this.dateCreated = builder.dateCreated;
this.outputResources = builder.outputResources;
this.tags = builder.tags;
}
/**
*
* The Amazon Resource Name (ARN) of the image.
*
*
* @return The Amazon Resource Name (ARN) of the image.
*/
public String arn() {
return arn;
}
/**
*
* The name of the image.
*
*
* @return The name of the image.
*/
public String name() {
return name;
}
/**
*
* The semantic version of the image.
*
*
* @return The semantic version of the image.
*/
public String version() {
return version;
}
/**
*
* The platform of the image.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #platform} will
* return {@link Platform#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #platformAsString}.
*
*
* @return The platform of the image.
* @see Platform
*/
public Platform platform() {
return Platform.fromValue(platform);
}
/**
*
* The platform of the image.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #platform} will
* return {@link Platform#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #platformAsString}.
*
*
* @return The platform of the image.
* @see Platform
*/
public String platformAsString() {
return platform;
}
/**
*
* Collects additional information about the image being created, including the operating system (OS) version and
* package list. This information is used to enhance the overall experience of using EC2 Image Builder. Enabled by
* default.
*
*
* @return Collects additional information about the image being created, including the operating system (OS)
* version and package list. This information is used to enhance the overall experience of using EC2 Image
* Builder. Enabled by default.
*/
public Boolean enhancedImageMetadataEnabled() {
return enhancedImageMetadataEnabled;
}
/**
*
* The operating system version of the instance. For example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows Server
* 2019.
*
*
* @return The operating system version of the instance. For example, Amazon Linux 2, Ubuntu 18, or Microsoft
* Windows Server 2019.
*/
public String osVersion() {
return osVersion;
}
/**
*
* The state of the image.
*
*
* @return The state of the image.
*/
public ImageState state() {
return state;
}
/**
*
* The image recipe used when creating the image.
*
*
* @return The image recipe used when creating the image.
*/
public ImageRecipe imageRecipe() {
return imageRecipe;
}
/**
*
* The name of the image pipeline that created this image.
*
*
* @return The name of the image pipeline that created this image.
*/
public String sourcePipelineName() {
return sourcePipelineName;
}
/**
*
* The Amazon Resource Name (ARN) of the image pipeline that created this image.
*
*
* @return The Amazon Resource Name (ARN) of the image pipeline that created this image.
*/
public String sourcePipelineArn() {
return sourcePipelineArn;
}
/**
*
* The infrastructure used when creating this image.
*
*
* @return The infrastructure used when creating this image.
*/
public InfrastructureConfiguration infrastructureConfiguration() {
return infrastructureConfiguration;
}
/**
*
* The distribution configuration used when creating this image.
*
*
* @return The distribution configuration used when creating this image.
*/
public DistributionConfiguration distributionConfiguration() {
return distributionConfiguration;
}
/**
*
* The image tests configuration used when creating this image.
*
*
* @return The image tests configuration used when creating this image.
*/
public ImageTestsConfiguration imageTestsConfiguration() {
return imageTestsConfiguration;
}
/**
*
* The date on which this image was created.
*
*
* @return The date on which this image was created.
*/
public String dateCreated() {
return dateCreated;
}
/**
*
* The output resources produced when creating this image.
*
*
* @return The output resources produced when creating this image.
*/
public OutputResources outputResources() {
return outputResources;
}
/**
* Returns true if the Tags property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* The tags of the image.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasTags()} to see if a value was sent in this field.
*
*
* @return The tags of the image.
*/
public Map tags() {
return tags;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(arn());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(version());
hashCode = 31 * hashCode + Objects.hashCode(platformAsString());
hashCode = 31 * hashCode + Objects.hashCode(enhancedImageMetadataEnabled());
hashCode = 31 * hashCode + Objects.hashCode(osVersion());
hashCode = 31 * hashCode + Objects.hashCode(state());
hashCode = 31 * hashCode + Objects.hashCode(imageRecipe());
hashCode = 31 * hashCode + Objects.hashCode(sourcePipelineName());
hashCode = 31 * hashCode + Objects.hashCode(sourcePipelineArn());
hashCode = 31 * hashCode + Objects.hashCode(infrastructureConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(distributionConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(imageTestsConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(dateCreated());
hashCode = 31 * hashCode + Objects.hashCode(outputResources());
hashCode = 31 * hashCode + Objects.hashCode(tags());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Image)) {
return false;
}
Image other = (Image) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(name(), other.name())
&& Objects.equals(version(), other.version()) && Objects.equals(platformAsString(), other.platformAsString())
&& Objects.equals(enhancedImageMetadataEnabled(), other.enhancedImageMetadataEnabled())
&& Objects.equals(osVersion(), other.osVersion()) && Objects.equals(state(), other.state())
&& Objects.equals(imageRecipe(), other.imageRecipe())
&& Objects.equals(sourcePipelineName(), other.sourcePipelineName())
&& Objects.equals(sourcePipelineArn(), other.sourcePipelineArn())
&& Objects.equals(infrastructureConfiguration(), other.infrastructureConfiguration())
&& Objects.equals(distributionConfiguration(), other.distributionConfiguration())
&& Objects.equals(imageTestsConfiguration(), other.imageTestsConfiguration())
&& Objects.equals(dateCreated(), other.dateCreated())
&& Objects.equals(outputResources(), other.outputResources()) && Objects.equals(tags(), other.tags());
}
/**
* 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.
*/
@Override
public String toString() {
return ToString.builder("Image").add("Arn", arn()).add("Name", name()).add("Version", version())
.add("Platform", platformAsString()).add("EnhancedImageMetadataEnabled", enhancedImageMetadataEnabled())
.add("OsVersion", osVersion()).add("State", state()).add("ImageRecipe", imageRecipe())
.add("SourcePipelineName", sourcePipelineName()).add("SourcePipelineArn", sourcePipelineArn())
.add("InfrastructureConfiguration", infrastructureConfiguration())
.add("DistributionConfiguration", distributionConfiguration())
.add("ImageTestsConfiguration", imageTestsConfiguration()).add("DateCreated", dateCreated())
.add("OutputResources", outputResources()).add("Tags", tags()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "arn":
return Optional.ofNullable(clazz.cast(arn()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "version":
return Optional.ofNullable(clazz.cast(version()));
case "platform":
return Optional.ofNullable(clazz.cast(platformAsString()));
case "enhancedImageMetadataEnabled":
return Optional.ofNullable(clazz.cast(enhancedImageMetadataEnabled()));
case "osVersion":
return Optional.ofNullable(clazz.cast(osVersion()));
case "state":
return Optional.ofNullable(clazz.cast(state()));
case "imageRecipe":
return Optional.ofNullable(clazz.cast(imageRecipe()));
case "sourcePipelineName":
return Optional.ofNullable(clazz.cast(sourcePipelineName()));
case "sourcePipelineArn":
return Optional.ofNullable(clazz.cast(sourcePipelineArn()));
case "infrastructureConfiguration":
return Optional.ofNullable(clazz.cast(infrastructureConfiguration()));
case "distributionConfiguration":
return Optional.ofNullable(clazz.cast(distributionConfiguration()));
case "imageTestsConfiguration":
return Optional.ofNullable(clazz.cast(imageTestsConfiguration()));
case "dateCreated":
return Optional.ofNullable(clazz.cast(dateCreated()));
case "outputResources":
return Optional.ofNullable(clazz.cast(outputResources()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((Image) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* 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.
*/
Builder arn(String arn);
/**
*
* 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.
*/
Builder name(String name);
/**
*
* The semantic version of the image.
*
*
* @param version
* The semantic version of the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder version(String version);
/**
*
* The platform of the image.
*
*
* @param platform
* The platform of the image.
* @see Platform
* @return Returns a reference to this object so that method calls can be chained together.
* @see Platform
*/
Builder platform(String platform);
/**
*
* The platform of the image.
*
*
* @param platform
* The platform of the image.
* @see Platform
* @return Returns a reference to this object so that method calls can be chained together.
* @see Platform
*/
Builder platform(Platform platform);
/**
*
* Collects additional information about the image being created, including the operating system (OS) version
* and package list. This information is used to enhance the overall experience of using EC2 Image Builder.
* Enabled by default.
*
*
* @param enhancedImageMetadataEnabled
* Collects additional information about the image being created, including the operating system (OS)
* version and package list. This information is used to enhance the overall experience of using EC2
* Image Builder. Enabled by default.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder enhancedImageMetadataEnabled(Boolean enhancedImageMetadataEnabled);
/**
*
* The operating system version of the instance. For example, Amazon Linux 2, Ubuntu 18, or Microsoft Windows
* Server 2019.
*
*
* @param osVersion
* The operating system version of the instance. 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.
*/
Builder osVersion(String osVersion);
/**
*
* 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.
*/
Builder state(ImageState state);
/**
*
* The state of the image.
*
* This is a convenience that creates an instance of the {@link ImageState.Builder} avoiding the need to create
* one manually via {@link ImageState#builder()}.
*
* When the {@link Consumer} completes, {@link ImageState.Builder#build()} is called immediately and its result
* is passed to {@link #state(ImageState)}.
*
* @param state
* a consumer that will call methods on {@link ImageState.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #state(ImageState)
*/
default Builder state(Consumer state) {
return state(ImageState.builder().applyMutation(state).build());
}
/**
*
* The image recipe used when creating the image.
*
*
* @param imageRecipe
* The image recipe used when creating the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder imageRecipe(ImageRecipe imageRecipe);
/**
*
* The image recipe used when creating the image.
*
* This is a convenience that creates an instance of the {@link ImageRecipe.Builder} avoiding the need to create
* one manually via {@link ImageRecipe#builder()}.
*
* When the {@link Consumer} completes, {@link ImageRecipe.Builder#build()} is called immediately and its result
* is passed to {@link #imageRecipe(ImageRecipe)}.
*
* @param imageRecipe
* a consumer that will call methods on {@link ImageRecipe.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #imageRecipe(ImageRecipe)
*/
default Builder imageRecipe(Consumer imageRecipe) {
return imageRecipe(ImageRecipe.builder().applyMutation(imageRecipe).build());
}
/**
*
* The name of the image pipeline that created this image.
*
*
* @param sourcePipelineName
* The name of the image pipeline that created this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sourcePipelineName(String sourcePipelineName);
/**
*
* The Amazon Resource Name (ARN) of the image pipeline that created this image.
*
*
* @param sourcePipelineArn
* The Amazon Resource Name (ARN) of the image pipeline that created this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sourcePipelineArn(String sourcePipelineArn);
/**
*
* The infrastructure used when creating this image.
*
*
* @param infrastructureConfiguration
* The infrastructure used when creating this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder infrastructureConfiguration(InfrastructureConfiguration infrastructureConfiguration);
/**
*
* The infrastructure used when creating this image.
*
* This is a convenience that creates an instance of the {@link InfrastructureConfiguration.Builder} avoiding
* the need to create one manually via {@link InfrastructureConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link InfrastructureConfiguration.Builder#build()} is called
* immediately and its result is passed to {@link #infrastructureConfiguration(InfrastructureConfiguration)}.
*
* @param infrastructureConfiguration
* a consumer that will call methods on {@link InfrastructureConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #infrastructureConfiguration(InfrastructureConfiguration)
*/
default Builder infrastructureConfiguration(Consumer infrastructureConfiguration) {
return infrastructureConfiguration(InfrastructureConfiguration.builder().applyMutation(infrastructureConfiguration)
.build());
}
/**
*
* The distribution configuration used when creating this image.
*
*
* @param distributionConfiguration
* The distribution configuration used when creating this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder distributionConfiguration(DistributionConfiguration distributionConfiguration);
/**
*
* The distribution configuration used when creating this image.
*
* This is a convenience that creates an instance of the {@link DistributionConfiguration.Builder} avoiding the
* need to create one manually via {@link DistributionConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link DistributionConfiguration.Builder#build()} is called immediately
* and its result is passed to {@link #distributionConfiguration(DistributionConfiguration)}.
*
* @param distributionConfiguration
* a consumer that will call methods on {@link DistributionConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #distributionConfiguration(DistributionConfiguration)
*/
default Builder distributionConfiguration(Consumer distributionConfiguration) {
return distributionConfiguration(DistributionConfiguration.builder().applyMutation(distributionConfiguration).build());
}
/**
*
* The image tests configuration used when creating this image.
*
*
* @param imageTestsConfiguration
* The image tests configuration used when creating this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder imageTestsConfiguration(ImageTestsConfiguration imageTestsConfiguration);
/**
*
* The image tests configuration used when creating this image.
*
* This is a convenience that creates an instance of the {@link ImageTestsConfiguration.Builder} avoiding the
* need to create one manually via {@link ImageTestsConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link ImageTestsConfiguration.Builder#build()} is called immediately
* and its result is passed to {@link #imageTestsConfiguration(ImageTestsConfiguration)}.
*
* @param imageTestsConfiguration
* a consumer that will call methods on {@link ImageTestsConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #imageTestsConfiguration(ImageTestsConfiguration)
*/
default Builder imageTestsConfiguration(Consumer imageTestsConfiguration) {
return imageTestsConfiguration(ImageTestsConfiguration.builder().applyMutation(imageTestsConfiguration).build());
}
/**
*
* The date on which this image was created.
*
*
* @param dateCreated
* The date on which this image was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder dateCreated(String dateCreated);
/**
*
* The output resources produced when creating this image.
*
*
* @param outputResources
* The output resources produced when creating this image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder outputResources(OutputResources outputResources);
/**
*
* The output resources produced when creating this image.
*
* This is a convenience that creates an instance of the {@link OutputResources.Builder} avoiding the need to
* create one manually via {@link OutputResources#builder()}.
*
* When the {@link Consumer} completes, {@link OutputResources.Builder#build()} is called immediately and its
* result is passed to {@link #outputResources(OutputResources)}.
*
* @param outputResources
* a consumer that will call methods on {@link OutputResources.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #outputResources(OutputResources)
*/
default Builder outputResources(Consumer outputResources) {
return outputResources(OutputResources.builder().applyMutation(outputResources).build());
}
/**
*
* The tags of the image.
*
*
* @param tags
* The tags of the image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
}
static final class BuilderImpl implements Builder {
private String arn;
private String name;
private String version;
private String platform;
private Boolean enhancedImageMetadataEnabled;
private String osVersion;
private ImageState state;
private ImageRecipe imageRecipe;
private String sourcePipelineName;
private String sourcePipelineArn;
private InfrastructureConfiguration infrastructureConfiguration;
private DistributionConfiguration distributionConfiguration;
private ImageTestsConfiguration imageTestsConfiguration;
private String dateCreated;
private OutputResources outputResources;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(Image model) {
arn(model.arn);
name(model.name);
version(model.version);
platform(model.platform);
enhancedImageMetadataEnabled(model.enhancedImageMetadataEnabled);
osVersion(model.osVersion);
state(model.state);
imageRecipe(model.imageRecipe);
sourcePipelineName(model.sourcePipelineName);
sourcePipelineArn(model.sourcePipelineArn);
infrastructureConfiguration(model.infrastructureConfiguration);
distributionConfiguration(model.distributionConfiguration);
imageTestsConfiguration(model.imageTestsConfiguration);
dateCreated(model.dateCreated);
outputResources(model.outputResources);
tags(model.tags);
}
public final String getArn() {
return arn;
}
@Override
public final Builder arn(String arn) {
this.arn = arn;
return this;
}
public final void setArn(String arn) {
this.arn = arn;
}
public final String getName() {
return name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final void setName(String name) {
this.name = name;
}
public final String getVersion() {
return version;
}
@Override
public final Builder version(String version) {
this.version = version;
return this;
}
public final void setVersion(String version) {
this.version = version;
}
public final String getPlatform() {
return platform;
}
@Override
public final Builder platform(String platform) {
this.platform = platform;
return this;
}
@Override
public final Builder platform(Platform platform) {
this.platform(platform == null ? null : platform.toString());
return this;
}
public final void setPlatform(String platform) {
this.platform = platform;
}
public final Boolean getEnhancedImageMetadataEnabled() {
return enhancedImageMetadataEnabled;
}
@Override
public final Builder enhancedImageMetadataEnabled(Boolean enhancedImageMetadataEnabled) {
this.enhancedImageMetadataEnabled = enhancedImageMetadataEnabled;
return this;
}
public final void setEnhancedImageMetadataEnabled(Boolean enhancedImageMetadataEnabled) {
this.enhancedImageMetadataEnabled = enhancedImageMetadataEnabled;
}
public final String getOsVersion() {
return osVersion;
}
@Override
public final Builder osVersion(String osVersion) {
this.osVersion = osVersion;
return this;
}
public final void setOsVersion(String osVersion) {
this.osVersion = osVersion;
}
public final ImageState.Builder getState() {
return state != null ? state.toBuilder() : null;
}
@Override
public final Builder state(ImageState state) {
this.state = state;
return this;
}
public final void setState(ImageState.BuilderImpl state) {
this.state = state != null ? state.build() : null;
}
public final ImageRecipe.Builder getImageRecipe() {
return imageRecipe != null ? imageRecipe.toBuilder() : null;
}
@Override
public final Builder imageRecipe(ImageRecipe imageRecipe) {
this.imageRecipe = imageRecipe;
return this;
}
public final void setImageRecipe(ImageRecipe.BuilderImpl imageRecipe) {
this.imageRecipe = imageRecipe != null ? imageRecipe.build() : null;
}
public final String getSourcePipelineName() {
return sourcePipelineName;
}
@Override
public final Builder sourcePipelineName(String sourcePipelineName) {
this.sourcePipelineName = sourcePipelineName;
return this;
}
public final void setSourcePipelineName(String sourcePipelineName) {
this.sourcePipelineName = sourcePipelineName;
}
public final String getSourcePipelineArn() {
return sourcePipelineArn;
}
@Override
public final Builder sourcePipelineArn(String sourcePipelineArn) {
this.sourcePipelineArn = sourcePipelineArn;
return this;
}
public final void setSourcePipelineArn(String sourcePipelineArn) {
this.sourcePipelineArn = sourcePipelineArn;
}
public final InfrastructureConfiguration.Builder getInfrastructureConfiguration() {
return infrastructureConfiguration != null ? infrastructureConfiguration.toBuilder() : null;
}
@Override
public final Builder infrastructureConfiguration(InfrastructureConfiguration infrastructureConfiguration) {
this.infrastructureConfiguration = infrastructureConfiguration;
return this;
}
public final void setInfrastructureConfiguration(InfrastructureConfiguration.BuilderImpl infrastructureConfiguration) {
this.infrastructureConfiguration = infrastructureConfiguration != null ? infrastructureConfiguration.build() : null;
}
public final DistributionConfiguration.Builder getDistributionConfiguration() {
return distributionConfiguration != null ? distributionConfiguration.toBuilder() : null;
}
@Override
public final Builder distributionConfiguration(DistributionConfiguration distributionConfiguration) {
this.distributionConfiguration = distributionConfiguration;
return this;
}
public final void setDistributionConfiguration(DistributionConfiguration.BuilderImpl distributionConfiguration) {
this.distributionConfiguration = distributionConfiguration != null ? distributionConfiguration.build() : null;
}
public final ImageTestsConfiguration.Builder getImageTestsConfiguration() {
return imageTestsConfiguration != null ? imageTestsConfiguration.toBuilder() : null;
}
@Override
public final Builder imageTestsConfiguration(ImageTestsConfiguration imageTestsConfiguration) {
this.imageTestsConfiguration = imageTestsConfiguration;
return this;
}
public final void setImageTestsConfiguration(ImageTestsConfiguration.BuilderImpl imageTestsConfiguration) {
this.imageTestsConfiguration = imageTestsConfiguration != null ? imageTestsConfiguration.build() : null;
}
public final String getDateCreated() {
return dateCreated;
}
@Override
public final Builder dateCreated(String dateCreated) {
this.dateCreated = dateCreated;
return this;
}
public final void setDateCreated(String dateCreated) {
this.dateCreated = dateCreated;
}
public final OutputResources.Builder getOutputResources() {
return outputResources != null ? outputResources.toBuilder() : null;
}
@Override
public final Builder outputResources(OutputResources outputResources) {
this.outputResources = outputResources;
return this;
}
public final void setOutputResources(OutputResources.BuilderImpl outputResources) {
this.outputResources = outputResources != null ? outputResources.build() : null;
}
public final Map getTags() {
return tags;
}
@Override
public final Builder tags(Map tags) {
this.tags = TagMapCopier.copy(tags);
return this;
}
public final void setTags(Map tags) {
this.tags = TagMapCopier.copy(tags);
}
@Override
public Image build() {
return new Image(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}