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

software.amazon.awssdk.services.elasticbeanstalk.model.ApplicationDescription Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Elastic Beanstalk module holds the client classes that are used for communicating with AWS Elastic Beanstalk Service

There is a newer version: 2.30.1
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((ApplicationDescription) 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 application. *

* * @param applicationArn * The Amazon Resource Name (ARN) of the application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder applicationArn(String applicationArn); /** *

* The name of the application. *

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

* User-defined description of the application. *

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

* The date when the application was created. *

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

* The date when the application was last modified. *

* * @param dateUpdated * The date when the application was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dateUpdated(Instant dateUpdated); /** *

* The names of the versions for this application. *

* * @param versions * The names of the versions for this application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder versions(Collection versions); /** *

* The names of the versions for this application. *

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

* The names of the configuration templates associated with this application. *

* * @param configurationTemplates * The names of the configuration templates associated with this application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder configurationTemplates(Collection configurationTemplates); /** *

* The names of the configuration templates associated with this application. *

* * @param configurationTemplates * The names of the configuration templates associated with this application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder configurationTemplates(String... configurationTemplates); /** *

* The lifecycle settings for the application. *

* * @param resourceLifecycleConfig * The lifecycle settings for the application. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceLifecycleConfig(ApplicationResourceLifecycleConfig resourceLifecycleConfig); /** *

* The lifecycle settings for the application. *

* This is a convenience that creates an instance of the {@link ApplicationResourceLifecycleConfig.Builder} * avoiding the need to create one manually via {@link ApplicationResourceLifecycleConfig#builder()}. * * When the {@link Consumer} completes, {@link ApplicationResourceLifecycleConfig.Builder#build()} is called * immediately and its result is passed to {@link #resourceLifecycleConfig(ApplicationResourceLifecycleConfig)}. * * @param resourceLifecycleConfig * a consumer that will call methods on {@link ApplicationResourceLifecycleConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #resourceLifecycleConfig(ApplicationResourceLifecycleConfig) */ default Builder resourceLifecycleConfig(Consumer resourceLifecycleConfig) { return resourceLifecycleConfig(ApplicationResourceLifecycleConfig.builder().applyMutation(resourceLifecycleConfig) .build()); } } static final class BuilderImpl implements Builder { private String applicationArn; private String applicationName; private String description; private Instant dateCreated; private Instant dateUpdated; private List versions = DefaultSdkAutoConstructList.getInstance(); private List configurationTemplates = DefaultSdkAutoConstructList.getInstance(); private ApplicationResourceLifecycleConfig resourceLifecycleConfig; private BuilderImpl() { } private BuilderImpl(ApplicationDescription model) { applicationArn(model.applicationArn); applicationName(model.applicationName); description(model.description); dateCreated(model.dateCreated); dateUpdated(model.dateUpdated); versions(model.versions); configurationTemplates(model.configurationTemplates); resourceLifecycleConfig(model.resourceLifecycleConfig); } public final String getApplicationArn() { return applicationArn; } public final void setApplicationArn(String applicationArn) { this.applicationArn = applicationArn; } @Override @Transient public final Builder applicationArn(String applicationArn) { this.applicationArn = applicationArn; return this; } public final String getApplicationName() { return applicationName; } public final void setApplicationName(String applicationName) { this.applicationName = applicationName; } @Override @Transient public final Builder applicationName(String applicationName) { this.applicationName = applicationName; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override @Transient public final Builder description(String description) { this.description = description; return this; } public final Instant getDateCreated() { return dateCreated; } public final void setDateCreated(Instant dateCreated) { this.dateCreated = dateCreated; } @Override @Transient public final Builder dateCreated(Instant dateCreated) { this.dateCreated = dateCreated; return this; } public final Instant getDateUpdated() { return dateUpdated; } public final void setDateUpdated(Instant dateUpdated) { this.dateUpdated = dateUpdated; } @Override @Transient public final Builder dateUpdated(Instant dateUpdated) { this.dateUpdated = dateUpdated; return this; } public final Collection getVersions() { if (versions instanceof SdkAutoConstructList) { return null; } return versions; } public final void setVersions(Collection versions) { this.versions = VersionLabelsListCopier.copy(versions); } @Override @Transient public final Builder versions(Collection versions) { this.versions = VersionLabelsListCopier.copy(versions); return this; } @Override @Transient @SafeVarargs public final Builder versions(String... versions) { versions(Arrays.asList(versions)); return this; } public final Collection getConfigurationTemplates() { if (configurationTemplates instanceof SdkAutoConstructList) { return null; } return configurationTemplates; } public final void setConfigurationTemplates(Collection configurationTemplates) { this.configurationTemplates = ConfigurationTemplateNamesListCopier.copy(configurationTemplates); } @Override @Transient public final Builder configurationTemplates(Collection configurationTemplates) { this.configurationTemplates = ConfigurationTemplateNamesListCopier.copy(configurationTemplates); return this; } @Override @Transient @SafeVarargs public final Builder configurationTemplates(String... configurationTemplates) { configurationTemplates(Arrays.asList(configurationTemplates)); return this; } public final ApplicationResourceLifecycleConfig.Builder getResourceLifecycleConfig() { return resourceLifecycleConfig != null ? resourceLifecycleConfig.toBuilder() : null; } public final void setResourceLifecycleConfig(ApplicationResourceLifecycleConfig.BuilderImpl resourceLifecycleConfig) { this.resourceLifecycleConfig = resourceLifecycleConfig != null ? resourceLifecycleConfig.build() : null; } @Override @Transient public final Builder resourceLifecycleConfig(ApplicationResourceLifecycleConfig resourceLifecycleConfig) { this.resourceLifecycleConfig = resourceLifecycleConfig; return this; } @Override public ApplicationDescription build() { return new ApplicationDescription(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy