software.amazon.awssdk.services.appstream.model.Stack 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.io.Serializable;
import java.time.Instant;
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.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;
/**
*
* Describes a stack.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Stack implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Stack::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Arn").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(Stack::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(Stack::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(Stack::displayName)).setter(setter(Builder::displayName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build();
private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(Stack::createdTime)).setter(setter(Builder::createdTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedTime").build()).build();
private static final SdkField> STORAGE_CONNECTORS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Stack::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(Stack::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(Stack::feedbackURL)).setter(setter(Builder::feedbackURL))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FeedbackURL").build()).build();
private static final SdkField> STACK_ERRORS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Stack::stackErrors))
.setter(setter(Builder::stackErrors))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackErrors").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(StackError::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> USER_SETTINGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(Stack::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(Stack::applicationSettings))
.setter(setter(Builder::applicationSettings)).constructor(ApplicationSettingsResponse::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ApplicationSettings").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, NAME_FIELD,
DESCRIPTION_FIELD, DISPLAY_NAME_FIELD, CREATED_TIME_FIELD, STORAGE_CONNECTORS_FIELD, REDIRECT_URL_FIELD,
FEEDBACK_URL_FIELD, STACK_ERRORS_FIELD, USER_SETTINGS_FIELD, APPLICATION_SETTINGS_FIELD));
private static final long serialVersionUID = 1L;
private final String arn;
private final String name;
private final String description;
private final String displayName;
private final Instant createdTime;
private final List storageConnectors;
private final String redirectURL;
private final String feedbackURL;
private final List stackErrors;
private final List userSettings;
private final ApplicationSettingsResponse applicationSettings;
private Stack(BuilderImpl builder) {
this.arn = builder.arn;
this.name = builder.name;
this.description = builder.description;
this.displayName = builder.displayName;
this.createdTime = builder.createdTime;
this.storageConnectors = builder.storageConnectors;
this.redirectURL = builder.redirectURL;
this.feedbackURL = builder.feedbackURL;
this.stackErrors = builder.stackErrors;
this.userSettings = builder.userSettings;
this.applicationSettings = builder.applicationSettings;
}
/**
*
* The ARN of the stack.
*
*
* @return The ARN of the stack.
*/
public String arn() {
return arn;
}
/**
*
* 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 time the stack was created.
*
*
* @return The time the stack was created.
*/
public Instant createdTime() {
return createdTime;
}
/**
*
* 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 errors for the stack.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The errors for the stack.
*/
public List stackErrors() {
return stackErrors;
}
/**
*
* 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 the stack.
*
*
* @return The persistent application settings for users of the stack.
*/
public ApplicationSettingsResponse 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(arn());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(displayName());
hashCode = 31 * hashCode + Objects.hashCode(createdTime());
hashCode = 31 * hashCode + Objects.hashCode(storageConnectors());
hashCode = 31 * hashCode + Objects.hashCode(redirectURL());
hashCode = 31 * hashCode + Objects.hashCode(feedbackURL());
hashCode = 31 * hashCode + Objects.hashCode(stackErrors());
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 Stack)) {
return false;
}
Stack other = (Stack) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(name(), other.name())
&& Objects.equals(description(), other.description()) && Objects.equals(displayName(), other.displayName())
&& Objects.equals(createdTime(), other.createdTime())
&& Objects.equals(storageConnectors(), other.storageConnectors())
&& Objects.equals(redirectURL(), other.redirectURL()) && Objects.equals(feedbackURL(), other.feedbackURL())
&& Objects.equals(stackErrors(), other.stackErrors()) && Objects.equals(userSettings(), other.userSettings())
&& Objects.equals(applicationSettings(), other.applicationSettings());
}
@Override
public String toString() {
return ToString.builder("Stack").add("Arn", arn()).add("Name", name()).add("Description", description())
.add("DisplayName", displayName()).add("CreatedTime", createdTime())
.add("StorageConnectors", storageConnectors()).add("RedirectURL", redirectURL())
.add("FeedbackURL", feedbackURL()).add("StackErrors", stackErrors()).add("UserSettings", userSettings())
.add("ApplicationSettings", applicationSettings()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Arn":
return Optional.ofNullable(clazz.cast(arn()));
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 "CreatedTime":
return Optional.ofNullable(clazz.cast(createdTime()));
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 "StackErrors":
return Optional.ofNullable(clazz.cast(stackErrors()));
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