software.amazon.awssdk.services.appstream.model.UpdateStackRequest Maven / Gradle / Ivy
Show all versions of appstream Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.appstream.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import 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.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateStackRequest extends AppStreamRequest implements
ToCopyableBuilder {
private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DisplayName").getter(getter(UpdateStackRequest::displayName)).setter(setter(Builder::displayName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(UpdateStackRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(UpdateStackRequest::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField> STORAGE_CONNECTORS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("StorageConnectors")
.getter(getter(UpdateStackRequest::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 DELETE_STORAGE_CONNECTORS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("DeleteStorageConnectors").getter(getter(UpdateStackRequest::deleteStorageConnectors))
.setter(setter(Builder::deleteStorageConnectors))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeleteStorageConnectors").build())
.build();
private static final SdkField REDIRECT_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RedirectURL").getter(getter(UpdateStackRequest::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(UpdateStackRequest::feedbackURL)).setter(setter(Builder::feedbackURL))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FeedbackURL").build()).build();
private static final SdkField> ATTRIBUTES_TO_DELETE_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AttributesToDelete")
.getter(getter(UpdateStackRequest::attributesToDeleteAsStrings))
.setter(setter(Builder::attributesToDeleteWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AttributesToDelete").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> USER_SETTINGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("UserSettings")
.getter(getter(UpdateStackRequest::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(UpdateStackRequest::applicationSettings)).setter(setter(Builder::applicationSettings))
.constructor(ApplicationSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationSettings").build())
.build();
private static final SdkField> ACCESS_ENDPOINTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AccessEndpoints")
.getter(getter(UpdateStackRequest::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(UpdateStackRequest::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(DISPLAY_NAME_FIELD,
DESCRIPTION_FIELD, NAME_FIELD, STORAGE_CONNECTORS_FIELD, DELETE_STORAGE_CONNECTORS_FIELD, REDIRECT_URL_FIELD,
FEEDBACK_URL_FIELD, ATTRIBUTES_TO_DELETE_FIELD, USER_SETTINGS_FIELD, APPLICATION_SETTINGS_FIELD,
ACCESS_ENDPOINTS_FIELD, EMBED_HOST_DOMAINS_FIELD));
private final String displayName;
private final String description;
private final String name;
private final List storageConnectors;
private final Boolean deleteStorageConnectors;
private final String redirectURL;
private final String feedbackURL;
private final List attributesToDelete;
private final List userSettings;
private final ApplicationSettings applicationSettings;
private final List accessEndpoints;
private final List embedHostDomains;
private UpdateStackRequest(BuilderImpl builder) {
super(builder);
this.displayName = builder.displayName;
this.description = builder.description;
this.name = builder.name;
this.storageConnectors = builder.storageConnectors;
this.deleteStorageConnectors = builder.deleteStorageConnectors;
this.redirectURL = builder.redirectURL;
this.feedbackURL = builder.feedbackURL;
this.attributesToDelete = builder.attributesToDelete;
this.userSettings = builder.userSettings;
this.applicationSettings = builder.applicationSettings;
this.accessEndpoints = builder.accessEndpoints;
this.embedHostDomains = builder.embedHostDomains;
}
/**
*
* The stack name to display.
*
*
* @return The stack name to display.
*/
public final String displayName() {
return displayName;
}
/**
*
* The description to display.
*
*
* @return The description to display.
*/
public final String description() {
return description;
}
/**
*
* The name of the stack.
*
*
* @return The name of the stack.
*/
public final String name() {
return name;
}
/**
* Returns true if the StorageConnectors property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
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.
*
*
* You can use {@link #hasStorageConnectors()} to see if a value was sent in this field.
*
*
* @return The storage connectors to enable.
*/
public final List storageConnectors() {
return storageConnectors;
}
/**
*
* Deletes the storage connectors currently enabled for the stack.
*
*
* @return Deletes the storage connectors currently enabled for the stack.
*/
public final Boolean deleteStorageConnectors() {
return deleteStorageConnectors;
}
/**
*
* 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 choose 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 choose the Send Feedback link. If no URL is specified, no
* Send Feedback link is displayed.
*/
public final String feedbackURL() {
return feedbackURL;
}
/**
*
* The stack attributes to delete.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasAttributesToDelete()} to see if a value was sent in this field.
*
*
* @return The stack attributes to delete.
*/
public final List attributesToDelete() {
return StackAttributesCopier.copyStringToEnum(attributesToDelete);
}
/**
* Returns true if the AttributesToDelete property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public final boolean hasAttributesToDelete() {
return attributesToDelete != null && !(attributesToDelete instanceof SdkAutoConstructList);
}
/**
*
* The stack attributes to delete.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasAttributesToDelete()} to see if a value was sent in this field.
*
*
* @return The stack attributes to delete.
*/
public final List attributesToDeleteAsStrings() {
return attributesToDelete;
}
/**
* Returns true if the UserSettings property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
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.
*
*
* You can use {@link #hasUserSettings()} to see if a value was sent in this field.
*
*
* @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;
}
/**
* Returns true if the AccessEndpoints property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
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.
*
*
* You can use {@link #hasAccessEndpoints()} to see if a value was sent in this field.
*
*
* @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;
}
/**
* Returns true if the EmbedHostDomains property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
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.
*
*
* You can use {@link #hasEmbedHostDomains()} to see if a value was sent in this field.
*
*
* @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(displayName());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(hasStorageConnectors() ? storageConnectors() : null);
hashCode = 31 * hashCode + Objects.hashCode(deleteStorageConnectors());
hashCode = 31 * hashCode + Objects.hashCode(redirectURL());
hashCode = 31 * hashCode + Objects.hashCode(feedbackURL());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributesToDelete() ? attributesToDeleteAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasUserSettings() ? userSettings() : null);
hashCode = 31 * hashCode + Objects.hashCode(applicationSettings());
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 UpdateStackRequest)) {
return false;
}
UpdateStackRequest other = (UpdateStackRequest) obj;
return Objects.equals(displayName(), other.displayName()) && Objects.equals(description(), other.description())
&& Objects.equals(name(), other.name()) && hasStorageConnectors() == other.hasStorageConnectors()
&& Objects.equals(storageConnectors(), other.storageConnectors())
&& Objects.equals(deleteStorageConnectors(), other.deleteStorageConnectors())
&& Objects.equals(redirectURL(), other.redirectURL()) && Objects.equals(feedbackURL(), other.feedbackURL())
&& hasAttributesToDelete() == other.hasAttributesToDelete()
&& Objects.equals(attributesToDeleteAsStrings(), other.attributesToDeleteAsStrings())
&& hasUserSettings() == other.hasUserSettings() && Objects.equals(userSettings(), other.userSettings())
&& Objects.equals(applicationSettings(), other.applicationSettings())
&& 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("UpdateStackRequest").add("DisplayName", displayName()).add("Description", description())
.add("Name", name()).add("StorageConnectors", hasStorageConnectors() ? storageConnectors() : null)
.add("DeleteStorageConnectors", deleteStorageConnectors()).add("RedirectURL", redirectURL())
.add("FeedbackURL", feedbackURL())
.add("AttributesToDelete", hasAttributesToDelete() ? attributesToDeleteAsStrings() : null)
.add("UserSettings", hasUserSettings() ? userSettings() : null).add("ApplicationSettings", applicationSettings())
.add("AccessEndpoints", hasAccessEndpoints() ? accessEndpoints() : null)
.add("EmbedHostDomains", hasEmbedHostDomains() ? embedHostDomains() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DisplayName":
return Optional.ofNullable(clazz.cast(displayName()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "StorageConnectors":
return Optional.ofNullable(clazz.cast(storageConnectors()));
case "DeleteStorageConnectors":
return Optional.ofNullable(clazz.cast(deleteStorageConnectors()));
case "RedirectURL":
return Optional.ofNullable(clazz.cast(redirectURL()));
case "FeedbackURL":
return Optional.ofNullable(clazz.cast(feedbackURL()));
case "AttributesToDelete":
return Optional.ofNullable(clazz.cast(attributesToDeleteAsStrings()));
case "UserSettings":
return Optional.ofNullable(clazz.cast(userSettings()));
case "ApplicationSettings":
return Optional.ofNullable(clazz.cast(applicationSettings()));
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