All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.imagebuilder.model.ContainerRecipe 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.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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;

/**
 * 

* A container recipe. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ContainerRecipe implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(ContainerRecipe::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField CONTAINER_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("containerType").getter(getter(ContainerRecipe::containerTypeAsString)) .setter(setter(Builder::containerType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("containerType").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(ContainerRecipe::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("description").getter(getter(ContainerRecipe::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build(); private static final SdkField PLATFORM_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("platform").getter(getter(ContainerRecipe::platformAsString)).setter(setter(Builder::platform)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("platform").build()).build(); private static final SdkField OWNER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("owner") .getter(getter(ContainerRecipe::owner)).setter(setter(Builder::owner)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("owner").build()).build(); private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("version") .getter(getter(ContainerRecipe::version)).setter(setter(Builder::version)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build(); private static final SdkField> COMPONENTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("components") .getter(getter(ContainerRecipe::components)) .setter(setter(Builder::components)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("components").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ComponentConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField INSTANCE_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("instanceConfiguration") .getter(getter(ContainerRecipe::instanceConfiguration)).setter(setter(Builder::instanceConfiguration)) .constructor(InstanceConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("instanceConfiguration").build()) .build(); private static final SdkField DOCKERFILE_TEMPLATE_DATA_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("dockerfileTemplateData").getter(getter(ContainerRecipe::dockerfileTemplateData)) .setter(setter(Builder::dockerfileTemplateData)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dockerfileTemplateData").build()) .build(); private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("kmsKeyId").getter(getter(ContainerRecipe::kmsKeyId)).setter(setter(Builder::kmsKeyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kmsKeyId").build()).build(); private static final SdkField ENCRYPTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("encrypted").getter(getter(ContainerRecipe::encrypted)).setter(setter(Builder::encrypted)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encrypted").build()).build(); private static final SdkField PARENT_IMAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("parentImage").getter(getter(ContainerRecipe::parentImage)).setter(setter(Builder::parentImage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("parentImage").build()).build(); private static final SdkField DATE_CREATED_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("dateCreated").getter(getter(ContainerRecipe::dateCreated)).setter(setter(Builder::dateCreated)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dateCreated").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("tags") .getter(getter(ContainerRecipe::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 SdkField WORKING_DIRECTORY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("workingDirectory").getter(getter(ContainerRecipe::workingDirectory)) .setter(setter(Builder::workingDirectory)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("workingDirectory").build()).build(); private static final SdkField TARGET_REPOSITORY_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("targetRepository") .getter(getter(ContainerRecipe::targetRepository)).setter(setter(Builder::targetRepository)) .constructor(TargetContainerRepository::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("targetRepository").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, CONTAINER_TYPE_FIELD, NAME_FIELD, DESCRIPTION_FIELD, PLATFORM_FIELD, OWNER_FIELD, VERSION_FIELD, COMPONENTS_FIELD, INSTANCE_CONFIGURATION_FIELD, DOCKERFILE_TEMPLATE_DATA_FIELD, KMS_KEY_ID_FIELD, ENCRYPTED_FIELD, PARENT_IMAGE_FIELD, DATE_CREATED_FIELD, TAGS_FIELD, WORKING_DIRECTORY_FIELD, TARGET_REPOSITORY_FIELD)); private static final long serialVersionUID = 1L; private final String arn; private final String containerType; private final String name; private final String description; private final String platform; private final String owner; private final String version; private final List components; private final InstanceConfiguration instanceConfiguration; private final String dockerfileTemplateData; private final String kmsKeyId; private final Boolean encrypted; private final String parentImage; private final String dateCreated; private final Map tags; private final String workingDirectory; private final TargetContainerRepository targetRepository; private ContainerRecipe(BuilderImpl builder) { this.arn = builder.arn; this.containerType = builder.containerType; this.name = builder.name; this.description = builder.description; this.platform = builder.platform; this.owner = builder.owner; this.version = builder.version; this.components = builder.components; this.instanceConfiguration = builder.instanceConfiguration; this.dockerfileTemplateData = builder.dockerfileTemplateData; this.kmsKeyId = builder.kmsKeyId; this.encrypted = builder.encrypted; this.parentImage = builder.parentImage; this.dateCreated = builder.dateCreated; this.tags = builder.tags; this.workingDirectory = builder.workingDirectory; this.targetRepository = builder.targetRepository; } /** *

* The Amazon Resource Name (ARN) of the container recipe. *

* *

* Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to that * object as follows: *

*
    *
  1. *

    * Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either left off * entirely, or they are specified as wildcards, for example: x.x.x. *

    *
  2. *
  3. *

    * Version ARNs have only the first three nodes: <major>.<minor>.<patch> *

    *
  4. *
  5. *

    * Build version ARNs have all four nodes, and point to a specific build for a specific version of an object. *

    *
  6. *
*
* * @return The Amazon Resource Name (ARN) of the container recipe.

*

* Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to * that object as follows: *

*
    *
  1. *

    * Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either * left off entirely, or they are specified as wildcards, for example: x.x.x. *

    *
  2. *
  3. *

    * Version ARNs have only the first three nodes: <major>.<minor>.<patch> *

    *
  4. *
  5. *

    * Build version ARNs have all four nodes, and point to a specific build for a specific version of an * object. *

    *
  6. *
*/ public final String arn() { return arn; } /** *

* Specifies the type of container, such as Docker. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #containerType} * will return {@link ContainerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #containerTypeAsString}. *

* * @return Specifies the type of container, such as Docker. * @see ContainerType */ public final ContainerType containerType() { return ContainerType.fromValue(containerType); } /** *

* Specifies the type of container, such as Docker. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #containerType} * will return {@link ContainerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #containerTypeAsString}. *

* * @return Specifies the type of container, such as Docker. * @see ContainerType */ public final String containerTypeAsString() { return containerType; } /** *

* The name of the container recipe. *

* * @return The name of the container recipe. */ public final String name() { return name; } /** *

* The description of the container recipe. *

* * @return The description of the container recipe. */ public final String description() { return description; } /** *

* The system platform for the container, such as Windows or Linux. *

*

* 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 system platform for the container, such as Windows or Linux. * @see Platform */ public final Platform platform() { return Platform.fromValue(platform); } /** *

* The system platform for the container, such as Windows or Linux. *

*

* 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 system platform for the container, such as Windows or Linux. * @see Platform */ public final String platformAsString() { return platform; } /** *

* The owner of the container recipe. *

* * @return The owner of the container recipe. */ public final String owner() { return owner; } /** *

* The semantic version of the container recipe. *

* *

* 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. *

*

* 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 container recipe.

*

* 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. *

*

* 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 final String version() { return version; } /** * For responses, this returns true if the service returned a value for the Components property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasComponents() { return components != null && !(components instanceof SdkAutoConstructList); } /** *

* Components for build and test that are included in the container recipe. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasComponents} method. *

* * @return Components for build and test that are included in the container recipe. */ public final List components() { return components; } /** *

* A group of options that can be used to configure an instance for building and testing container images. *

* * @return A group of options that can be used to configure an instance for building and testing container images. */ public final InstanceConfiguration instanceConfiguration() { return instanceConfiguration; } /** *

* Dockerfiles are text documents that are used to build Docker containers, and ensure that they contain all of the * elements required by the application running inside. The template data consists of contextual variables where * Image Builder places build information or scripts, based on your container image recipe. *

* * @return Dockerfiles are text documents that are used to build Docker containers, and ensure that they contain all * of the elements required by the application running inside. The template data consists of contextual * variables where Image Builder places build information or scripts, based on your container image recipe. */ public final String dockerfileTemplateData() { return dockerfileTemplateData; } /** *

* Identifies which KMS key is used to encrypt the container image for distribution to the target Region. *

* * @return Identifies which KMS key is used to encrypt the container image for distribution to the target Region. */ public final String kmsKeyId() { return kmsKeyId; } /** *

* A flag that indicates if the target container is encrypted. *

* * @return A flag that indicates if the target container is encrypted. */ public final Boolean encrypted() { return encrypted; } /** *

* The base image for the container recipe. *

* * @return The base image for the container recipe. */ public final String parentImage() { return parentImage; } /** *

* The date when this container recipe was created. *

* * @return The date when this container recipe was created. */ public final String dateCreated() { return dateCreated; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

* Tags that are attached to the container recipe. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return Tags that are attached to the container recipe. */ public final Map tags() { return tags; } /** *

* The working directory for use during build and test workflows. *

* * @return The working directory for use during build and test workflows. */ public final String workingDirectory() { return workingDirectory; } /** *

* The destination repository for the container image. *

* * @return The destination repository for the container image. */ public final TargetContainerRepository targetRepository() { return targetRepository; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(containerTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(platformAsString()); hashCode = 31 * hashCode + Objects.hashCode(owner()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(hasComponents() ? components() : null); hashCode = 31 * hashCode + Objects.hashCode(instanceConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(dockerfileTemplateData()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(encrypted()); hashCode = 31 * hashCode + Objects.hashCode(parentImage()); hashCode = 31 * hashCode + Objects.hashCode(dateCreated()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(workingDirectory()); hashCode = 31 * hashCode + Objects.hashCode(targetRepository()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ContainerRecipe)) { return false; } ContainerRecipe other = (ContainerRecipe) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(containerTypeAsString(), other.containerTypeAsString()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(platformAsString(), other.platformAsString()) && Objects.equals(owner(), other.owner()) && Objects.equals(version(), other.version()) && hasComponents() == other.hasComponents() && Objects.equals(components(), other.components()) && Objects.equals(instanceConfiguration(), other.instanceConfiguration()) && Objects.equals(dockerfileTemplateData(), other.dockerfileTemplateData()) && Objects.equals(kmsKeyId(), other.kmsKeyId()) && Objects.equals(encrypted(), other.encrypted()) && Objects.equals(parentImage(), other.parentImage()) && Objects.equals(dateCreated(), other.dateCreated()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(workingDirectory(), other.workingDirectory()) && Objects.equals(targetRepository(), other.targetRepository()); } /** * 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 final String toString() { return ToString.builder("ContainerRecipe").add("Arn", arn()).add("ContainerType", containerTypeAsString()) .add("Name", name()).add("Description", description()).add("Platform", platformAsString()).add("Owner", owner()) .add("Version", version()).add("Components", hasComponents() ? components() : null) .add("InstanceConfiguration", instanceConfiguration()).add("DockerfileTemplateData", dockerfileTemplateData()) .add("KmsKeyId", kmsKeyId()).add("Encrypted", encrypted()).add("ParentImage", parentImage()) .add("DateCreated", dateCreated()).add("Tags", hasTags() ? tags() : null) .add("WorkingDirectory", workingDirectory()).add("TargetRepository", targetRepository()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "arn": return Optional.ofNullable(clazz.cast(arn())); case "containerType": return Optional.ofNullable(clazz.cast(containerTypeAsString())); case "name": return Optional.ofNullable(clazz.cast(name())); case "description": return Optional.ofNullable(clazz.cast(description())); case "platform": return Optional.ofNullable(clazz.cast(platformAsString())); case "owner": return Optional.ofNullable(clazz.cast(owner())); case "version": return Optional.ofNullable(clazz.cast(version())); case "components": return Optional.ofNullable(clazz.cast(components())); case "instanceConfiguration": return Optional.ofNullable(clazz.cast(instanceConfiguration())); case "dockerfileTemplateData": return Optional.ofNullable(clazz.cast(dockerfileTemplateData())); case "kmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); case "encrypted": return Optional.ofNullable(clazz.cast(encrypted())); case "parentImage": return Optional.ofNullable(clazz.cast(parentImage())); case "dateCreated": return Optional.ofNullable(clazz.cast(dateCreated())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "workingDirectory": return Optional.ofNullable(clazz.cast(workingDirectory())); case "targetRepository": return Optional.ofNullable(clazz.cast(targetRepository())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ContainerRecipe) 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 container recipe. *

* *

* Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies to * that object as follows: *

*
    *
  1. *

    * Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are either left * off entirely, or they are specified as wildcards, for example: x.x.x. *

    *
  2. *
  3. *

    * Version ARNs have only the first three nodes: <major>.<minor>.<patch> *

    *
  4. *
  5. *

    * Build version ARNs have all four nodes, and point to a specific build for a specific version of an object. *

    *
  6. *
*
* * @param arn * The Amazon Resource Name (ARN) of the container recipe.

*

* Semantic versioning is included in each object's Amazon Resource Name (ARN), at the level that applies * to that object as follows: *

*
    *
  1. *

    * Versionless ARNs and Name ARNs do not include specific values in any of the nodes. The nodes are * either left off entirely, or they are specified as wildcards, for example: x.x.x. *

    *
  2. *
  3. *

    * Version ARNs have only the first three nodes: <major>.<minor>.<patch> *

    *
  4. *
  5. *

    * Build version ARNs have all four nodes, and point to a specific build for a specific version of an * object. *

    *
  6. *
* @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

* Specifies the type of container, such as Docker. *

* * @param containerType * Specifies the type of container, such as Docker. * @see ContainerType * @return Returns a reference to this object so that method calls can be chained together. * @see ContainerType */ Builder containerType(String containerType); /** *

* Specifies the type of container, such as Docker. *

* * @param containerType * Specifies the type of container, such as Docker. * @see ContainerType * @return Returns a reference to this object so that method calls can be chained together. * @see ContainerType */ Builder containerType(ContainerType containerType); /** *

* The name of the container recipe. *

* * @param name * The name of the container recipe. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The description of the container recipe. *

* * @param description * The description of the container recipe. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The system platform for the container, such as Windows or Linux. *

* * @param platform * The system platform for the container, such as Windows or Linux. * @see Platform * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ Builder platform(String platform); /** *

* The system platform for the container, such as Windows or Linux. *

* * @param platform * The system platform for the container, such as Windows or Linux. * @see Platform * @return Returns a reference to this object so that method calls can be chained together. * @see Platform */ Builder platform(Platform platform); /** *

* The owner of the container recipe. *

* * @param owner * The owner of the container recipe. * @return Returns a reference to this object so that method calls can be chained together. */ Builder owner(String owner); /** *

* The semantic version of the container recipe. *

* *

* 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. *

*

* 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 version * The semantic version of the container recipe.

*

* 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. *

*

* 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. */ Builder version(String version); /** *

* Components for build and test that are included in the container recipe. *

* * @param components * Components for build and test that are included in the container recipe. * @return Returns a reference to this object so that method calls can be chained together. */ Builder components(Collection components); /** *

* Components for build and test that are included in the container recipe. *

* * @param components * Components for build and test that are included in the container recipe. * @return Returns a reference to this object so that method calls can be chained together. */ Builder components(ComponentConfiguration... components); /** *

* Components for build and test that are included in the container recipe. *

* This is a convenience method that creates an instance of the {@link List.Builder} * avoiding the need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called * immediately and its result is passed to {@link #components(List)}. * * @param components * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #components(List) */ Builder components(Consumer... components); /** *

* A group of options that can be used to configure an instance for building and testing container images. *

* * @param instanceConfiguration * A group of options that can be used to configure an instance for building and testing container * images. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceConfiguration(InstanceConfiguration instanceConfiguration); /** *

* A group of options that can be used to configure an instance for building and testing container images. *

* This is a convenience method that creates an instance of the {@link InstanceConfiguration.Builder} avoiding * the need to create one manually via {@link InstanceConfiguration#builder()}. * * When the {@link Consumer} completes, {@link InstanceConfiguration.Builder#build()} is called immediately and * its result is passed to {@link #instanceConfiguration(InstanceConfiguration)}. * * @param instanceConfiguration * a consumer that will call methods on {@link InstanceConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #instanceConfiguration(InstanceConfiguration) */ default Builder instanceConfiguration(Consumer instanceConfiguration) { return instanceConfiguration(InstanceConfiguration.builder().applyMutation(instanceConfiguration).build()); } /** *

* Dockerfiles are text documents that are used to build Docker containers, and ensure that they contain all of * the elements required by the application running inside. The template data consists of contextual variables * where Image Builder places build information or scripts, based on your container image recipe. *

* * @param dockerfileTemplateData * Dockerfiles are text documents that are used to build Docker containers, and ensure that they contain * all of the elements required by the application running inside. The template data consists of * contextual variables where Image Builder places build information or scripts, based on your container * image recipe. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dockerfileTemplateData(String dockerfileTemplateData); /** *

* Identifies which KMS key is used to encrypt the container image for distribution to the target Region. *

* * @param kmsKeyId * Identifies which KMS key is used to encrypt the container image for distribution to the target Region. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); /** *

* A flag that indicates if the target container is encrypted. *

* * @param encrypted * A flag that indicates if the target container is encrypted. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encrypted(Boolean encrypted); /** *

* The base image for the container recipe. *

* * @param parentImage * The base image for the container recipe. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parentImage(String parentImage); /** *

* The date when this container recipe was created. *

* * @param dateCreated * The date when this container recipe was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dateCreated(String dateCreated); /** *

* Tags that are attached to the container recipe. *

* * @param tags * Tags that are attached to the container recipe. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

* The working directory for use during build and test workflows. *

* * @param workingDirectory * The working directory for use during build and test workflows. * @return Returns a reference to this object so that method calls can be chained together. */ Builder workingDirectory(String workingDirectory); /** *

* The destination repository for the container image. *

* * @param targetRepository * The destination repository for the container image. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetRepository(TargetContainerRepository targetRepository); /** *

* The destination repository for the container image. *

* This is a convenience method that creates an instance of the {@link TargetContainerRepository.Builder} * avoiding the need to create one manually via {@link TargetContainerRepository#builder()}. * * When the {@link Consumer} completes, {@link TargetContainerRepository.Builder#build()} is called immediately * and its result is passed to {@link #targetRepository(TargetContainerRepository)}. * * @param targetRepository * a consumer that will call methods on {@link TargetContainerRepository.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #targetRepository(TargetContainerRepository) */ default Builder targetRepository(Consumer targetRepository) { return targetRepository(TargetContainerRepository.builder().applyMutation(targetRepository).build()); } } static final class BuilderImpl implements Builder { private String arn; private String containerType; private String name; private String description; private String platform; private String owner; private String version; private List components = DefaultSdkAutoConstructList.getInstance(); private InstanceConfiguration instanceConfiguration; private String dockerfileTemplateData; private String kmsKeyId; private Boolean encrypted; private String parentImage; private String dateCreated; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private String workingDirectory; private TargetContainerRepository targetRepository; private BuilderImpl() { } private BuilderImpl(ContainerRecipe model) { arn(model.arn); containerType(model.containerType); name(model.name); description(model.description); platform(model.platform); owner(model.owner); version(model.version); components(model.components); instanceConfiguration(model.instanceConfiguration); dockerfileTemplateData(model.dockerfileTemplateData); kmsKeyId(model.kmsKeyId); encrypted(model.encrypted); parentImage(model.parentImage); dateCreated(model.dateCreated); tags(model.tags); workingDirectory(model.workingDirectory); targetRepository(model.targetRepository); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getContainerType() { return containerType; } public final void setContainerType(String containerType) { this.containerType = containerType; } @Override public final Builder containerType(String containerType) { this.containerType = containerType; return this; } @Override public final Builder containerType(ContainerType containerType) { this.containerType(containerType == null ? null : containerType.toString()); return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getPlatform() { return platform; } public final void setPlatform(String platform) { this.platform = 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 String getOwner() { return owner; } public final void setOwner(String owner) { this.owner = owner; } @Override public final Builder owner(String owner) { this.owner = owner; return this; } public final String getVersion() { return version; } public final void setVersion(String version) { this.version = version; } @Override public final Builder version(String version) { this.version = version; return this; } public final List getComponents() { List result = ComponentConfigurationListCopier.copyToBuilder(this.components); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setComponents(Collection components) { this.components = ComponentConfigurationListCopier.copyFromBuilder(components); } @Override public final Builder components(Collection components) { this.components = ComponentConfigurationListCopier.copy(components); return this; } @Override @SafeVarargs public final Builder components(ComponentConfiguration... components) { components(Arrays.asList(components)); return this; } @Override @SafeVarargs public final Builder components(Consumer... components) { components(Stream.of(components).map(c -> ComponentConfiguration.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final InstanceConfiguration.Builder getInstanceConfiguration() { return instanceConfiguration != null ? instanceConfiguration.toBuilder() : null; } public final void setInstanceConfiguration(InstanceConfiguration.BuilderImpl instanceConfiguration) { this.instanceConfiguration = instanceConfiguration != null ? instanceConfiguration.build() : null; } @Override public final Builder instanceConfiguration(InstanceConfiguration instanceConfiguration) { this.instanceConfiguration = instanceConfiguration; return this; } public final String getDockerfileTemplateData() { return dockerfileTemplateData; } public final void setDockerfileTemplateData(String dockerfileTemplateData) { this.dockerfileTemplateData = dockerfileTemplateData; } @Override public final Builder dockerfileTemplateData(String dockerfileTemplateData) { this.dockerfileTemplateData = dockerfileTemplateData; return this; } public final String getKmsKeyId() { return kmsKeyId; } public final void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } @Override public final Builder kmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; return this; } public final Boolean getEncrypted() { return encrypted; } public final void setEncrypted(Boolean encrypted) { this.encrypted = encrypted; } @Override public final Builder encrypted(Boolean encrypted) { this.encrypted = encrypted; return this; } public final String getParentImage() { return parentImage; } public final void setParentImage(String parentImage) { this.parentImage = parentImage; } @Override public final Builder parentImage(String parentImage) { this.parentImage = parentImage; return this; } public final String getDateCreated() { return dateCreated; } public final void setDateCreated(String dateCreated) { this.dateCreated = dateCreated; } @Override public final Builder dateCreated(String dateCreated) { this.dateCreated = dateCreated; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagMapCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagMapCopier.copy(tags); return this; } public final String getWorkingDirectory() { return workingDirectory; } public final void setWorkingDirectory(String workingDirectory) { this.workingDirectory = workingDirectory; } @Override public final Builder workingDirectory(String workingDirectory) { this.workingDirectory = workingDirectory; return this; } public final TargetContainerRepository.Builder getTargetRepository() { return targetRepository != null ? targetRepository.toBuilder() : null; } public final void setTargetRepository(TargetContainerRepository.BuilderImpl targetRepository) { this.targetRepository = targetRepository != null ? targetRepository.build() : null; } @Override public final Builder targetRepository(TargetContainerRepository targetRepository) { this.targetRepository = targetRepository; return this; } @Override public ContainerRecipe build() { return new ContainerRecipe(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy