software.amazon.awssdk.services.appstream.model.UpdateApplicationRequest 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 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 UpdateApplicationRequest extends AppStreamRequest implements
ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(UpdateApplicationRequest::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DisplayName").getter(getter(UpdateApplicationRequest::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(UpdateApplicationRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField ICON_S3_LOCATION_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("IconS3Location").getter(getter(UpdateApplicationRequest::iconS3Location))
.setter(setter(Builder::iconS3Location)).constructor(S3Location::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IconS3Location").build()).build();
private static final SdkField LAUNCH_PATH_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LaunchPath").getter(getter(UpdateApplicationRequest::launchPath)).setter(setter(Builder::launchPath))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LaunchPath").build()).build();
private static final SdkField WORKING_DIRECTORY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("WorkingDirectory").getter(getter(UpdateApplicationRequest::workingDirectory))
.setter(setter(Builder::workingDirectory))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WorkingDirectory").build()).build();
private static final SdkField LAUNCH_PARAMETERS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LaunchParameters").getter(getter(UpdateApplicationRequest::launchParameters))
.setter(setter(Builder::launchParameters))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LaunchParameters").build()).build();
private static final SdkField APP_BLOCK_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AppBlockArn").getter(getter(UpdateApplicationRequest::appBlockArn)).setter(setter(Builder::appBlockArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AppBlockArn").build()).build();
private static final SdkField> ATTRIBUTES_TO_DELETE_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("AttributesToDelete")
.getter(getter(UpdateApplicationRequest::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(NAME_FIELD,
DISPLAY_NAME_FIELD, DESCRIPTION_FIELD, ICON_S3_LOCATION_FIELD, LAUNCH_PATH_FIELD, WORKING_DIRECTORY_FIELD,
LAUNCH_PARAMETERS_FIELD, APP_BLOCK_ARN_FIELD, ATTRIBUTES_TO_DELETE_FIELD));
private final String name;
private final String displayName;
private final String description;
private final S3Location iconS3Location;
private final String launchPath;
private final String workingDirectory;
private final String launchParameters;
private final String appBlockArn;
private final List attributesToDelete;
private UpdateApplicationRequest(BuilderImpl builder) {
super(builder);
this.name = builder.name;
this.displayName = builder.displayName;
this.description = builder.description;
this.iconS3Location = builder.iconS3Location;
this.launchPath = builder.launchPath;
this.workingDirectory = builder.workingDirectory;
this.launchParameters = builder.launchParameters;
this.appBlockArn = builder.appBlockArn;
this.attributesToDelete = builder.attributesToDelete;
}
/**
*
* The name of the application. This name is visible to users when display name is not specified.
*
*
* @return The name of the application. This name is visible to users when display name is not specified.
*/
public final String name() {
return name;
}
/**
*
* The display name of the application. This name is visible to users in the application catalog.
*
*
* @return The display name of the application. This name is visible to users in the application catalog.
*/
public final String displayName() {
return displayName;
}
/**
*
* The description of the application.
*
*
* @return The description of the application.
*/
public final String description() {
return description;
}
/**
*
* The icon S3 location of the application.
*
*
* @return The icon S3 location of the application.
*/
public final S3Location iconS3Location() {
return iconS3Location;
}
/**
*
* The launch path of the application.
*
*
* @return The launch path of the application.
*/
public final String launchPath() {
return launchPath;
}
/**
*
* The working directory of the application.
*
*
* @return The working directory of the application.
*/
public final String workingDirectory() {
return workingDirectory;
}
/**
*
* The launch parameters of the application.
*
*
* @return The launch parameters of the application.
*/
public final String launchParameters() {
return launchParameters;
}
/**
*
* The ARN of the app block.
*
*
* @return The ARN of the app block.
*/
public final String appBlockArn() {
return appBlockArn;
}
/**
*
* The attributes to delete for an application.
*
*
* 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 #hasAttributesToDelete} method.
*
*
* @return The attributes to delete for an application.
*/
public final List attributesToDelete() {
return ApplicationAttributesCopier.copyStringToEnum(attributesToDelete);
}
/**
* For responses, this returns true if the service returned a value for the AttributesToDelete 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 hasAttributesToDelete() {
return attributesToDelete != null && !(attributesToDelete instanceof SdkAutoConstructList);
}
/**
*
* The attributes to delete for an application.
*
*
* 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 #hasAttributesToDelete} method.
*
*
* @return The attributes to delete for an application.
*/
public final 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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(displayName());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(iconS3Location());
hashCode = 31 * hashCode + Objects.hashCode(launchPath());
hashCode = 31 * hashCode + Objects.hashCode(workingDirectory());
hashCode = 31 * hashCode + Objects.hashCode(launchParameters());
hashCode = 31 * hashCode + Objects.hashCode(appBlockArn());
hashCode = 31 * hashCode + Objects.hashCode(hasAttributesToDelete() ? attributesToDeleteAsStrings() : 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 UpdateApplicationRequest)) {
return false;
}
UpdateApplicationRequest other = (UpdateApplicationRequest) obj;
return Objects.equals(name(), other.name()) && Objects.equals(displayName(), other.displayName())
&& Objects.equals(description(), other.description()) && Objects.equals(iconS3Location(), other.iconS3Location())
&& Objects.equals(launchPath(), other.launchPath())
&& Objects.equals(workingDirectory(), other.workingDirectory())
&& Objects.equals(launchParameters(), other.launchParameters())
&& Objects.equals(appBlockArn(), other.appBlockArn()) && hasAttributesToDelete() == other.hasAttributesToDelete()
&& Objects.equals(attributesToDeleteAsStrings(), other.attributesToDeleteAsStrings());
}
/**
* 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("UpdateApplicationRequest").add("Name", name()).add("DisplayName", displayName())
.add("Description", description()).add("IconS3Location", iconS3Location()).add("LaunchPath", launchPath())
.add("WorkingDirectory", workingDirectory()).add("LaunchParameters", launchParameters())
.add("AppBlockArn", appBlockArn())
.add("AttributesToDelete", hasAttributesToDelete() ? attributesToDeleteAsStrings() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "DisplayName":
return Optional.ofNullable(clazz.cast(displayName()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "IconS3Location":
return Optional.ofNullable(clazz.cast(iconS3Location()));
case "LaunchPath":
return Optional.ofNullable(clazz.cast(launchPath()));
case "WorkingDirectory":
return Optional.ofNullable(clazz.cast(workingDirectory()));
case "LaunchParameters":
return Optional.ofNullable(clazz.cast(launchParameters()));
case "AppBlockArn":
return Optional.ofNullable(clazz.cast(appBlockArn()));
case "AttributesToDelete":
return Optional.ofNullable(clazz.cast(attributesToDeleteAsStrings()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function