software.amazon.awssdk.services.appstream.model.CreateStackRequest Maven / Gradle / Ivy
Show all versions of appstream Show documentation
/*
* Copyright 2013-2018 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.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)
.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)
.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)
.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)
.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)
.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)
.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)
.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).getter(getter(CreateStackRequest::applicationSettings))
.setter(setter(Builder::applicationSettings)).constructor(ApplicationSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationSettings").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));
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 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;
}
/**
*
* The name of the stack.
*
*
* @return The name of the stack.
*/
public String name() {
return name;
}
/**
*
* The description for display.
*
*
* @return The description for display.
*/
public String description() {
return description;
}
/**
*
* The stack name for display.
*
*
* @return The stack name for display.
*/
public String displayName() {
return displayName;
}
/**
*
* The storage connectors to enable.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The storage connectors to enable.
*/
public 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 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 String feedbackURL() {
return feedbackURL;
}
/**
*
* 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.
*
*
* @return The actions that are enabled or disabled for users during their streaming sessions. By default, these
* actions are enabled.
*/
public 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 ApplicationSettings applicationSettings() {
return applicationSettings;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(displayName());
hashCode = 31 * hashCode + Objects.hashCode(storageConnectors());
hashCode = 31 * hashCode + Objects.hashCode(redirectURL());
hashCode = 31 * hashCode + Objects.hashCode(feedbackURL());
hashCode = 31 * hashCode + Objects.hashCode(userSettings());
hashCode = 31 * hashCode + Objects.hashCode(applicationSettings());
return hashCode;
}
@Override
public boolean equals(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())
&& Objects.equals(storageConnectors(), other.storageConnectors())
&& Objects.equals(redirectURL(), other.redirectURL()) && Objects.equals(feedbackURL(), other.feedbackURL())
&& Objects.equals(userSettings(), other.userSettings())
&& Objects.equals(applicationSettings(), other.applicationSettings());
}
@Override
public String toString() {
return ToString.builder("CreateStackRequest").add("Name", name()).add("Description", description())
.add("DisplayName", displayName()).add("StorageConnectors", storageConnectors())
.add("RedirectURL", redirectURL()).add("FeedbackURL", feedbackURL()).add("UserSettings", userSettings())
.add("ApplicationSettings", applicationSettings()).build();
}
public 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()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function