software.amazon.awssdk.services.elasticbeanstalk.model.ApplicationVersionDescription Maven / Gradle / Ivy
Show all versions of elasticbeanstalk Show documentation
/*
* 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.elasticbeanstalk.model;
import java.io.Serializable;
import java.time.Instant;
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.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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes the properties of an application version.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ApplicationVersionDescription implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField APPLICATION_VERSION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ApplicationVersionArn").getter(getter(ApplicationVersionDescription::applicationVersionArn))
.setter(setter(Builder::applicationVersionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationVersionArn").build())
.build();
private static final SdkField APPLICATION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ApplicationName").getter(getter(ApplicationVersionDescription::applicationName))
.setter(setter(Builder::applicationName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationName").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(ApplicationVersionDescription::description))
.setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField VERSION_LABEL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VersionLabel").getter(getter(ApplicationVersionDescription::versionLabel))
.setter(setter(Builder::versionLabel))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VersionLabel").build()).build();
private static final SdkField SOURCE_BUILD_INFORMATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SourceBuildInformation")
.getter(getter(ApplicationVersionDescription::sourceBuildInformation))
.setter(setter(Builder::sourceBuildInformation)).constructor(SourceBuildInformation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceBuildInformation").build())
.build();
private static final SdkField BUILD_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BuildArn").getter(getter(ApplicationVersionDescription::buildArn)).setter(setter(Builder::buildArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BuildArn").build()).build();
private static final SdkField SOURCE_BUNDLE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("SourceBundle").getter(getter(ApplicationVersionDescription::sourceBundle))
.setter(setter(Builder::sourceBundle)).constructor(S3Location::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceBundle").build()).build();
private static final SdkField DATE_CREATED_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("DateCreated").getter(getter(ApplicationVersionDescription::dateCreated))
.setter(setter(Builder::dateCreated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DateCreated").build()).build();
private static final SdkField DATE_UPDATED_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("DateUpdated").getter(getter(ApplicationVersionDescription::dateUpdated))
.setter(setter(Builder::dateUpdated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DateUpdated").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(ApplicationVersionDescription::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_VERSION_ARN_FIELD,
APPLICATION_NAME_FIELD, DESCRIPTION_FIELD, VERSION_LABEL_FIELD, SOURCE_BUILD_INFORMATION_FIELD, BUILD_ARN_FIELD,
SOURCE_BUNDLE_FIELD, DATE_CREATED_FIELD, DATE_UPDATED_FIELD, STATUS_FIELD));
private static final long serialVersionUID = 1L;
private final String applicationVersionArn;
private final String applicationName;
private final String description;
private final String versionLabel;
private final SourceBuildInformation sourceBuildInformation;
private final String buildArn;
private final S3Location sourceBundle;
private final Instant dateCreated;
private final Instant dateUpdated;
private final String status;
private ApplicationVersionDescription(BuilderImpl builder) {
this.applicationVersionArn = builder.applicationVersionArn;
this.applicationName = builder.applicationName;
this.description = builder.description;
this.versionLabel = builder.versionLabel;
this.sourceBuildInformation = builder.sourceBuildInformation;
this.buildArn = builder.buildArn;
this.sourceBundle = builder.sourceBundle;
this.dateCreated = builder.dateCreated;
this.dateUpdated = builder.dateUpdated;
this.status = builder.status;
}
/**
*
* The Amazon Resource Name (ARN) of the application version.
*
*
* @return The Amazon Resource Name (ARN) of the application version.
*/
public String applicationVersionArn() {
return applicationVersionArn;
}
/**
*
* The name of the application to which the application version belongs.
*
*
* @return The name of the application to which the application version belongs.
*/
public String applicationName() {
return applicationName;
}
/**
*
* The description of the application version.
*
*
* @return The description of the application version.
*/
public String description() {
return description;
}
/**
*
* A unique identifier for the application version.
*
*
* @return A unique identifier for the application version.
*/
public String versionLabel() {
return versionLabel;
}
/**
*
* If the version's source code was retrieved from AWS CodeCommit, the location of the source code for the
* application version.
*
*
* @return If the version's source code was retrieved from AWS CodeCommit, the location of the source code for the
* application version.
*/
public SourceBuildInformation sourceBuildInformation() {
return sourceBuildInformation;
}
/**
*
* Reference to the artifact from the AWS CodeBuild build.
*
*
* @return Reference to the artifact from the AWS CodeBuild build.
*/
public String buildArn() {
return buildArn;
}
/**
*
* The storage location of the application version's source bundle in Amazon S3.
*
*
* @return The storage location of the application version's source bundle in Amazon S3.
*/
public S3Location sourceBundle() {
return sourceBundle;
}
/**
*
* The creation date of the application version.
*
*
* @return The creation date of the application version.
*/
public Instant dateCreated() {
return dateCreated;
}
/**
*
* The last modified date of the application version.
*
*
* @return The last modified date of the application version.
*/
public Instant dateUpdated() {
return dateUpdated;
}
/**
*
* The processing status of the application version. Reflects the state of the application version during its
* creation. Many of the values are only applicable if you specified True
for the Process
* parameter of the CreateApplicationVersion
action. The following list describes the possible values.
*
*
* -
*
* Unprocessed
– Application version wasn't pre-processed or validated. Elastic Beanstalk will validate
* configuration files during deployment of the application version to an environment.
*
*
* -
*
* Processing
– Elastic Beanstalk is currently processing the application version.
*
*
* -
*
* Building
– Application version is currently undergoing an AWS CodeBuild build.
*
*
* -
*
* Processed
– Elastic Beanstalk was successfully pre-processed and validated.
*
*
* -
*
* Failed
– Either the AWS CodeBuild build failed or configuration files didn't pass validation. This
* application version isn't usable.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ApplicationVersionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The processing status of the application version. Reflects the state of the application version during
* its creation. Many of the values are only applicable if you specified True
for the
* Process
parameter of the CreateApplicationVersion
action. The following list
* describes the possible values.
*
* -
*
* Unprocessed
– Application version wasn't pre-processed or validated. Elastic Beanstalk will
* validate configuration files during deployment of the application version to an environment.
*
*
* -
*
* Processing
– Elastic Beanstalk is currently processing the application version.
*
*
* -
*
* Building
– Application version is currently undergoing an AWS CodeBuild build.
*
*
* -
*
* Processed
– Elastic Beanstalk was successfully pre-processed and validated.
*
*
* -
*
* Failed
– Either the AWS CodeBuild build failed or configuration files didn't pass
* validation. This application version isn't usable.
*
*
* @see ApplicationVersionStatus
*/
public ApplicationVersionStatus status() {
return ApplicationVersionStatus.fromValue(status);
}
/**
*
* The processing status of the application version. Reflects the state of the application version during its
* creation. Many of the values are only applicable if you specified True
for the Process
* parameter of the CreateApplicationVersion
action. The following list describes the possible values.
*
*
* -
*
* Unprocessed
– Application version wasn't pre-processed or validated. Elastic Beanstalk will validate
* configuration files during deployment of the application version to an environment.
*
*
* -
*
* Processing
– Elastic Beanstalk is currently processing the application version.
*
*
* -
*
* Building
– Application version is currently undergoing an AWS CodeBuild build.
*
*
* -
*
* Processed
– Elastic Beanstalk was successfully pre-processed and validated.
*
*
* -
*
* Failed
– Either the AWS CodeBuild build failed or configuration files didn't pass validation. This
* application version isn't usable.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ApplicationVersionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The processing status of the application version. Reflects the state of the application version during
* its creation. Many of the values are only applicable if you specified True
for the
* Process
parameter of the CreateApplicationVersion
action. The following list
* describes the possible values.
*
* -
*
* Unprocessed
– Application version wasn't pre-processed or validated. Elastic Beanstalk will
* validate configuration files during deployment of the application version to an environment.
*
*
* -
*
* Processing
– Elastic Beanstalk is currently processing the application version.
*
*
* -
*
* Building
– Application version is currently undergoing an AWS CodeBuild build.
*
*
* -
*
* Processed
– Elastic Beanstalk was successfully pre-processed and validated.
*
*
* -
*
* Failed
– Either the AWS CodeBuild build failed or configuration files didn't pass
* validation. This application version isn't usable.
*
*
* @see ApplicationVersionStatus
*/
public String statusAsString() {
return status;
}
@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(applicationVersionArn());
hashCode = 31 * hashCode + Objects.hashCode(applicationName());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(versionLabel());
hashCode = 31 * hashCode + Objects.hashCode(sourceBuildInformation());
hashCode = 31 * hashCode + Objects.hashCode(buildArn());
hashCode = 31 * hashCode + Objects.hashCode(sourceBundle());
hashCode = 31 * hashCode + Objects.hashCode(dateCreated());
hashCode = 31 * hashCode + Objects.hashCode(dateUpdated());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
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 ApplicationVersionDescription)) {
return false;
}
ApplicationVersionDescription other = (ApplicationVersionDescription) obj;
return Objects.equals(applicationVersionArn(), other.applicationVersionArn())
&& Objects.equals(applicationName(), other.applicationName())
&& Objects.equals(description(), other.description()) && Objects.equals(versionLabel(), other.versionLabel())
&& Objects.equals(sourceBuildInformation(), other.sourceBuildInformation())
&& Objects.equals(buildArn(), other.buildArn()) && Objects.equals(sourceBundle(), other.sourceBundle())
&& Objects.equals(dateCreated(), other.dateCreated()) && Objects.equals(dateUpdated(), other.dateUpdated())
&& Objects.equals(statusAsString(), other.statusAsString());
}
/**
* 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("ApplicationVersionDescription").add("ApplicationVersionArn", applicationVersionArn())
.add("ApplicationName", applicationName()).add("Description", description()).add("VersionLabel", versionLabel())
.add("SourceBuildInformation", sourceBuildInformation()).add("BuildArn", buildArn())
.add("SourceBundle", sourceBundle()).add("DateCreated", dateCreated()).add("DateUpdated", dateUpdated())
.add("Status", statusAsString()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ApplicationVersionArn":
return Optional.ofNullable(clazz.cast(applicationVersionArn()));
case "ApplicationName":
return Optional.ofNullable(clazz.cast(applicationName()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "VersionLabel":
return Optional.ofNullable(clazz.cast(versionLabel()));
case "SourceBuildInformation":
return Optional.ofNullable(clazz.cast(sourceBuildInformation()));
case "BuildArn":
return Optional.ofNullable(clazz.cast(buildArn()));
case "SourceBundle":
return Optional.ofNullable(clazz.cast(sourceBundle()));
case "DateCreated":
return Optional.ofNullable(clazz.cast(dateCreated()));
case "DateUpdated":
return Optional.ofNullable(clazz.cast(dateUpdated()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function