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.UpdateAppRequest 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.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
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.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.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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateAppRequest extends OpsWorksRequest implements
ToCopyableBuilder {
private static final SdkField APP_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("AppId")
.getter(getter(UpdateAppRequest::appId)).setter(setter(Builder::appId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AppId").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(UpdateAppRequest::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(UpdateAppRequest::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(UpdateAppRequest::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(UpdateAppRequest::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(UpdateAppRequest::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(UpdateAppRequest::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(UpdateAppRequest::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(UpdateAppRequest::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(UpdateAppRequest::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> ENVIRONMENT_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Environment")
.getter(getter(UpdateAppRequest::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, NAME_FIELD,
DESCRIPTION_FIELD, DATA_SOURCES_FIELD, TYPE_FIELD, APP_SOURCE_FIELD, DOMAINS_FIELD, ENABLE_SSL_FIELD,
SSL_CONFIGURATION_FIELD, ATTRIBUTES_FIELD, ENVIRONMENT_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private final String appId;
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 List environment;
private UpdateAppRequest(BuilderImpl builder) {
super(builder);
this.appId = builder.appId;
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.environment = builder.environment;
}
/**
*
* The app ID.
*
*
* @return The app ID.
*/
public final String appId() {
return appId;
}
/**
*
* 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 specifies the app repository.
*
*
* @return A Source
object that specifies 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's virtual host 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's virtual host settings, with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
*/
public final List domains() {
return domains;
}
/**
*
* Whether SSL is enabled for the app.
*
*
* @return Whether SSL is enabled 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;
}
/**
*
* One or more user-defined key/value pairs to be added to 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 One or more user-defined key/value pairs to be added to 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);
}
/**
*
* One or more user-defined key/value pairs to be added to 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 One or more user-defined key/value pairs to be added to the stack attributes.
*/
public final Map attributesAsStrings() {
return attributes;
}
/**
* 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 variables' names, values, and protected flag values - cannot exceed 20 KB. This
* limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message,
* "Environment: is too large (maximum is 20 KB)."
*
*
*
* If you have specified one or more environment variables, you cannot modify the stack's Chef version.
*
*
*
* 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 variables' names, values, and protected flag values - cannot exceed
* 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with
* the message, "Environment: is too large (maximum is 20 KB)."
*
*
*
* If you have specified one or more environment variables, you cannot modify the stack's Chef version.
*
*/
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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(appId());
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(hasEnvironment() ? environment() : null);
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 UpdateAppRequest)) {
return false;
}
UpdateAppRequest other = (UpdateAppRequest) obj;
return Objects.equals(appId(), other.appId()) && 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())
&& 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("UpdateAppRequest").add("AppId", appId()).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("Environment", hasEnvironment() ? environment() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AppId":
return Optional.ofNullable(clazz.cast(appId()));
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 "Environment":
return Optional.ofNullable(clazz.cast(environment()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("AppId", APP_ID_FIELD);
map.put("Name", NAME_FIELD);
map.put("Description", DESCRIPTION_FIELD);
map.put("DataSources", DATA_SOURCES_FIELD);
map.put("Type", TYPE_FIELD);
map.put("AppSource", APP_SOURCE_FIELD);
map.put("Domains", DOMAINS_FIELD);
map.put("EnableSsl", ENABLE_SSL_FIELD);
map.put("SslConfiguration", SSL_CONFIGURATION_FIELD);
map.put("Attributes", ATTRIBUTES_FIELD);
map.put("Environment", ENVIRONMENT_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function getter(Function g) {
return obj -> g.apply((UpdateAppRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends OpsWorksRequest.Builder, 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 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 specifies the app repository.
*
*
* @param appSource
* A Source
object that specifies 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 specifies 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's virtual host settings, with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
*
*
* @param domains
* The app's virtual host 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's virtual host settings, with multiple domains separated by commas. For example:
* 'www.example.com, example.com'
*
*
* @param domains
* The app's virtual host 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 SSL is enabled for the app.
*
*
* @param enableSsl
* Whether SSL is enabled 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());
}
/**
*
* One or more user-defined key/value pairs to be added to the stack attributes.
*
*
* @param attributes
* One or more user-defined key/value pairs to be added to the stack attributes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributesWithStrings(Map attributes);
/**
*
* One or more user-defined key/value pairs to be added to the stack attributes.
*
*
* @param attributes
* One or more user-defined key/value pairs to be added to the stack attributes.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder attributes(Map attributes);
/**
*
* 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 variables' names, values, and protected flag values - cannot exceed 20 KB.
* This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the
* message, "Environment: is too large (maximum is 20 KB)."
*
*
*
* If you have specified one or more environment variables, you cannot modify the stack's Chef version.
*
*
*
* @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 variables' names, values, and protected flag values - cannot
* exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an
* exception with the message, "Environment: is too large (maximum is 20 KB)."
*
*
*
* If you have specified one or more environment variables, you cannot modify the stack's Chef version.
*
* @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 variables' names, values, and protected flag values - cannot exceed 20 KB.
* This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the
* message, "Environment: is too large (maximum is 20 KB)."
*
*
*
* If you have specified one or more environment variables, you cannot modify the stack's Chef version.
*
*
*
* @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 variables' names, values, and protected flag values - cannot
* exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an
* exception with the message, "Environment: is too large (maximum is 20 KB)."
*
*
*
* If you have specified one or more environment variables, you cannot modify the stack's Chef version.
*
* @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 variables' names, values, and protected flag values - cannot exceed 20 KB.
* This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the
* message, "Environment: is too large (maximum is 20 KB)."
*
*
*
* If you have specified one or more environment variables, you cannot modify the stack's Chef version.
*
* 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);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends OpsWorksRequest.BuilderImpl implements Builder {
private String appId;
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 List environment = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(UpdateAppRequest model) {
super(model);
appId(model.appId);
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);
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 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 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 Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public UpdateAppRequest build() {
return new UpdateAppRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
@Override
public Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
}
}