com.amazonaws.services.appstream.model.AppBlock Maven / Gradle / Ivy
Show all versions of aws-java-sdk-appstream Show documentation
/*
* Copyright 2019-2024 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 com.amazonaws.services.appstream.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes an app block.
*
*
* App blocks are an Amazon AppStream 2.0 resource that stores the details about the virtual hard disk in an S3 bucket.
* It also stores the setup script with details about how to mount the virtual hard disk. The virtual hard disk includes
* the application binaries and other files necessary to launch your applications. Multiple applications can be assigned
* to a single app block.
*
*
* This is only supported for Elastic fleets.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AppBlock implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the app block.
*
*/
private String name;
/**
*
* The ARN of the app block.
*
*/
private String arn;
/**
*
* The description of the app block.
*
*/
private String description;
/**
*
* The display name of the app block.
*
*/
private String displayName;
/**
*
* The source S3 location of the app block.
*
*/
private S3Location sourceS3Location;
/**
*
* The setup script details of the app block.
*
*
* This only applies to app blocks with PackagingType CUSTOM
.
*
*/
private ScriptDetails setupScriptDetails;
/**
*
* The created time of the app block.
*
*/
private java.util.Date createdTime;
/**
*
* The post setup script details of the app block.
*
*
* This only applies to app blocks with PackagingType APPSTREAM2
.
*
*/
private ScriptDetails postSetupScriptDetails;
/**
*
* The packaging type of the app block.
*
*/
private String packagingType;
/**
*
* The state of the app block.
*
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application package
* (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for an app block,
* it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
*
*/
private String state;
/**
*
* The errors of the app block.
*
*/
private java.util.List appBlockErrors;
/**
*
* The name of the app block.
*
*
* @param name
* The name of the app block.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the app block.
*
*
* @return The name of the app block.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the app block.
*
*
* @param name
* The name of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withName(String name) {
setName(name);
return this;
}
/**
*
* The ARN of the app block.
*
*
* @param arn
* The ARN of the app block.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The ARN of the app block.
*
*
* @return The ARN of the app block.
*/
public String getArn() {
return this.arn;
}
/**
*
* The ARN of the app block.
*
*
* @param arn
* The ARN of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The description of the app block.
*
*
* @param description
* The description of the app block.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the app block.
*
*
* @return The description of the app block.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the app block.
*
*
* @param description
* The description of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The display name of the app block.
*
*
* @param displayName
* The display name of the app block.
*/
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
/**
*
* The display name of the app block.
*
*
* @return The display name of the app block.
*/
public String getDisplayName() {
return this.displayName;
}
/**
*
* The display name of the app block.
*
*
* @param displayName
* The display name of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withDisplayName(String displayName) {
setDisplayName(displayName);
return this;
}
/**
*
* The source S3 location of the app block.
*
*
* @param sourceS3Location
* The source S3 location of the app block.
*/
public void setSourceS3Location(S3Location sourceS3Location) {
this.sourceS3Location = sourceS3Location;
}
/**
*
* The source S3 location of the app block.
*
*
* @return The source S3 location of the app block.
*/
public S3Location getSourceS3Location() {
return this.sourceS3Location;
}
/**
*
* The source S3 location of the app block.
*
*
* @param sourceS3Location
* The source S3 location of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withSourceS3Location(S3Location sourceS3Location) {
setSourceS3Location(sourceS3Location);
return this;
}
/**
*
* The setup script details of the app block.
*
*
* This only applies to app blocks with PackagingType CUSTOM
.
*
*
* @param setupScriptDetails
* The setup script details of the app block.
*
* This only applies to app blocks with PackagingType CUSTOM
.
*/
public void setSetupScriptDetails(ScriptDetails setupScriptDetails) {
this.setupScriptDetails = setupScriptDetails;
}
/**
*
* The setup script details of the app block.
*
*
* This only applies to app blocks with PackagingType CUSTOM
.
*
*
* @return The setup script details of the app block.
*
* This only applies to app blocks with PackagingType CUSTOM
.
*/
public ScriptDetails getSetupScriptDetails() {
return this.setupScriptDetails;
}
/**
*
* The setup script details of the app block.
*
*
* This only applies to app blocks with PackagingType CUSTOM
.
*
*
* @param setupScriptDetails
* The setup script details of the app block.
*
* This only applies to app blocks with PackagingType CUSTOM
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withSetupScriptDetails(ScriptDetails setupScriptDetails) {
setSetupScriptDetails(setupScriptDetails);
return this;
}
/**
*
* The created time of the app block.
*
*
* @param createdTime
* The created time of the app block.
*/
public void setCreatedTime(java.util.Date createdTime) {
this.createdTime = createdTime;
}
/**
*
* The created time of the app block.
*
*
* @return The created time of the app block.
*/
public java.util.Date getCreatedTime() {
return this.createdTime;
}
/**
*
* The created time of the app block.
*
*
* @param createdTime
* The created time of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withCreatedTime(java.util.Date createdTime) {
setCreatedTime(createdTime);
return this;
}
/**
*
* The post setup script details of the app block.
*
*
* This only applies to app blocks with PackagingType APPSTREAM2
.
*
*
* @param postSetupScriptDetails
* The post setup script details of the app block.
*
* This only applies to app blocks with PackagingType APPSTREAM2
.
*/
public void setPostSetupScriptDetails(ScriptDetails postSetupScriptDetails) {
this.postSetupScriptDetails = postSetupScriptDetails;
}
/**
*
* The post setup script details of the app block.
*
*
* This only applies to app blocks with PackagingType APPSTREAM2
.
*
*
* @return The post setup script details of the app block.
*
* This only applies to app blocks with PackagingType APPSTREAM2
.
*/
public ScriptDetails getPostSetupScriptDetails() {
return this.postSetupScriptDetails;
}
/**
*
* The post setup script details of the app block.
*
*
* This only applies to app blocks with PackagingType APPSTREAM2
.
*
*
* @param postSetupScriptDetails
* The post setup script details of the app block.
*
* This only applies to app blocks with PackagingType APPSTREAM2
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withPostSetupScriptDetails(ScriptDetails postSetupScriptDetails) {
setPostSetupScriptDetails(postSetupScriptDetails);
return this;
}
/**
*
* The packaging type of the app block.
*
*
* @param packagingType
* The packaging type of the app block.
* @see PackagingType
*/
public void setPackagingType(String packagingType) {
this.packagingType = packagingType;
}
/**
*
* The packaging type of the app block.
*
*
* @return The packaging type of the app block.
* @see PackagingType
*/
public String getPackagingType() {
return this.packagingType;
}
/**
*
* The packaging type of the app block.
*
*
* @param packagingType
* The packaging type of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackagingType
*/
public AppBlock withPackagingType(String packagingType) {
setPackagingType(packagingType);
return this;
}
/**
*
* The packaging type of the app block.
*
*
* @param packagingType
* The packaging type of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PackagingType
*/
public AppBlock withPackagingType(PackagingType packagingType) {
this.packagingType = packagingType.toString();
return this;
}
/**
*
* The state of the app block.
*
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application package
* (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for an app block,
* it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
*
*
* @param state
* The state of the app block.
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application
* package (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for
* an app block, it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
* @see AppBlockState
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The state of the app block.
*
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application package
* (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for an app block,
* it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
*
*
* @return The state of the app block.
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application
* package (VHD) is assigned to it. After an application package (VHD) is created by an app block builder
* for an app block, it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
* @see AppBlockState
*/
public String getState() {
return this.state;
}
/**
*
* The state of the app block.
*
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application package
* (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for an app block,
* it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
*
*
* @param state
* The state of the app block.
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application
* package (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for
* an app block, it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AppBlockState
*/
public AppBlock withState(String state) {
setState(state);
return this;
}
/**
*
* The state of the app block.
*
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application package
* (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for an app block,
* it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
*
*
* @param state
* The state of the app block.
*
* An app block with AppStream 2.0 packaging will be in the INACTIVE
state if no application
* package (VHD) is assigned to it. After an application package (VHD) is created by an app block builder for
* an app block, it becomes ACTIVE
.
*
*
* Custom app blocks are always in the ACTIVE
state and no action is required to use them.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AppBlockState
*/
public AppBlock withState(AppBlockState state) {
this.state = state.toString();
return this;
}
/**
*
* The errors of the app block.
*
*
* @return The errors of the app block.
*/
public java.util.List getAppBlockErrors() {
return appBlockErrors;
}
/**
*
* The errors of the app block.
*
*
* @param appBlockErrors
* The errors of the app block.
*/
public void setAppBlockErrors(java.util.Collection appBlockErrors) {
if (appBlockErrors == null) {
this.appBlockErrors = null;
return;
}
this.appBlockErrors = new java.util.ArrayList(appBlockErrors);
}
/**
*
* The errors of the app block.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAppBlockErrors(java.util.Collection)} or {@link #withAppBlockErrors(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param appBlockErrors
* The errors of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withAppBlockErrors(ErrorDetails... appBlockErrors) {
if (this.appBlockErrors == null) {
setAppBlockErrors(new java.util.ArrayList(appBlockErrors.length));
}
for (ErrorDetails ele : appBlockErrors) {
this.appBlockErrors.add(ele);
}
return this;
}
/**
*
* The errors of the app block.
*
*
* @param appBlockErrors
* The errors of the app block.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AppBlock withAppBlockErrors(java.util.Collection appBlockErrors) {
setAppBlockErrors(appBlockErrors);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getDisplayName() != null)
sb.append("DisplayName: ").append(getDisplayName()).append(",");
if (getSourceS3Location() != null)
sb.append("SourceS3Location: ").append(getSourceS3Location()).append(",");
if (getSetupScriptDetails() != null)
sb.append("SetupScriptDetails: ").append(getSetupScriptDetails()).append(",");
if (getCreatedTime() != null)
sb.append("CreatedTime: ").append(getCreatedTime()).append(",");
if (getPostSetupScriptDetails() != null)
sb.append("PostSetupScriptDetails: ").append(getPostSetupScriptDetails()).append(",");
if (getPackagingType() != null)
sb.append("PackagingType: ").append(getPackagingType()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getAppBlockErrors() != null)
sb.append("AppBlockErrors: ").append(getAppBlockErrors());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AppBlock == false)
return false;
AppBlock other = (AppBlock) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getDisplayName() == null ^ this.getDisplayName() == null)
return false;
if (other.getDisplayName() != null && other.getDisplayName().equals(this.getDisplayName()) == false)
return false;
if (other.getSourceS3Location() == null ^ this.getSourceS3Location() == null)
return false;
if (other.getSourceS3Location() != null && other.getSourceS3Location().equals(this.getSourceS3Location()) == false)
return false;
if (other.getSetupScriptDetails() == null ^ this.getSetupScriptDetails() == null)
return false;
if (other.getSetupScriptDetails() != null && other.getSetupScriptDetails().equals(this.getSetupScriptDetails()) == false)
return false;
if (other.getCreatedTime() == null ^ this.getCreatedTime() == null)
return false;
if (other.getCreatedTime() != null && other.getCreatedTime().equals(this.getCreatedTime()) == false)
return false;
if (other.getPostSetupScriptDetails() == null ^ this.getPostSetupScriptDetails() == null)
return false;
if (other.getPostSetupScriptDetails() != null && other.getPostSetupScriptDetails().equals(this.getPostSetupScriptDetails()) == false)
return false;
if (other.getPackagingType() == null ^ this.getPackagingType() == null)
return false;
if (other.getPackagingType() != null && other.getPackagingType().equals(this.getPackagingType()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getAppBlockErrors() == null ^ this.getAppBlockErrors() == null)
return false;
if (other.getAppBlockErrors() != null && other.getAppBlockErrors().equals(this.getAppBlockErrors()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getDisplayName() == null) ? 0 : getDisplayName().hashCode());
hashCode = prime * hashCode + ((getSourceS3Location() == null) ? 0 : getSourceS3Location().hashCode());
hashCode = prime * hashCode + ((getSetupScriptDetails() == null) ? 0 : getSetupScriptDetails().hashCode());
hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
hashCode = prime * hashCode + ((getPostSetupScriptDetails() == null) ? 0 : getPostSetupScriptDetails().hashCode());
hashCode = prime * hashCode + ((getPackagingType() == null) ? 0 : getPackagingType().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getAppBlockErrors() == null) ? 0 : getAppBlockErrors().hashCode());
return hashCode;
}
@Override
public AppBlock clone() {
try {
return (AppBlock) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.appstream.model.transform.AppBlockMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}