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.appstream.model.CreateStackRequest Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Amazon AppStream module holds the client classes that are used for communicating
with Amazon AppStream.
/*
* 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.appstream.model;
import java.beans.Transient;
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.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 CreateStackRequest extends AppStreamRequest implements
ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(CreateStackRequest::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(CreateStackRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DisplayName").getter(getter(CreateStackRequest::displayName)).setter(setter(Builder::displayName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build();
private static final SdkField> STORAGE_CONNECTORS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("StorageConnectors")
.getter(getter(CreateStackRequest::storageConnectors))
.setter(setter(Builder::storageConnectors))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageConnectors").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(StorageConnector::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField REDIRECT_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RedirectURL").getter(getter(CreateStackRequest::redirectURL)).setter(setter(Builder::redirectURL))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RedirectURL").build()).build();
private static final SdkField FEEDBACK_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FeedbackURL").getter(getter(CreateStackRequest::feedbackURL)).setter(setter(Builder::feedbackURL))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FeedbackURL").build()).build();
private static final SdkField> USER_SETTINGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("UserSettings")
.getter(getter(CreateStackRequest::userSettings))
.setter(setter(Builder::userSettings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserSettings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(UserSetting::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField APPLICATION_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ApplicationSettings")
.getter(getter(CreateStackRequest::applicationSettings)).setter(setter(Builder::applicationSettings))
.constructor(ApplicationSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationSettings").build())
.build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Tags")
.getter(getter(CreateStackRequest::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").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> ACCESS_ENDPOINTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AccessEndpoints")
.getter(getter(CreateStackRequest::accessEndpoints))
.setter(setter(Builder::accessEndpoints))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccessEndpoints").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AccessEndpoint::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> EMBED_HOST_DOMAINS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("EmbedHostDomains")
.getter(getter(CreateStackRequest::embedHostDomains))
.setter(setter(Builder::embedHostDomains))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EmbedHostDomains").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 List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, DESCRIPTION_FIELD,
DISPLAY_NAME_FIELD, STORAGE_CONNECTORS_FIELD, REDIRECT_URL_FIELD, FEEDBACK_URL_FIELD, USER_SETTINGS_FIELD,
APPLICATION_SETTINGS_FIELD, TAGS_FIELD, ACCESS_ENDPOINTS_FIELD, EMBED_HOST_DOMAINS_FIELD));
private final String name;
private final String description;
private final String displayName;
private final List storageConnectors;
private final String redirectURL;
private final String feedbackURL;
private final List userSettings;
private final ApplicationSettings applicationSettings;
private final Map tags;
private final List accessEndpoints;
private final List embedHostDomains;
private CreateStackRequest(BuilderImpl builder) {
super(builder);
this.name = builder.name;
this.description = builder.description;
this.displayName = builder.displayName;
this.storageConnectors = builder.storageConnectors;
this.redirectURL = builder.redirectURL;
this.feedbackURL = builder.feedbackURL;
this.userSettings = builder.userSettings;
this.applicationSettings = builder.applicationSettings;
this.tags = builder.tags;
this.accessEndpoints = builder.accessEndpoints;
this.embedHostDomains = builder.embedHostDomains;
}
/**
*
* The name of the stack.
*
*
* @return The name of the stack.
*/
public final String name() {
return name;
}
/**
*
* The description to display.
*
*
* @return The description to display.
*/
public final String description() {
return description;
}
/**
*
* The stack name to display.
*
*
* @return The stack name to display.
*/
public final String displayName() {
return displayName;
}
/**
* For responses, this returns true if the service returned a value for the StorageConnectors 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 hasStorageConnectors() {
return storageConnectors != null && !(storageConnectors instanceof SdkAutoConstructList);
}
/**
*
* The storage connectors to enable.
*
*
* 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 #hasStorageConnectors} method.
*
*
* @return The storage connectors to enable.
*/
public final List storageConnectors() {
return storageConnectors;
}
/**
*
* The URL that users are redirected to after their streaming session ends.
*
*
* @return The URL that users are redirected to after their streaming session ends.
*/
public final String redirectURL() {
return redirectURL;
}
/**
*
* The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send
* Feedback link is displayed.
*
*
* @return The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no
* Send Feedback link is displayed.
*/
public final String feedbackURL() {
return feedbackURL;
}
/**
* For responses, this returns true if the service returned a value for the UserSettings 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 hasUserSettings() {
return userSettings != null && !(userSettings instanceof SdkAutoConstructList);
}
/**
*
* The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are
* enabled.
*
*
* 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 #hasUserSettings} method.
*
*
* @return The actions that are enabled or disabled for users during their streaming sessions. By default, these
* actions are enabled.
*/
public final List userSettings() {
return userSettings;
}
/**
*
* The persistent application settings for users of a stack. When these settings are enabled, changes that users
* make to applications and Windows settings are automatically saved after each session and applied to the next
* session.
*
*
* @return The persistent application settings for users of a stack. When these settings are enabled, changes that
* users make to applications and Windows settings are automatically saved after each session and applied to
* the next session.
*/
public final ApplicationSettings applicationSettings() {
return applicationSettings;
}
/**
* For responses, this returns true if the service returned a value for the Tags 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 hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* The tags to associate with the stack. A tag is a key-value pair, and the value is optional. For example,
* Environment=Test. If you do not specify a value, Environment=.
*
*
* If you do not specify a value, the value is set to an empty string.
*
*
* Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following special
* characters:
*
*
* _ . : / = + \ - @
*
*
* For more information about tags, see Tagging Your Resources
* in the Amazon AppStream 2.0 Administration Guide .
*
*
* 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 #hasTags} method.
*
*
* @return The tags to associate with the stack. A tag is a key-value pair, and the value is optional. For example,
* Environment=Test. If you do not specify a value, Environment=.
*
* If you do not specify a value, the value is set to an empty string.
*
*
* Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following
* special characters:
*
*
* _ . : / = + \ - @
*
*
* For more information about tags, see Tagging Your
* Resources in the Amazon AppStream 2.0 Administration Guide .
*/
public final Map tags() {
return tags;
}
/**
* For responses, this returns true if the service returned a value for the AccessEndpoints 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 hasAccessEndpoints() {
return accessEndpoints != null && !(accessEndpoints instanceof SdkAutoConstructList);
}
/**
*
* The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0
* only through the specified endpoints.
*
*
* 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 #hasAccessEndpoints} method.
*
*
* @return The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to
* AppStream 2.0 only through the specified endpoints.
*/
public final List accessEndpoints() {
return accessEndpoints;
}
/**
* For responses, this returns true if the service returned a value for the EmbedHostDomains 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 hasEmbedHostDomains() {
return embedHostDomains != null && !(embedHostDomains instanceof SdkAutoConstructList);
}
/**
*
* The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains
* that you want to host embedded AppStream 2.0 streaming sessions.
*
*
* 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 #hasEmbedHostDomains} method.
*
*
* @return The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the
* domains that you want to host embedded AppStream 2.0 streaming sessions.
*/
public final List embedHostDomains() {
return embedHostDomains;
}
@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(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(displayName());
hashCode = 31 * hashCode + Objects.hashCode(hasStorageConnectors() ? storageConnectors() : null);
hashCode = 31 * hashCode + Objects.hashCode(redirectURL());
hashCode = 31 * hashCode + Objects.hashCode(feedbackURL());
hashCode = 31 * hashCode + Objects.hashCode(hasUserSettings() ? userSettings() : null);
hashCode = 31 * hashCode + Objects.hashCode(applicationSettings());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasAccessEndpoints() ? accessEndpoints() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasEmbedHostDomains() ? embedHostDomains() : 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 CreateStackRequest)) {
return false;
}
CreateStackRequest other = (CreateStackRequest) obj;
return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description())
&& Objects.equals(displayName(), other.displayName()) && hasStorageConnectors() == other.hasStorageConnectors()
&& Objects.equals(storageConnectors(), other.storageConnectors())
&& Objects.equals(redirectURL(), other.redirectURL()) && Objects.equals(feedbackURL(), other.feedbackURL())
&& hasUserSettings() == other.hasUserSettings() && Objects.equals(userSettings(), other.userSettings())
&& Objects.equals(applicationSettings(), other.applicationSettings()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags()) && hasAccessEndpoints() == other.hasAccessEndpoints()
&& Objects.equals(accessEndpoints(), other.accessEndpoints())
&& hasEmbedHostDomains() == other.hasEmbedHostDomains()
&& Objects.equals(embedHostDomains(), other.embedHostDomains());
}
/**
* 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("CreateStackRequest").add("Name", name()).add("Description", description())
.add("DisplayName", displayName()).add("StorageConnectors", hasStorageConnectors() ? storageConnectors() : null)
.add("RedirectURL", redirectURL()).add("FeedbackURL", feedbackURL())
.add("UserSettings", hasUserSettings() ? userSettings() : null).add("ApplicationSettings", applicationSettings())
.add("Tags", hasTags() ? tags() : null).add("AccessEndpoints", hasAccessEndpoints() ? accessEndpoints() : null)
.add("EmbedHostDomains", hasEmbedHostDomains() ? embedHostDomains() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "DisplayName":
return Optional.ofNullable(clazz.cast(displayName()));
case "StorageConnectors":
return Optional.ofNullable(clazz.cast(storageConnectors()));
case "RedirectURL":
return Optional.ofNullable(clazz.cast(redirectURL()));
case "FeedbackURL":
return Optional.ofNullable(clazz.cast(feedbackURL()));
case "UserSettings":
return Optional.ofNullable(clazz.cast(userSettings()));
case "ApplicationSettings":
return Optional.ofNullable(clazz.cast(applicationSettings()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "AccessEndpoints":
return Optional.ofNullable(clazz.cast(accessEndpoints()));
case "EmbedHostDomains":
return Optional.ofNullable(clazz.cast(embedHostDomains()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((CreateStackRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends AppStreamRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The name of the stack.
*
*
* @param name
* The name of the stack.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* The description to display.
*
*
* @param description
* The description to display.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* The stack name to display.
*
*
* @param displayName
* The stack name to display.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder displayName(String displayName);
/**
*
* The storage connectors to enable.
*
*
* @param storageConnectors
* The storage connectors to enable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder storageConnectors(Collection storageConnectors);
/**
*
* The storage connectors to enable.
*
*
* @param storageConnectors
* The storage connectors to enable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder storageConnectors(StorageConnector... storageConnectors);
/**
*
* The storage connectors to enable.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the
* need to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and
* its result is passed to {@link #storageConnectors(List)}.
*
* @param storageConnectors
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #storageConnectors(List)
*/
Builder storageConnectors(Consumer... storageConnectors);
/**
*
* The URL that users are redirected to after their streaming session ends.
*
*
* @param redirectURL
* The URL that users are redirected to after their streaming session ends.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder redirectURL(String redirectURL);
/**
*
* The URL that users are redirected to after they click the Send Feedback link. If no URL is specified, no Send
* Feedback link is displayed.
*
*
* @param feedbackURL
* The URL that users are redirected to after they click the Send Feedback link. If no URL is specified,
* no Send Feedback link is displayed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder feedbackURL(String feedbackURL);
/**
*
* The actions that are enabled or disabled for users during their streaming sessions. By default, these actions
* are enabled.
*
*
* @param userSettings
* The actions that are enabled or disabled for users during their streaming sessions. By default, these
* actions are enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder userSettings(Collection userSettings);
/**
*
* The actions that are enabled or disabled for users during their streaming sessions. By default, these actions
* are enabled.
*
*
* @param userSettings
* The actions that are enabled or disabled for users during their streaming sessions. By default, these
* actions are enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder userSettings(UserSetting... userSettings);
/**
*
* The actions that are enabled or disabled for users during their streaming sessions. By default, these actions
* are enabled.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to
* create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its
* result is passed to {@link #userSettings(List)}.
*
* @param userSettings
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #userSettings(List)
*/
Builder userSettings(Consumer... userSettings);
/**
*
* The persistent application settings for users of a stack. When these settings are enabled, changes that users
* make to applications and Windows settings are automatically saved after each session and applied to the next
* session.
*
*
* @param applicationSettings
* The persistent application settings for users of a stack. When these settings are enabled, changes
* that users make to applications and Windows settings are automatically saved after each session and
* applied to the next session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder applicationSettings(ApplicationSettings applicationSettings);
/**
*
* The persistent application settings for users of a stack. When these settings are enabled, changes that users
* make to applications and Windows settings are automatically saved after each session and applied to the next
* session.
*
* This is a convenience that creates an instance of the {@link ApplicationSettings.Builder} avoiding the need
* to create one manually via {@link ApplicationSettings#builder()}.
*
* When the {@link Consumer} completes, {@link ApplicationSettings.Builder#build()} is called immediately and
* its result is passed to {@link #applicationSettings(ApplicationSettings)}.
*
* @param applicationSettings
* a consumer that will call methods on {@link ApplicationSettings.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #applicationSettings(ApplicationSettings)
*/
default Builder applicationSettings(Consumer applicationSettings) {
return applicationSettings(ApplicationSettings.builder().applyMutation(applicationSettings).build());
}
/**
*
* The tags to associate with the stack. A tag is a key-value pair, and the value is optional. For example,
* Environment=Test. If you do not specify a value, Environment=.
*
*
* If you do not specify a value, the value is set to an empty string.
*
*
* Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following
* special characters:
*
*
* _ . : / = + \ - @
*
*
* For more information about tags, see Tagging Your
* Resources in the Amazon AppStream 2.0 Administration Guide .
*
*
* @param tags
* The tags to associate with the stack. A tag is a key-value pair, and the value is optional. For
* example, Environment=Test. If you do not specify a value, Environment=.
*
* If you do not specify a value, the value is set to an empty string.
*
*
* Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the
* following special characters:
*
*
* _ . : / = + \ - @
*
*
* For more information about tags, see Tagging Your
* Resources in the Amazon AppStream 2.0 Administration Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
/**
*
* The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream
* 2.0 only through the specified endpoints.
*
*
* @param accessEndpoints
* The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to
* AppStream 2.0 only through the specified endpoints.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder accessEndpoints(Collection accessEndpoints);
/**
*
* The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream
* 2.0 only through the specified endpoints.
*
*
* @param accessEndpoints
* The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to
* AppStream 2.0 only through the specified endpoints.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder accessEndpoints(AccessEndpoint... accessEndpoints);
/**
*
* The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream
* 2.0 only through the specified endpoints.
*
* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need
* to create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and
* its result is passed to {@link #accessEndpoints(List)}.
*
* @param accessEndpoints
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #accessEndpoints(List)
*/
Builder accessEndpoints(Consumer... accessEndpoints);
/**
*
* The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains
* that you want to host embedded AppStream 2.0 streaming sessions.
*
*
* @param embedHostDomains
* The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the
* domains that you want to host embedded AppStream 2.0 streaming sessions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder embedHostDomains(Collection embedHostDomains);
/**
*
* The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains
* that you want to host embedded AppStream 2.0 streaming sessions.
*
*
* @param embedHostDomains
* The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the
* domains that you want to host embedded AppStream 2.0 streaming sessions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder embedHostDomains(String... embedHostDomains);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends AppStreamRequest.BuilderImpl implements Builder {
private String name;
private String description;
private String displayName;
private List storageConnectors = DefaultSdkAutoConstructList.getInstance();
private String redirectURL;
private String feedbackURL;
private List userSettings = DefaultSdkAutoConstructList.getInstance();
private ApplicationSettings applicationSettings;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private List accessEndpoints = DefaultSdkAutoConstructList.getInstance();
private List embedHostDomains = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(CreateStackRequest model) {
super(model);
name(model.name);
description(model.description);
displayName(model.displayName);
storageConnectors(model.storageConnectors);
redirectURL(model.redirectURL);
feedbackURL(model.feedbackURL);
userSettings(model.userSettings);
applicationSettings(model.applicationSettings);
tags(model.tags);
accessEndpoints(model.accessEndpoints);
embedHostDomains(model.embedHostDomains);
}
public final String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
@Transient
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
@Transient
public final Builder description(String description) {
this.description = description;
return this;
}
public final String getDisplayName() {
return displayName;
}
public final void setDisplayName(String displayName) {
this.displayName = displayName;
}
@Override
@Transient
public final Builder displayName(String displayName) {
this.displayName = displayName;
return this;
}
public final List getStorageConnectors() {
List result = StorageConnectorListCopier.copyToBuilder(this.storageConnectors);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setStorageConnectors(Collection storageConnectors) {
this.storageConnectors = StorageConnectorListCopier.copyFromBuilder(storageConnectors);
}
@Override
@Transient
public final Builder storageConnectors(Collection storageConnectors) {
this.storageConnectors = StorageConnectorListCopier.copy(storageConnectors);
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder storageConnectors(StorageConnector... storageConnectors) {
storageConnectors(Arrays.asList(storageConnectors));
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder storageConnectors(Consumer... storageConnectors) {
storageConnectors(Stream.of(storageConnectors).map(c -> StorageConnector.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final String getRedirectURL() {
return redirectURL;
}
public final void setRedirectURL(String redirectURL) {
this.redirectURL = redirectURL;
}
@Override
@Transient
public final Builder redirectURL(String redirectURL) {
this.redirectURL = redirectURL;
return this;
}
public final String getFeedbackURL() {
return feedbackURL;
}
public final void setFeedbackURL(String feedbackURL) {
this.feedbackURL = feedbackURL;
}
@Override
@Transient
public final Builder feedbackURL(String feedbackURL) {
this.feedbackURL = feedbackURL;
return this;
}
public final List getUserSettings() {
List result = UserSettingListCopier.copyToBuilder(this.userSettings);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setUserSettings(Collection userSettings) {
this.userSettings = UserSettingListCopier.copyFromBuilder(userSettings);
}
@Override
@Transient
public final Builder userSettings(Collection userSettings) {
this.userSettings = UserSettingListCopier.copy(userSettings);
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder userSettings(UserSetting... userSettings) {
userSettings(Arrays.asList(userSettings));
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder userSettings(Consumer... userSettings) {
userSettings(Stream.of(userSettings).map(c -> UserSetting.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final ApplicationSettings.Builder getApplicationSettings() {
return applicationSettings != null ? applicationSettings.toBuilder() : null;
}
public final void setApplicationSettings(ApplicationSettings.BuilderImpl applicationSettings) {
this.applicationSettings = applicationSettings != null ? applicationSettings.build() : null;
}
@Override
@Transient
public final Builder applicationSettings(ApplicationSettings applicationSettings) {
this.applicationSettings = applicationSettings;
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagsCopier.copy(tags);
}
@Override
@Transient
public final Builder tags(Map tags) {
this.tags = TagsCopier.copy(tags);
return this;
}
public final List getAccessEndpoints() {
List result = AccessEndpointListCopier.copyToBuilder(this.accessEndpoints);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setAccessEndpoints(Collection accessEndpoints) {
this.accessEndpoints = AccessEndpointListCopier.copyFromBuilder(accessEndpoints);
}
@Override
@Transient
public final Builder accessEndpoints(Collection accessEndpoints) {
this.accessEndpoints = AccessEndpointListCopier.copy(accessEndpoints);
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder accessEndpoints(AccessEndpoint... accessEndpoints) {
accessEndpoints(Arrays.asList(accessEndpoints));
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder accessEndpoints(Consumer... accessEndpoints) {
accessEndpoints(Stream.of(accessEndpoints).map(c -> AccessEndpoint.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection getEmbedHostDomains() {
if (embedHostDomains instanceof SdkAutoConstructList) {
return null;
}
return embedHostDomains;
}
public final void setEmbedHostDomains(Collection embedHostDomains) {
this.embedHostDomains = EmbedHostDomainsCopier.copy(embedHostDomains);
}
@Override
@Transient
public final Builder embedHostDomains(Collection embedHostDomains) {
this.embedHostDomains = EmbedHostDomainsCopier.copy(embedHostDomains);
return this;
}
@Override
@Transient
@SafeVarargs
public final Builder embedHostDomains(String... embedHostDomains) {
embedHostDomains(Arrays.asList(embedHostDomains));
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 CreateStackRequest build() {
return new CreateStackRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}