software.amazon.awssdk.services.elasticbeanstalk.model.ApplicationDescription 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.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ApplicationDescription implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField APPLICATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ApplicationArn").getter(getter(ApplicationDescription::applicationArn))
.setter(setter(Builder::applicationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationArn").build()).build();
private static final SdkField APPLICATION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ApplicationName").getter(getter(ApplicationDescription::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(ApplicationDescription::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField DATE_CREATED_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("DateCreated").getter(getter(ApplicationDescription::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(ApplicationDescription::dateUpdated)).setter(setter(Builder::dateUpdated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DateUpdated").build()).build();
private static final SdkField> VERSIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Versions")
.getter(getter(ApplicationDescription::versions))
.setter(setter(Builder::versions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Versions").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> CONFIGURATION_TEMPLATES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ConfigurationTemplates")
.getter(getter(ApplicationDescription::configurationTemplates))
.setter(setter(Builder::configurationTemplates))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfigurationTemplates").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField RESOURCE_LIFECYCLE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ResourceLifecycleConfig")
.getter(getter(ApplicationDescription::resourceLifecycleConfig)).setter(setter(Builder::resourceLifecycleConfig))
.constructor(ApplicationResourceLifecycleConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceLifecycleConfig").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APPLICATION_ARN_FIELD,
APPLICATION_NAME_FIELD, DESCRIPTION_FIELD, DATE_CREATED_FIELD, DATE_UPDATED_FIELD, VERSIONS_FIELD,
CONFIGURATION_TEMPLATES_FIELD, RESOURCE_LIFECYCLE_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final String applicationArn;
private final String applicationName;
private final String description;
private final Instant dateCreated;
private final Instant dateUpdated;
private final List versions;
private final List configurationTemplates;
private final ApplicationResourceLifecycleConfig resourceLifecycleConfig;
private ApplicationDescription(BuilderImpl builder) {
this.applicationArn = builder.applicationArn;
this.applicationName = builder.applicationName;
this.description = builder.description;
this.dateCreated = builder.dateCreated;
this.dateUpdated = builder.dateUpdated;
this.versions = builder.versions;
this.configurationTemplates = builder.configurationTemplates;
this.resourceLifecycleConfig = builder.resourceLifecycleConfig;
}
/**
*
* The Amazon Resource Name (ARN) of the application.
*
*
* @return The Amazon Resource Name (ARN) of the application.
*/
public final String applicationArn() {
return applicationArn;
}
/**
*
* The name of the application.
*
*
* @return The name of the application.
*/
public final String applicationName() {
return applicationName;
}
/**
*
* User-defined description of the application.
*
*
* @return User-defined description of the application.
*/
public final String description() {
return description;
}
/**
*
* The date when the application was created.
*
*
* @return The date when the application was created.
*/
public final Instant dateCreated() {
return dateCreated;
}
/**
*
* The date when the application was last modified.
*
*
* @return The date when the application was last modified.
*/
public final Instant dateUpdated() {
return dateUpdated;
}
/**
* For responses, this returns true if the service returned a value for the Versions 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 hasVersions() {
return versions != null && !(versions instanceof SdkAutoConstructList);
}
/**
*
* The names of the versions for this application.
*
*
* 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 #hasVersions} method.
*
*
* @return The names of the versions for this application.
*/
public final List versions() {
return versions;
}
/**
* For responses, this returns true if the service returned a value for the ConfigurationTemplates 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 hasConfigurationTemplates() {
return configurationTemplates != null && !(configurationTemplates instanceof SdkAutoConstructList);
}
/**
*
* The names of the configuration templates associated with this application.
*
*
* 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 #hasConfigurationTemplates} method.
*
*
* @return The names of the configuration templates associated with this application.
*/
public final List configurationTemplates() {
return configurationTemplates;
}
/**
*
* The lifecycle settings for the application.
*
*
* @return The lifecycle settings for the application.
*/
public final ApplicationResourceLifecycleConfig resourceLifecycleConfig() {
return resourceLifecycleConfig;
}
@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 + Objects.hashCode(applicationArn());
hashCode = 31 * hashCode + Objects.hashCode(applicationName());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(dateCreated());
hashCode = 31 * hashCode + Objects.hashCode(dateUpdated());
hashCode = 31 * hashCode + Objects.hashCode(hasVersions() ? versions() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasConfigurationTemplates() ? configurationTemplates() : null);
hashCode = 31 * hashCode + Objects.hashCode(resourceLifecycleConfig());
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 ApplicationDescription)) {
return false;
}
ApplicationDescription other = (ApplicationDescription) obj;
return Objects.equals(applicationArn(), other.applicationArn())
&& Objects.equals(applicationName(), other.applicationName())
&& Objects.equals(description(), other.description()) && Objects.equals(dateCreated(), other.dateCreated())
&& Objects.equals(dateUpdated(), other.dateUpdated()) && hasVersions() == other.hasVersions()
&& Objects.equals(versions(), other.versions())
&& hasConfigurationTemplates() == other.hasConfigurationTemplates()
&& Objects.equals(configurationTemplates(), other.configurationTemplates())
&& Objects.equals(resourceLifecycleConfig(), other.resourceLifecycleConfig());
}
/**
* 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("ApplicationDescription").add("ApplicationArn", applicationArn())
.add("ApplicationName", applicationName()).add("Description", description()).add("DateCreated", dateCreated())
.add("DateUpdated", dateUpdated()).add("Versions", hasVersions() ? versions() : null)
.add("ConfigurationTemplates", hasConfigurationTemplates() ? configurationTemplates() : null)
.add("ResourceLifecycleConfig", resourceLifecycleConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ApplicationArn":
return Optional.ofNullable(clazz.cast(applicationArn()));
case "ApplicationName":
return Optional.ofNullable(clazz.cast(applicationName()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "DateCreated":
return Optional.ofNullable(clazz.cast(dateCreated()));
case "DateUpdated":
return Optional.ofNullable(clazz.cast(dateUpdated()));
case "Versions":
return Optional.ofNullable(clazz.cast(versions()));
case "ConfigurationTemplates":
return Optional.ofNullable(clazz.cast(configurationTemplates()));
case "ResourceLifecycleConfig":
return Optional.ofNullable(clazz.cast(resourceLifecycleConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function