
software.amazon.awssdk.services.imagebuilder.model.UpdateImagePipelineRequest 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.util.Arrays;
import java.util.Collections;
import java.util.List;
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.awscore.AwsRequestOverrideConfiguration;
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.DefaultValueTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateImagePipelineRequest extends ImagebuilderRequest implements
ToCopyableBuilder {
private static final SdkField IMAGE_PIPELINE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("imagePipelineArn").getter(getter(UpdateImagePipelineRequest::imagePipelineArn))
.setter(setter(Builder::imagePipelineArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imagePipelineArn").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(UpdateImagePipelineRequest::description))
.setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField IMAGE_RECIPE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("imageRecipeArn").getter(getter(UpdateImagePipelineRequest::imageRecipeArn))
.setter(setter(Builder::imageRecipeArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imageRecipeArn").build()).build();
private static final SdkField CONTAINER_RECIPE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("containerRecipeArn").getter(getter(UpdateImagePipelineRequest::containerRecipeArn))
.setter(setter(Builder::containerRecipeArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("containerRecipeArn").build())
.build();
private static final SdkField INFRASTRUCTURE_CONFIGURATION_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("infrastructureConfigurationArn")
.getter(getter(UpdateImagePipelineRequest::infrastructureConfigurationArn))
.setter(setter(Builder::infrastructureConfigurationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("infrastructureConfigurationArn")
.build()).build();
private static final SdkField DISTRIBUTION_CONFIGURATION_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("distributionConfigurationArn")
.getter(getter(UpdateImagePipelineRequest::distributionConfigurationArn))
.setter(setter(Builder::distributionConfigurationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("distributionConfigurationArn")
.build()).build();
private static final SdkField IMAGE_TESTS_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("imageTestsConfiguration")
.getter(getter(UpdateImagePipelineRequest::imageTestsConfiguration)).setter(setter(Builder::imageTestsConfiguration))
.constructor(ImageTestsConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imageTestsConfiguration").build())
.build();
private static final SdkField ENHANCED_IMAGE_METADATA_ENABLED_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("enhancedImageMetadataEnabled")
.getter(getter(UpdateImagePipelineRequest::enhancedImageMetadataEnabled))
.setter(setter(Builder::enhancedImageMetadataEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("enhancedImageMetadataEnabled")
.build()).build();
private static final SdkField SCHEDULE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("schedule").getter(getter(UpdateImagePipelineRequest::schedule)).setter(setter(Builder::schedule))
.constructor(Schedule::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("schedule").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(UpdateImagePipelineRequest::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField CLIENT_TOKEN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("clientToken")
.getter(getter(UpdateImagePipelineRequest::clientToken))
.setter(setter(Builder::clientToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientToken").build(),
DefaultValueTrait.idempotencyToken()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IMAGE_PIPELINE_ARN_FIELD,
DESCRIPTION_FIELD, IMAGE_RECIPE_ARN_FIELD, CONTAINER_RECIPE_ARN_FIELD, INFRASTRUCTURE_CONFIGURATION_ARN_FIELD,
DISTRIBUTION_CONFIGURATION_ARN_FIELD, IMAGE_TESTS_CONFIGURATION_FIELD, ENHANCED_IMAGE_METADATA_ENABLED_FIELD,
SCHEDULE_FIELD, STATUS_FIELD, CLIENT_TOKEN_FIELD));
private final String imagePipelineArn;
private final String description;
private final String imageRecipeArn;
private final String containerRecipeArn;
private final String infrastructureConfigurationArn;
private final String distributionConfigurationArn;
private final ImageTestsConfiguration imageTestsConfiguration;
private final Boolean enhancedImageMetadataEnabled;
private final Schedule schedule;
private final String status;
private final String clientToken;
private UpdateImagePipelineRequest(BuilderImpl builder) {
super(builder);
this.imagePipelineArn = builder.imagePipelineArn;
this.description = builder.description;
this.imageRecipeArn = builder.imageRecipeArn;
this.containerRecipeArn = builder.containerRecipeArn;
this.infrastructureConfigurationArn = builder.infrastructureConfigurationArn;
this.distributionConfigurationArn = builder.distributionConfigurationArn;
this.imageTestsConfiguration = builder.imageTestsConfiguration;
this.enhancedImageMetadataEnabled = builder.enhancedImageMetadataEnabled;
this.schedule = builder.schedule;
this.status = builder.status;
this.clientToken = builder.clientToken;
}
/**
*
* The Amazon Resource Name (ARN) of the image pipeline that you want to update.
*
*
* @return The Amazon Resource Name (ARN) of the image pipeline that you want to update.
*/
public final String imagePipelineArn() {
return imagePipelineArn;
}
/**
*
* The description of the image pipeline.
*
*
* @return The description of the image pipeline.
*/
public final String description() {
return description;
}
/**
*
* The Amazon Resource Name (ARN) of the image recipe that will be used to configure images updated by this image
* pipeline.
*
*
* @return The Amazon Resource Name (ARN) of the image recipe that will be used to configure images updated by this
* image pipeline.
*/
public final String imageRecipeArn() {
return imageRecipeArn;
}
/**
*
* The Amazon Resource Name (ARN) of the container pipeline to update.
*
*
* @return The Amazon Resource Name (ARN) of the container pipeline to update.
*/
public final String containerRecipeArn() {
return containerRecipeArn;
}
/**
*
* The Amazon Resource Name (ARN) of the infrastructure configuration that will be used to build images updated by
* this image pipeline.
*
*
* @return The Amazon Resource Name (ARN) of the infrastructure configuration that will be used to build images
* updated by this image pipeline.
*/
public final String infrastructureConfigurationArn() {
return infrastructureConfigurationArn;
}
/**
*
* The Amazon Resource Name (ARN) of the distribution configuration that will be used to configure and distribute
* images updated by this image pipeline.
*
*
* @return The Amazon Resource Name (ARN) of the distribution configuration that will be used to configure and
* distribute images updated by this image pipeline.
*/
public final String distributionConfigurationArn() {
return distributionConfigurationArn;
}
/**
*
* The image test configuration of the image pipeline.
*
*
* @return The image test configuration of the image pipeline.
*/
public final ImageTestsConfiguration imageTestsConfiguration() {
return imageTestsConfiguration;
}
/**
*
* 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 final Boolean enhancedImageMetadataEnabled() {
return enhancedImageMetadataEnabled;
}
/**
*
* The schedule of the image pipeline.
*
*
* @return The schedule of the image pipeline.
*/
public final Schedule schedule() {
return schedule;
}
/**
*
* The status of the image pipeline.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link PipelineStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the image pipeline.
* @see PipelineStatus
*/
public final PipelineStatus status() {
return PipelineStatus.fromValue(status);
}
/**
*
* The status of the image pipeline.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link PipelineStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the image pipeline.
* @see PipelineStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The idempotency token used to make this request idempotent.
*
*
* @return The idempotency token used to make this request idempotent.
*/
public final String clientToken() {
return clientToken;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(imagePipelineArn());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(imageRecipeArn());
hashCode = 31 * hashCode + Objects.hashCode(containerRecipeArn());
hashCode = 31 * hashCode + Objects.hashCode(infrastructureConfigurationArn());
hashCode = 31 * hashCode + Objects.hashCode(distributionConfigurationArn());
hashCode = 31 * hashCode + Objects.hashCode(imageTestsConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(enhancedImageMetadataEnabled());
hashCode = 31 * hashCode + Objects.hashCode(schedule());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(clientToken());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateImagePipelineRequest)) {
return false;
}
UpdateImagePipelineRequest other = (UpdateImagePipelineRequest) obj;
return Objects.equals(imagePipelineArn(), other.imagePipelineArn()) && Objects.equals(description(), other.description())
&& Objects.equals(imageRecipeArn(), other.imageRecipeArn())
&& Objects.equals(containerRecipeArn(), other.containerRecipeArn())
&& Objects.equals(infrastructureConfigurationArn(), other.infrastructureConfigurationArn())
&& Objects.equals(distributionConfigurationArn(), other.distributionConfigurationArn())
&& Objects.equals(imageTestsConfiguration(), other.imageTestsConfiguration())
&& Objects.equals(enhancedImageMetadataEnabled(), other.enhancedImageMetadataEnabled())
&& Objects.equals(schedule(), other.schedule()) && Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(clientToken(), other.clientToken());
}
/**
* 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("UpdateImagePipelineRequest").add("ImagePipelineArn", imagePipelineArn())
.add("Description", description()).add("ImageRecipeArn", imageRecipeArn())
.add("ContainerRecipeArn", containerRecipeArn())
.add("InfrastructureConfigurationArn", infrastructureConfigurationArn())
.add("DistributionConfigurationArn", distributionConfigurationArn())
.add("ImageTestsConfiguration", imageTestsConfiguration())
.add("EnhancedImageMetadataEnabled", enhancedImageMetadataEnabled()).add("Schedule", schedule())
.add("Status", statusAsString()).add("ClientToken", clientToken()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "imagePipelineArn":
return Optional.ofNullable(clazz.cast(imagePipelineArn()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "imageRecipeArn":
return Optional.ofNullable(clazz.cast(imageRecipeArn()));
case "containerRecipeArn":
return Optional.ofNullable(clazz.cast(containerRecipeArn()));
case "infrastructureConfigurationArn":
return Optional.ofNullable(clazz.cast(infrastructureConfigurationArn()));
case "distributionConfigurationArn":
return Optional.ofNullable(clazz.cast(distributionConfigurationArn()));
case "imageTestsConfiguration":
return Optional.ofNullable(clazz.cast(imageTestsConfiguration()));
case "enhancedImageMetadataEnabled":
return Optional.ofNullable(clazz.cast(enhancedImageMetadataEnabled()));
case "schedule":
return Optional.ofNullable(clazz.cast(schedule()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "clientToken":
return Optional.ofNullable(clazz.cast(clientToken()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function