software.amazon.awssdk.services.appstream.model.UpdateFleetRequest 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 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.runtime.TypeConverter;
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 UpdateFleetRequest extends AppStreamRequest implements
ToCopyableBuilder {
private static final SdkField IMAGE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateFleetRequest::imageName)).setter(setter(Builder::imageName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageName").build()).build();
private static final SdkField IMAGE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateFleetRequest::imageArn)).setter(setter(Builder::imageArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImageArn").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateFleetRequest::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateFleetRequest::instanceType)).setter(setter(Builder::instanceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InstanceType").build()).build();
private static final SdkField COMPUTE_CAPACITY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(UpdateFleetRequest::computeCapacity))
.setter(setter(Builder::computeCapacity)).constructor(ComputeCapacity::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ComputeCapacity").build()).build();
private static final SdkField VPC_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.getter(getter(UpdateFleetRequest::vpcConfig)).setter(setter(Builder::vpcConfig)).constructor(VpcConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcConfig").build()).build();
private static final SdkField MAX_USER_DURATION_IN_SECONDS_FIELD = SdkField
. builder(MarshallingType.INTEGER).getter(getter(UpdateFleetRequest::maxUserDurationInSeconds))
.setter(setter(Builder::maxUserDurationInSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxUserDurationInSeconds").build())
.build();
private static final SdkField DISCONNECT_TIMEOUT_IN_SECONDS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.getter(getter(UpdateFleetRequest::disconnectTimeoutInSeconds))
.setter(setter(Builder::disconnectTimeoutInSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisconnectTimeoutInSeconds").build())
.build();
private static final SdkField DELETE_VPC_CONFIG_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(UpdateFleetRequest::deleteVpcConfig)).setter(setter(Builder::deleteVpcConfig))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeleteVpcConfig").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(UpdateFleetRequest::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(UpdateFleetRequest::displayName)).setter(setter(Builder::displayName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build();
private static final SdkField ENABLE_DEFAULT_INTERNET_ACCESS_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.getter(getter(UpdateFleetRequest::enableDefaultInternetAccess))
.setter(setter(Builder::enableDefaultInternetAccess))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableDefaultInternetAccess")
.build()).build();
private static final SdkField DOMAIN_JOIN_INFO_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(UpdateFleetRequest::domainJoinInfo))
.setter(setter(Builder::domainJoinInfo)).constructor(DomainJoinInfo::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainJoinInfo").build()).build();
private static final SdkField> ATTRIBUTES_TO_DELETE_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(UpdateFleetRequest::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 List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IMAGE_NAME_FIELD,
IMAGE_ARN_FIELD, NAME_FIELD, INSTANCE_TYPE_FIELD, COMPUTE_CAPACITY_FIELD, VPC_CONFIG_FIELD,
MAX_USER_DURATION_IN_SECONDS_FIELD, DISCONNECT_TIMEOUT_IN_SECONDS_FIELD, DELETE_VPC_CONFIG_FIELD, DESCRIPTION_FIELD,
DISPLAY_NAME_FIELD, ENABLE_DEFAULT_INTERNET_ACCESS_FIELD, DOMAIN_JOIN_INFO_FIELD, ATTRIBUTES_TO_DELETE_FIELD));
private final String imageName;
private final String imageArn;
private final String name;
private final String instanceType;
private final ComputeCapacity computeCapacity;
private final VpcConfig vpcConfig;
private final Integer maxUserDurationInSeconds;
private final Integer disconnectTimeoutInSeconds;
private final Boolean deleteVpcConfig;
private final String description;
private final String displayName;
private final Boolean enableDefaultInternetAccess;
private final DomainJoinInfo domainJoinInfo;
private final List attributesToDelete;
private UpdateFleetRequest(BuilderImpl builder) {
super(builder);
this.imageName = builder.imageName;
this.imageArn = builder.imageArn;
this.name = builder.name;
this.instanceType = builder.instanceType;
this.computeCapacity = builder.computeCapacity;
this.vpcConfig = builder.vpcConfig;
this.maxUserDurationInSeconds = builder.maxUserDurationInSeconds;
this.disconnectTimeoutInSeconds = builder.disconnectTimeoutInSeconds;
this.deleteVpcConfig = builder.deleteVpcConfig;
this.description = builder.description;
this.displayName = builder.displayName;
this.enableDefaultInternetAccess = builder.enableDefaultInternetAccess;
this.domainJoinInfo = builder.domainJoinInfo;
this.attributesToDelete = builder.attributesToDelete;
}
/**
*
* The name of the image used to create the fleet.
*
*
* @return The name of the image used to create the fleet.
*/
public String imageName() {
return imageName;
}
/**
*
* The ARN of the public, private, or shared image to use.
*
*
* @return The ARN of the public, private, or shared image to use.
*/
public String imageArn() {
return imageArn;
}
/**
*
* A unique name for the fleet.
*
*
* @return A unique name for the fleet.
*/
public String name() {
return name;
}
/**
*
* The instance type to use when launching fleet instances. The following instance types are available:
*
*
* -
*
* stream.standard.medium
*
*
* -
*
* stream.standard.large
*
*
* -
*
* stream.compute.large
*
*
* -
*
* stream.compute.xlarge
*
*
* -
*
* stream.compute.2xlarge
*
*
* -
*
* stream.compute.4xlarge
*
*
* -
*
* stream.compute.8xlarge
*
*
* -
*
* stream.memory.large
*
*
* -
*
* stream.memory.xlarge
*
*
* -
*
* stream.memory.2xlarge
*
*
* -
*
* stream.memory.4xlarge
*
*
* -
*
* stream.memory.8xlarge
*
*
* -
*
* stream.graphics-design.large
*
*
* -
*
* stream.graphics-design.xlarge
*
*
* -
*
* stream.graphics-design.2xlarge
*
*
* -
*
* stream.graphics-design.4xlarge
*
*
* -
*
* stream.graphics-desktop.2xlarge
*
*
* -
*
* stream.graphics-pro.4xlarge
*
*
* -
*
* stream.graphics-pro.8xlarge
*
*
* -
*
* stream.graphics-pro.16xlarge
*
*
*
*
* @return The instance type to use when launching fleet instances. The following instance types are available:
*
* -
*
* stream.standard.medium
*
*
* -
*
* stream.standard.large
*
*
* -
*
* stream.compute.large
*
*
* -
*
* stream.compute.xlarge
*
*
* -
*
* stream.compute.2xlarge
*
*
* -
*
* stream.compute.4xlarge
*
*
* -
*
* stream.compute.8xlarge
*
*
* -
*
* stream.memory.large
*
*
* -
*
* stream.memory.xlarge
*
*
* -
*
* stream.memory.2xlarge
*
*
* -
*
* stream.memory.4xlarge
*
*
* -
*
* stream.memory.8xlarge
*
*
* -
*
* stream.graphics-design.large
*
*
* -
*
* stream.graphics-design.xlarge
*
*
* -
*
* stream.graphics-design.2xlarge
*
*
* -
*
* stream.graphics-design.4xlarge
*
*
* -
*
* stream.graphics-desktop.2xlarge
*
*
* -
*
* stream.graphics-pro.4xlarge
*
*
* -
*
* stream.graphics-pro.8xlarge
*
*
* -
*
* stream.graphics-pro.16xlarge
*
*
*/
public String instanceType() {
return instanceType;
}
/**
*
* The desired capacity for the fleet.
*
*
* @return The desired capacity for the fleet.
*/
public ComputeCapacity computeCapacity() {
return computeCapacity;
}
/**
*
* The VPC configuration for the fleet.
*
*
* @return The VPC configuration for the fleet.
*/
public VpcConfig vpcConfig() {
return vpcConfig;
}
/**
*
* The maximum time that a streaming session can run, in seconds. Specify a value between 600 and 57600.
*
*
* @return The maximum time that a streaming session can run, in seconds. Specify a value between 600 and 57600.
*/
public Integer maxUserDurationInSeconds() {
return maxUserDurationInSeconds;
}
/**
*
* The time after disconnection when a session is considered to have ended, in seconds. If a user who was
* disconnected reconnects within this time interval, the user is connected to their previous session. Specify a
* value between 60 and 57600.
*
*
* @return The time after disconnection when a session is considered to have ended, in seconds. If a user who was
* disconnected reconnects within this time interval, the user is connected to their previous session.
* Specify a value between 60 and 57600.
*/
public Integer disconnectTimeoutInSeconds() {
return disconnectTimeoutInSeconds;
}
/**
*
* Deletes the VPC association for the specified fleet.
*
*
* @return Deletes the VPC association for the specified fleet.
*/
public Boolean deleteVpcConfig() {
return deleteVpcConfig;
}
/**
*
* The description for display.
*
*
* @return The description for display.
*/
public String description() {
return description;
}
/**
*
* The fleet name for display.
*
*
* @return The fleet name for display.
*/
public String displayName() {
return displayName;
}
/**
*
* Enables or disables default internet access for the fleet.
*
*
* @return Enables or disables default internet access for the fleet.
*/
public Boolean enableDefaultInternetAccess() {
return enableDefaultInternetAccess;
}
/**
*
* The information needed to join a Microsoft Active Directory domain.
*
*
* @return The information needed to join a Microsoft Active Directory domain.
*/
public DomainJoinInfo domainJoinInfo() {
return domainJoinInfo;
}
/**
*
* The fleet attributes to delete.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The fleet attributes to delete.
*/
public List attributesToDelete() {
return TypeConverter.convert(attributesToDelete, FleetAttribute::fromValue);
}
/**
*
* The fleet attributes to delete.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return The fleet attributes to delete.
*/
public List attributesToDeleteAsStrings() {
return attributesToDelete;
}
@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(imageName());
hashCode = 31 * hashCode + Objects.hashCode(imageArn());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(instanceType());
hashCode = 31 * hashCode + Objects.hashCode(computeCapacity());
hashCode = 31 * hashCode + Objects.hashCode(vpcConfig());
hashCode = 31 * hashCode + Objects.hashCode(maxUserDurationInSeconds());
hashCode = 31 * hashCode + Objects.hashCode(disconnectTimeoutInSeconds());
hashCode = 31 * hashCode + Objects.hashCode(deleteVpcConfig());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(displayName());
hashCode = 31 * hashCode + Objects.hashCode(enableDefaultInternetAccess());
hashCode = 31 * hashCode + Objects.hashCode(domainJoinInfo());
hashCode = 31 * hashCode + Objects.hashCode(attributesToDeleteAsStrings());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateFleetRequest)) {
return false;
}
UpdateFleetRequest other = (UpdateFleetRequest) obj;
return Objects.equals(imageName(), other.imageName()) && Objects.equals(imageArn(), other.imageArn())
&& Objects.equals(name(), other.name()) && Objects.equals(instanceType(), other.instanceType())
&& Objects.equals(computeCapacity(), other.computeCapacity()) && Objects.equals(vpcConfig(), other.vpcConfig())
&& Objects.equals(maxUserDurationInSeconds(), other.maxUserDurationInSeconds())
&& Objects.equals(disconnectTimeoutInSeconds(), other.disconnectTimeoutInSeconds())
&& Objects.equals(deleteVpcConfig(), other.deleteVpcConfig())
&& Objects.equals(description(), other.description()) && Objects.equals(displayName(), other.displayName())
&& Objects.equals(enableDefaultInternetAccess(), other.enableDefaultInternetAccess())
&& Objects.equals(domainJoinInfo(), other.domainJoinInfo())
&& Objects.equals(attributesToDeleteAsStrings(), other.attributesToDeleteAsStrings());
}
@Override
public String toString() {
return ToString.builder("UpdateFleetRequest").add("ImageName", imageName()).add("ImageArn", imageArn())
.add("Name", name()).add("InstanceType", instanceType()).add("ComputeCapacity", computeCapacity())
.add("VpcConfig", vpcConfig()).add("MaxUserDurationInSeconds", maxUserDurationInSeconds())
.add("DisconnectTimeoutInSeconds", disconnectTimeoutInSeconds()).add("DeleteVpcConfig", deleteVpcConfig())
.add("Description", description()).add("DisplayName", displayName())
.add("EnableDefaultInternetAccess", enableDefaultInternetAccess()).add("DomainJoinInfo", domainJoinInfo())
.add("AttributesToDelete", attributesToDeleteAsStrings()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ImageName":
return Optional.ofNullable(clazz.cast(imageName()));
case "ImageArn":
return Optional.ofNullable(clazz.cast(imageArn()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "InstanceType":
return Optional.ofNullable(clazz.cast(instanceType()));
case "ComputeCapacity":
return Optional.ofNullable(clazz.cast(computeCapacity()));
case "VpcConfig":
return Optional.ofNullable(clazz.cast(vpcConfig()));
case "MaxUserDurationInSeconds":
return Optional.ofNullable(clazz.cast(maxUserDurationInSeconds()));
case "DisconnectTimeoutInSeconds":
return Optional.ofNullable(clazz.cast(disconnectTimeoutInSeconds()));
case "DeleteVpcConfig":
return Optional.ofNullable(clazz.cast(deleteVpcConfig()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "DisplayName":
return Optional.ofNullable(clazz.cast(displayName()));
case "EnableDefaultInternetAccess":
return Optional.ofNullable(clazz.cast(enableDefaultInternetAccess()));
case "DomainJoinInfo":
return Optional.ofNullable(clazz.cast(domainJoinInfo()));
case "AttributesToDelete":
return Optional.ofNullable(clazz.cast(attributesToDeleteAsStrings()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function