Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.opsworks.model.App Maven / Gradle / Ivy
Go to download
The AWS Java SDK for AWS OpsWorks module holds the client classes that are used for communicating with
AWS OpsWorks Service
/*
* 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.opsworks.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 description of the app.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class App implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField APP_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("AppId")
.getter(getter(App::appId)).setter(setter(Builder::appId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AppId").build()).build();
private static final SdkField STACK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackId").getter(getter(App::stackId)).setter(setter(Builder::stackId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackId").build()).build();
private static final SdkField SHORTNAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Shortname").getter(getter(App::shortname)).setter(setter(Builder::shortname))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Shortname").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(App::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(App::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField> DATA_SOURCES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("DataSources")
.getter(getter(App::dataSources))
.setter(setter(Builder::dataSources))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataSources").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(DataSource::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
.getter(getter(App::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();
private static final SdkField APP_SOURCE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("AppSource").getter(getter(App::appSource)).setter(setter(Builder::appSource))
.constructor(Source::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AppSource").build()).build();
private static final SdkField> DOMAINS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Domains")
.getter(getter(App::domains))
.setter(setter(Builder::domains))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Domains").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 ENABLE_SSL_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("EnableSsl").getter(getter(App::enableSsl)).setter(setter(Builder::enableSsl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableSsl").build()).build();
private static final SdkField SSL_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SslConfiguration")
.getter(getter(App::sslConfiguration)).setter(setter(Builder::sslConfiguration))
.constructor(SslConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SslConfiguration").build()).build();
private static final SdkField> ATTRIBUTES_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Attributes")
.getter(getter(App::attributesAsStrings))
.setter(setter(Builder::attributesWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Attributes").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 CREATED_AT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CreatedAt").getter(getter(App::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build()).build();
private static final SdkField> ENVIRONMENT_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Environment")
.getter(getter(App::environment))
.setter(setter(Builder::environment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Environment").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(EnvironmentVariable::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(APP_ID_FIELD, STACK_ID_FIELD,
SHORTNAME_FIELD, NAME_FIELD, DESCRIPTION_FIELD, DATA_SOURCES_FIELD, TYPE_FIELD, APP_SOURCE_FIELD, DOMAINS_FIELD,
ENABLE_SSL_FIELD, SSL_CONFIGURATION_FIELD, ATTRIBUTES_FIELD, CREATED_AT_FIELD, ENVIRONMENT_FIELD));
private static final long serialVersionUID = 1L;
private final String appId;
private final String stackId;
private final String shortname;
private final String name;
private final String description;
private final List dataSources;
private final String type;
private final Source appSource;
private final List domains;
private final Boolean enableSsl;
private final SslConfiguration sslConfiguration;
private final Map attributes;
private final String createdAt;
private final List environment;
private App(BuilderImpl builder) {
this.appId = builder.appId;
this.stackId = builder.stackId;
this.shortname = builder.shortname;
this.name = builder.name;
this.description = builder.description;
this.dataSources = builder.dataSources;
this.type = builder.type;
this.appSource = builder.appSource;
this.domains = builder.domains;
this.enableSsl = builder.enableSsl;
this.sslConfiguration = builder.sslConfiguration;
this.attributes = builder.attributes;
this.createdAt = builder.createdAt;
this.environment = builder.environment;
}
/**
*
* The app ID.
*
*
* @return The app ID.
*/
public final String appId() {
return appId;
}
/**
*
* The app stack ID.
*
*
* @return The app stack ID.
*/
public final String stackId() {
return stackId;
}
/**
*
* The app's short name.
*
*
* @return The app's short name.
*/
public final String shortname() {
return shortname;
}
/**
*
* The app name.
*
*
* @return The app name.
*/
public final String name() {
return name;
}
/**
*
* A description of the app.
*
*
* @return A description of the app.
*/
public final String description() {
return description;
}
/**
* For responses, this returns true if the service returned a value for the DataSources 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 hasDataSources() {
return dataSources != null && !(dataSources instanceof SdkAutoConstructList);
}
/**
*
* The app's data sources.
*
*
* 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 #hasDataSources} method.
*
*
* @return The app's data sources.
*/
public final List dataSources() {
return dataSources;
}
/**
*
* The app type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link AppType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The app type.
* @see AppType
*/
public final AppType type() {
return AppType.fromValue(type);
}
/**
*
* The app type.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link AppType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The app type.
* @see AppType
*/
public final String typeAsString() {
return type;
}
/**
*
* A Source
object that describes the app repository.
*
*
* @return A Source
object that describes the app repository.
*/
public final Source appSource() {
return appSource;
}
/**
* For responses, this returns true if the service returned a value for the Domains 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 hasDomains() {
return domains != null && !(domains instanceof SdkAutoConstructList);
}
/**
*
* The app vhost settings with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
*
*
* 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 #hasDomains} method.
*
*
* @return The app vhost settings with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
*/
public final List domains() {
return domains;
}
/**
*
* Whether to enable SSL for the app.
*
*
* @return Whether to enable SSL for the app.
*/
public final Boolean enableSsl() {
return enableSsl;
}
/**
*
* An SslConfiguration
object with the SSL configuration.
*
*
* @return An SslConfiguration
object with the SSL configuration.
*/
public final SslConfiguration sslConfiguration() {
return sslConfiguration;
}
/**
*
* The stack attributes.
*
*
* 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 #hasAttributes} method.
*
*
* @return The stack attributes.
*/
public final Map attributes() {
return AppAttributesCopier.copyStringToEnum(attributes);
}
/**
* For responses, this returns true if the service returned a value for the Attributes 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 hasAttributes() {
return attributes != null && !(attributes instanceof SdkAutoConstructMap);
}
/**
*
* The stack attributes.
*
*
* 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 #hasAttributes} method.
*
*
* @return The stack attributes.
*/
public final Map attributesAsStrings() {
return attributes;
}
/**
*
* When the app was created.
*
*
* @return When the app was created.
*/
public final String createdAt() {
return createdAt;
}
/**
* For responses, this returns true if the service returned a value for the Environment 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 hasEnvironment() {
return environment != null && !(environment instanceof SdkAutoConstructList);
}
/**
*
* An array of EnvironmentVariable
objects that specify environment variables to be associated with the
* app. After you deploy the app, these variables are defined on the associated app server instances. For more
* information, see Environment Variables .
*
*
*
* There is no specific limit on the number of environment variables. However, the size of the associated data
* structure - which includes the variable names, values, and protected flag values - cannot exceed 20 KB. This
* limit should accommodate most if not all use cases, but if you do exceed it, you will cause an exception (API)
* with an "Environment: is too large (maximum is 20 KB)" message.
*
*
*
* 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 #hasEnvironment} method.
*
*
* @return An array of EnvironmentVariable
objects that specify environment variables to be associated
* with the app. After you deploy the app, these variables are defined on the associated app server
* instances. For more information, see Environment Variables .
*
* There is no specific limit on the number of environment variables. However, the size of the associated
* data structure - which includes the variable names, values, and protected flag values - cannot exceed 20
* KB. This limit should accommodate most if not all use cases, but if you do exceed it, you will cause an
* exception (API) with an "Environment: is too large (maximum is 20 KB)" message.
*
*/
public final List environment() {
return environment;
}
@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(appId());
hashCode = 31 * hashCode + Objects.hashCode(stackId());
hashCode = 31 * hashCode + Objects.hashCode(shortname());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(hasDataSources() ? dataSources() : null);
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(appSource());
hashCode = 31 * hashCode + Objects.hashCode(hasDomains() ? domains() : null);
hashCode = 31 * hashCode + Objects.hashCode(enableSsl());
hashCode = 31 * hashCode + Objects.hashCode(sslConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributes() ? attributesAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(hasEnvironment() ? environment() : null);
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 App)) {
return false;
}
App other = (App) obj;
return Objects.equals(appId(), other.appId()) && Objects.equals(stackId(), other.stackId())
&& Objects.equals(shortname(), other.shortname()) && Objects.equals(name(), other.name())
&& Objects.equals(description(), other.description()) && hasDataSources() == other.hasDataSources()
&& Objects.equals(dataSources(), other.dataSources()) && Objects.equals(typeAsString(), other.typeAsString())
&& Objects.equals(appSource(), other.appSource()) && hasDomains() == other.hasDomains()
&& Objects.equals(domains(), other.domains()) && Objects.equals(enableSsl(), other.enableSsl())
&& Objects.equals(sslConfiguration(), other.sslConfiguration()) && hasAttributes() == other.hasAttributes()
&& Objects.equals(attributesAsStrings(), other.attributesAsStrings())
&& Objects.equals(createdAt(), other.createdAt()) && hasEnvironment() == other.hasEnvironment()
&& Objects.equals(environment(), other.environment());
}
/**
* 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("App").add("AppId", appId()).add("StackId", stackId()).add("Shortname", shortname())
.add("Name", name()).add("Description", description())
.add("DataSources", hasDataSources() ? dataSources() : null).add("Type", typeAsString())
.add("AppSource", appSource()).add("Domains", hasDomains() ? domains() : null).add("EnableSsl", enableSsl())
.add("SslConfiguration", sslConfiguration()).add("Attributes", hasAttributes() ? attributesAsStrings() : null)
.add("CreatedAt", createdAt()).add("Environment", hasEnvironment() ? environment() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AppId":
return Optional.ofNullable(clazz.cast(appId()));
case "StackId":
return Optional.ofNullable(clazz.cast(stackId()));
case "Shortname":
return Optional.ofNullable(clazz.cast(shortname()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "DataSources":
return Optional.ofNullable(clazz.cast(dataSources()));
case "Type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "AppSource":
return Optional.ofNullable(clazz.cast(appSource()));
case "Domains":
return Optional.ofNullable(clazz.cast(domains()));
case "EnableSsl":
return Optional.ofNullable(clazz.cast(enableSsl()));
case "SslConfiguration":
return Optional.ofNullable(clazz.cast(sslConfiguration()));
case "Attributes":
return Optional.ofNullable(clazz.cast(attributesAsStrings()));
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "Environment":
return Optional.ofNullable(clazz.cast(environment()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((App) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* The app ID.
*
*
* @param appId
* The app ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder appId(String appId);
/**
*
* The app stack ID.
*
*
* @param stackId
* The app stack ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stackId(String stackId);
/**
*
* The app's short name.
*
*
* @param shortname
* The app's short name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder shortname(String shortname);
/**
*
* The app name.
*
*
* @param name
* The app name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* A description of the app.
*
*
* @param description
* A description of the app.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* The app's data sources.
*
*
* @param dataSources
* The app's data sources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder dataSources(Collection dataSources);
/**
*
* The app's data sources.
*
*
* @param dataSources
* The app's data sources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder dataSources(DataSource... dataSources);
/**
*
* The app's data sources.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.opsworks.model.DataSource.Builder} avoiding the need to create one
* manually via {@link software.amazon.awssdk.services.opsworks.model.DataSource#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.opsworks.model.DataSource.Builder#build()} is called immediately and
* its result is passed to {@link #dataSources(List)}.
*
* @param dataSources
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.opsworks.model.DataSource.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #dataSources(java.util.Collection)
*/
Builder dataSources(Consumer... dataSources);
/**
*
* The app type.
*
*
* @param type
* The app type.
* @see AppType
* @return Returns a reference to this object so that method calls can be chained together.
* @see AppType
*/
Builder type(String type);
/**
*
* The app type.
*
*
* @param type
* The app type.
* @see AppType
* @return Returns a reference to this object so that method calls can be chained together.
* @see AppType
*/
Builder type(AppType type);
/**
*
* A Source
object that describes the app repository.
*
*
* @param appSource
* A Source
object that describes the app repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder appSource(Source appSource);
/**
*
* A Source
object that describes the app repository.
*
* This is a convenience method that creates an instance of the {@link Source.Builder} avoiding the need to
* create one manually via {@link Source#builder()}.
*
*
* When the {@link Consumer} completes, {@link Source.Builder#build()} is called immediately and its result is
* passed to {@link #appSource(Source)}.
*
* @param appSource
* a consumer that will call methods on {@link Source.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #appSource(Source)
*/
default Builder appSource(Consumer appSource) {
return appSource(Source.builder().applyMutation(appSource).build());
}
/**
*
* The app vhost settings with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
*
*
* @param domains
* The app vhost settings with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder domains(Collection domains);
/**
*
* The app vhost settings with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
*
*
* @param domains
* The app vhost settings with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder domains(String... domains);
/**
*
* Whether to enable SSL for the app.
*
*
* @param enableSsl
* Whether to enable SSL for the app.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder enableSsl(Boolean enableSsl);
/**
*
* An SslConfiguration
object with the SSL configuration.
*
*
* @param sslConfiguration
* An SslConfiguration
object with the SSL configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sslConfiguration(SslConfiguration sslConfiguration);
/**
*
* An SslConfiguration
object with the SSL configuration.
*
* This is a convenience method that creates an instance of the {@link SslConfiguration.Builder} avoiding the
* need to create one manually via {@link SslConfiguration#builder()}.
*
*
* When the {@link Consumer} completes, {@link SslConfiguration.Builder#build()} is called immediately and its
* result is passed to {@link #sslConfiguration(SslConfiguration)}.
*
* @param sslConfiguration
* a consumer that will call methods on {@link SslConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #sslConfiguration(SslConfiguration)
*/
default Builder sslConfiguration(Consumer sslConfiguration) {
return sslConfiguration(SslConfiguration.builder().applyMutation(sslConfiguration).build());
}
/**
*
* The stack attributes.
*
*
* @param attributes
* The stack attributes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributesWithStrings(Map attributes);
/**
*
* The stack attributes.
*
*
* @param attributes
* The stack attributes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributes(Map attributes);
/**
*
* When the app was created.
*
*
* @param createdAt
* When the app was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createdAt(String createdAt);
/**
*
* An array of EnvironmentVariable
objects that specify environment variables to be associated with
* the app. After you deploy the app, these variables are defined on the associated app server instances. For
* more information, see Environment Variables .
*
*
*
* There is no specific limit on the number of environment variables. However, the size of the associated data
* structure - which includes the variable names, values, and protected flag values - cannot exceed 20 KB. This
* limit should accommodate most if not all use cases, but if you do exceed it, you will cause an exception
* (API) with an "Environment: is too large (maximum is 20 KB)" message.
*
*
*
* @param environment
* An array of EnvironmentVariable
objects that specify environment variables to be
* associated with the app. After you deploy the app, these variables are defined on the associated app
* server instances. For more information, see Environment Variables .
*
* There is no specific limit on the number of environment variables. However, the size of the associated
* data structure - which includes the variable names, values, and protected flag values - cannot exceed
* 20 KB. This limit should accommodate most if not all use cases, but if you do exceed it, you will
* cause an exception (API) with an "Environment: is too large (maximum is 20 KB)" message.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder environment(Collection environment);
/**
*
* An array of EnvironmentVariable
objects that specify environment variables to be associated with
* the app. After you deploy the app, these variables are defined on the associated app server instances. For
* more information, see Environment Variables .
*
*
*
* There is no specific limit on the number of environment variables. However, the size of the associated data
* structure - which includes the variable names, values, and protected flag values - cannot exceed 20 KB. This
* limit should accommodate most if not all use cases, but if you do exceed it, you will cause an exception
* (API) with an "Environment: is too large (maximum is 20 KB)" message.
*
*
*
* @param environment
* An array of EnvironmentVariable
objects that specify environment variables to be
* associated with the app. After you deploy the app, these variables are defined on the associated app
* server instances. For more information, see Environment Variables .
*
* There is no specific limit on the number of environment variables. However, the size of the associated
* data structure - which includes the variable names, values, and protected flag values - cannot exceed
* 20 KB. This limit should accommodate most if not all use cases, but if you do exceed it, you will
* cause an exception (API) with an "Environment: is too large (maximum is 20 KB)" message.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder environment(EnvironmentVariable... environment);
/**
*
* An array of EnvironmentVariable
objects that specify environment variables to be associated with
* the app. After you deploy the app, these variables are defined on the associated app server instances. For
* more information, see Environment Variables .
*
*
*
* There is no specific limit on the number of environment variables. However, the size of the associated data
* structure - which includes the variable names, values, and protected flag values - cannot exceed 20 KB. This
* limit should accommodate most if not all use cases, but if you do exceed it, you will cause an exception
* (API) with an "Environment: is too large (maximum is 20 KB)" message.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.opsworks.model.EnvironmentVariable.Builder} avoiding the need to
* create one manually via {@link software.amazon.awssdk.services.opsworks.model.EnvironmentVariable#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.opsworks.model.EnvironmentVariable.Builder#build()} is called
* immediately and its result is passed to {@link #environment(List)}.
*
* @param environment
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.opsworks.model.EnvironmentVariable.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #environment(java.util.Collection)
*/
Builder environment(Consumer... environment);
}
static final class BuilderImpl implements Builder {
private String appId;
private String stackId;
private String shortname;
private String name;
private String description;
private List dataSources = DefaultSdkAutoConstructList.getInstance();
private String type;
private Source appSource;
private List domains = DefaultSdkAutoConstructList.getInstance();
private Boolean enableSsl;
private SslConfiguration sslConfiguration;
private Map attributes = DefaultSdkAutoConstructMap.getInstance();
private String createdAt;
private List environment = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(App model) {
appId(model.appId);
stackId(model.stackId);
shortname(model.shortname);
name(model.name);
description(model.description);
dataSources(model.dataSources);
type(model.type);
appSource(model.appSource);
domains(model.domains);
enableSsl(model.enableSsl);
sslConfiguration(model.sslConfiguration);
attributesWithStrings(model.attributes);
createdAt(model.createdAt);
environment(model.environment);
}
public final String getAppId() {
return appId;
}
public final void setAppId(String appId) {
this.appId = appId;
}
@Override
public final Builder appId(String appId) {
this.appId = appId;
return this;
}
public final String getStackId() {
return stackId;
}
public final void setStackId(String stackId) {
this.stackId = stackId;
}
@Override
public final Builder stackId(String stackId) {
this.stackId = stackId;
return this;
}
public final String getShortname() {
return shortname;
}
public final void setShortname(String shortname) {
this.shortname = shortname;
}
@Override
public final Builder shortname(String shortname) {
this.shortname = shortname;
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 List getDataSources() {
List result = DataSourcesCopier.copyToBuilder(this.dataSources);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setDataSources(Collection dataSources) {
this.dataSources = DataSourcesCopier.copyFromBuilder(dataSources);
}
@Override
public final Builder dataSources(Collection dataSources) {
this.dataSources = DataSourcesCopier.copy(dataSources);
return this;
}
@Override
@SafeVarargs
public final Builder dataSources(DataSource... dataSources) {
dataSources(Arrays.asList(dataSources));
return this;
}
@Override
@SafeVarargs
public final Builder dataSources(Consumer... dataSources) {
dataSources(Stream.of(dataSources).map(c -> DataSource.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final String getType() {
return type;
}
public final void setType(String type) {
this.type = type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(AppType type) {
this.type(type == null ? null : type.toString());
return this;
}
public final Source.Builder getAppSource() {
return appSource != null ? appSource.toBuilder() : null;
}
public final void setAppSource(Source.BuilderImpl appSource) {
this.appSource = appSource != null ? appSource.build() : null;
}
@Override
public final Builder appSource(Source appSource) {
this.appSource = appSource;
return this;
}
public final Collection getDomains() {
if (domains instanceof SdkAutoConstructList) {
return null;
}
return domains;
}
public final void setDomains(Collection domains) {
this.domains = StringsCopier.copy(domains);
}
@Override
public final Builder domains(Collection domains) {
this.domains = StringsCopier.copy(domains);
return this;
}
@Override
@SafeVarargs
public final Builder domains(String... domains) {
domains(Arrays.asList(domains));
return this;
}
public final Boolean getEnableSsl() {
return enableSsl;
}
public final void setEnableSsl(Boolean enableSsl) {
this.enableSsl = enableSsl;
}
@Override
public final Builder enableSsl(Boolean enableSsl) {
this.enableSsl = enableSsl;
return this;
}
public final SslConfiguration.Builder getSslConfiguration() {
return sslConfiguration != null ? sslConfiguration.toBuilder() : null;
}
public final void setSslConfiguration(SslConfiguration.BuilderImpl sslConfiguration) {
this.sslConfiguration = sslConfiguration != null ? sslConfiguration.build() : null;
}
@Override
public final Builder sslConfiguration(SslConfiguration sslConfiguration) {
this.sslConfiguration = sslConfiguration;
return this;
}
public final Map getAttributes() {
if (attributes instanceof SdkAutoConstructMap) {
return null;
}
return attributes;
}
public final void setAttributes(Map attributes) {
this.attributes = AppAttributesCopier.copy(attributes);
}
@Override
public final Builder attributesWithStrings(Map attributes) {
this.attributes = AppAttributesCopier.copy(attributes);
return this;
}
@Override
public final Builder attributes(Map attributes) {
this.attributes = AppAttributesCopier.copyEnumToString(attributes);
return this;
}
public final String getCreatedAt() {
return createdAt;
}
public final void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
@Override
public final Builder createdAt(String createdAt) {
this.createdAt = createdAt;
return this;
}
public final List getEnvironment() {
List result = EnvironmentVariablesCopier.copyToBuilder(this.environment);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setEnvironment(Collection environment) {
this.environment = EnvironmentVariablesCopier.copyFromBuilder(environment);
}
@Override
public final Builder environment(Collection environment) {
this.environment = EnvironmentVariablesCopier.copy(environment);
return this;
}
@Override
@SafeVarargs
public final Builder environment(EnvironmentVariable... environment) {
environment(Arrays.asList(environment));
return this;
}
@Override
@SafeVarargs
public final Builder environment(Consumer... environment) {
environment(Stream.of(environment).map(c -> EnvironmentVariable.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
@Override
public App build() {
return new App(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}