/* * Copyright 2018-2023 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.gamelift.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Properties describing a Realtime script. *
** Related actions *
** All APIs by task *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Script implements Serializable, Cloneable, StructuredPojo { /** ** A unique identifier for the Realtime script *
*/ private String scriptId; /** ** The Amazon Resource Name (ARN) * that is assigned to a Amazon GameLift script resource and uniquely identifies it. ARNs are unique across all * Regions. In a GameLift script ARN, the resource ID matches the ScriptId value. *
*/ private String scriptArn; /** ** A descriptive label that is associated with a script. Script names don't need to be unique. *
*/ private String name; /** ** Version information associated with a build or script. Version strings don't need to be unique. *
*/ private String version; /** ** The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, * this value remains at "0". *
*/ private Long sizeOnDisk; /** *
* A time stamp indicating when this data object was created. Format is a number expressed in Unix time as
* milliseconds (for example "1469498468.057"
).
*
* The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage
* location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon
* GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to
* create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3
* object versioning turned on, you can use the ObjectVersion
parameter to specify an earlier version.
*
* A unique identifier for the Realtime script *
* * @param scriptId * A unique identifier for the Realtime script */ public void setScriptId(String scriptId) { this.scriptId = scriptId; } /** ** A unique identifier for the Realtime script *
* * @return A unique identifier for the Realtime script */ public String getScriptId() { return this.scriptId; } /** ** A unique identifier for the Realtime script *
* * @param scriptId * A unique identifier for the Realtime script * @return Returns a reference to this object so that method calls can be chained together. */ public Script withScriptId(String scriptId) { setScriptId(scriptId); return this; } /** ** The Amazon Resource Name (ARN) * that is assigned to a Amazon GameLift script resource and uniquely identifies it. ARNs are unique across all * Regions. In a GameLift script ARN, the resource ID matches the ScriptId value. *
* * @param scriptArn * The Amazon Resource Name (ARN) that is assigned to a * Amazon GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a * GameLift script ARN, the resource ID matches the ScriptId value. */ public void setScriptArn(String scriptArn) { this.scriptArn = scriptArn; } /** ** The Amazon Resource Name (ARN) * that is assigned to a Amazon GameLift script resource and uniquely identifies it. ARNs are unique across all * Regions. In a GameLift script ARN, the resource ID matches the ScriptId value. *
* * @return The Amazon Resource Name (ARN) that is assigned to a * Amazon GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a * GameLift script ARN, the resource ID matches the ScriptId value. */ public String getScriptArn() { return this.scriptArn; } /** ** The Amazon Resource Name (ARN) * that is assigned to a Amazon GameLift script resource and uniquely identifies it. ARNs are unique across all * Regions. In a GameLift script ARN, the resource ID matches the ScriptId value. *
* * @param scriptArn * The Amazon Resource Name (ARN) that is assigned to a * Amazon GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a * GameLift script ARN, the resource ID matches the ScriptId value. * @return Returns a reference to this object so that method calls can be chained together. */ public Script withScriptArn(String scriptArn) { setScriptArn(scriptArn); return this; } /** ** A descriptive label that is associated with a script. Script names don't need to be unique. *
* * @param name * A descriptive label that is associated with a script. Script names don't need to be unique. */ public void setName(String name) { this.name = name; } /** ** A descriptive label that is associated with a script. Script names don't need to be unique. *
* * @return A descriptive label that is associated with a script. Script names don't need to be unique. */ public String getName() { return this.name; } /** ** A descriptive label that is associated with a script. Script names don't need to be unique. *
* * @param name * A descriptive label that is associated with a script. Script names don't need to be unique. * @return Returns a reference to this object so that method calls can be chained together. */ public Script withName(String name) { setName(name); return this; } /** ** Version information associated with a build or script. Version strings don't need to be unique. *
* * @param version * Version information associated with a build or script. Version strings don't need to be unique. */ public void setVersion(String version) { this.version = version; } /** ** Version information associated with a build or script. Version strings don't need to be unique. *
* * @return Version information associated with a build or script. Version strings don't need to be unique. */ public String getVersion() { return this.version; } /** ** Version information associated with a build or script. Version strings don't need to be unique. *
* * @param version * Version information associated with a build or script. Version strings don't need to be unique. * @return Returns a reference to this object so that method calls can be chained together. */ public Script withVersion(String version) { setVersion(version); return this; } /** ** The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, * this value remains at "0". *
* * @param sizeOnDisk * The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 * location, this value remains at "0". */ public void setSizeOnDisk(Long sizeOnDisk) { this.sizeOnDisk = sizeOnDisk; } /** ** The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, * this value remains at "0". *
* * @return The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 * location, this value remains at "0". */ public Long getSizeOnDisk() { return this.sizeOnDisk; } /** ** The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, * this value remains at "0". *
* * @param sizeOnDisk * The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 * location, this value remains at "0". * @return Returns a reference to this object so that method calls can be chained together. */ public Script withSizeOnDisk(Long sizeOnDisk) { setSizeOnDisk(sizeOnDisk); return this; } /** *
* A time stamp indicating when this data object was created. Format is a number expressed in Unix time as
* milliseconds (for example "1469498468.057"
).
*
"1469498468.057"
).
*/
public void setCreationTime(java.util.Date creationTime) {
this.creationTime = creationTime;
}
/**
*
* A time stamp indicating when this data object was created. Format is a number expressed in Unix time as
* milliseconds (for example "1469498468.057"
).
*
"1469498468.057"
).
*/
public java.util.Date getCreationTime() {
return this.creationTime;
}
/**
*
* A time stamp indicating when this data object was created. Format is a number expressed in Unix time as
* milliseconds (for example "1469498468.057"
).
*
"1469498468.057"
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Script withCreationTime(java.util.Date creationTime) {
setCreationTime(creationTime);
return this;
}
/**
*
* The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage
* location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon
* GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to
* create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3
* object versioning turned on, you can use the ObjectVersion
parameter to specify an earlier version.
*
ObjectVersion
* parameter to specify an earlier version.
*/
public void setStorageLocation(S3Location storageLocation) {
this.storageLocation = storageLocation;
}
/**
*
* The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage
* location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon
* GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to
* create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3
* object versioning turned on, you can use the ObjectVersion
parameter to specify an earlier version.
*
ObjectVersion
* parameter to specify an earlier version.
*/
public S3Location getStorageLocation() {
return this.storageLocation;
}
/**
*
* The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage
* location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon
* GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to
* create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3
* object versioning turned on, you can use the ObjectVersion
parameter to specify an earlier version.
*
ObjectVersion
* parameter to specify an earlier version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Script withStorageLocation(S3Location storageLocation) {
setStorageLocation(storageLocation);
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 (getScriptId() != null)
sb.append("ScriptId: ").append(getScriptId()).append(",");
if (getScriptArn() != null)
sb.append("ScriptArn: ").append(getScriptArn()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getVersion() != null)
sb.append("Version: ").append(getVersion()).append(",");
if (getSizeOnDisk() != null)
sb.append("SizeOnDisk: ").append(getSizeOnDisk()).append(",");
if (getCreationTime() != null)
sb.append("CreationTime: ").append(getCreationTime()).append(",");
if (getStorageLocation() != null)
sb.append("StorageLocation: ").append(getStorageLocation());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Script == false)
return false;
Script other = (Script) obj;
if (other.getScriptId() == null ^ this.getScriptId() == null)
return false;
if (other.getScriptId() != null && other.getScriptId().equals(this.getScriptId()) == false)
return false;
if (other.getScriptArn() == null ^ this.getScriptArn() == null)
return false;
if (other.getScriptArn() != null && other.getScriptArn().equals(this.getScriptArn()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
return false;
if (other.getSizeOnDisk() == null ^ this.getSizeOnDisk() == null)
return false;
if (other.getSizeOnDisk() != null && other.getSizeOnDisk().equals(this.getSizeOnDisk()) == false)
return false;
if (other.getCreationTime() == null ^ this.getCreationTime() == null)
return false;
if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false)
return false;
if (other.getStorageLocation() == null ^ this.getStorageLocation() == null)
return false;
if (other.getStorageLocation() != null && other.getStorageLocation().equals(this.getStorageLocation()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getScriptId() == null) ? 0 : getScriptId().hashCode());
hashCode = prime * hashCode + ((getScriptArn() == null) ? 0 : getScriptArn().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getSizeOnDisk() == null) ? 0 : getSizeOnDisk().hashCode());
hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
hashCode = prime * hashCode + ((getStorageLocation() == null) ? 0 : getStorageLocation().hashCode());
return hashCode;
}
@Override
public Script clone() {
try {
return (Script) 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.gamelift.model.transform.ScriptMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}