software.amazon.awscdk.services.gamelift.alpha.BuildProps Maven / Gradle / Ivy
Show all versions of gamelift-alpha Show documentation
package software.amazon.awscdk.services.gamelift.alpha;
/**
* (experimental) Properties for a new build.
*
* Example:
*
*
* Bucket bucket;
* Build build = Build.Builder.create(this, "Build")
* .content(Content.fromBucket(bucket, "sample-asset-key"))
* .build();
* CfnOutput.Builder.create(this, "BuildArn").value(build.getBuildArn()).build();
* CfnOutput.Builder.create(this, "BuildId").value(build.getBuildId()).build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-12-27T17:02:12.095Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.gamelift.alpha.$Module.class, fqn = "@aws-cdk/aws-gamelift-alpha.BuildProps")
@software.amazon.jsii.Jsii.Proxy(BuildProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface BuildProps extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The game build file storage.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.Content getContent();
/**
* (experimental) Name of this build.
*
* Default: No name
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getBuildName() {
return null;
}
/**
* (experimental) Version of this build.
*
* Default: No version
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getBuildVersion() {
return null;
}
/**
* (experimental) The operating system that the game server binaries are built to run on.
*
* Default: No version
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.gamelift.alpha.OperatingSystem getOperatingSystem() {
return null;
}
/**
* (experimental) The IAM role assumed by GameLift to access server build in S3.
*
* If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com) and be granted sufficient permissions
* to have Read access to a specific key content into a specific S3 bucket.
* Below an example of required permission:
* {
* "Version": "2012-10-17",
* "Statement": [{
* "Effect": "Allow",
* "Action": [
* "s3:GetObject",
* "s3:GetObjectVersion"
* ],
* "Resource": "arn:aws:s3:::bucket-name/object-name"
* }]
* }
*
* Default: - a role will be created with default permissions.
*
* @see https://docs.aws.amazon.com/gamelift/latest/developerguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-access-storage-loc
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.iam.IRole getRole() {
return null;
}
/**
* (experimental) A server SDK version you used when integrating your game server build with Amazon GameLift.
*
* Default: - 4.0.2
*
* @see https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-custom-intro.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getServerSdkVersion() {
return null;
}
/**
* @return a {@link Builder} of {@link BuildProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link BuildProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
software.amazon.awscdk.services.gamelift.alpha.Content content;
java.lang.String buildName;
java.lang.String buildVersion;
software.amazon.awscdk.services.gamelift.alpha.OperatingSystem operatingSystem;
software.amazon.awscdk.services.iam.IRole role;
java.lang.String serverSdkVersion;
/**
* Sets the value of {@link BuildProps#getContent}
* @param content The game build file storage. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder content(software.amazon.awscdk.services.gamelift.alpha.Content content) {
this.content = content;
return this;
}
/**
* Sets the value of {@link BuildProps#getBuildName}
* @param buildName Name of this build.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder buildName(java.lang.String buildName) {
this.buildName = buildName;
return this;
}
/**
* Sets the value of {@link BuildProps#getBuildVersion}
* @param buildVersion Version of this build.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder buildVersion(java.lang.String buildVersion) {
this.buildVersion = buildVersion;
return this;
}
/**
* Sets the value of {@link BuildProps#getOperatingSystem}
* @param operatingSystem The operating system that the game server binaries are built to run on.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder operatingSystem(software.amazon.awscdk.services.gamelift.alpha.OperatingSystem operatingSystem) {
this.operatingSystem = operatingSystem;
return this;
}
/**
* Sets the value of {@link BuildProps#getRole}
* @param role The IAM role assumed by GameLift to access server build in S3.
* If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com) and be granted sufficient permissions
* to have Read access to a specific key content into a specific S3 bucket.
* Below an example of required permission:
* {
* "Version": "2012-10-17",
* "Statement": [{
* "Effect": "Allow",
* "Action": [
* "s3:GetObject",
* "s3:GetObjectVersion"
* ],
* "Resource": "arn:aws:s3:::bucket-name/object-name"
* }]
* }
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder role(software.amazon.awscdk.services.iam.IRole role) {
this.role = role;
return this;
}
/**
* Sets the value of {@link BuildProps#getServerSdkVersion}
* @param serverSdkVersion A server SDK version you used when integrating your game server build with Amazon GameLift.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder serverSdkVersion(java.lang.String serverSdkVersion) {
this.serverSdkVersion = serverSdkVersion;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link BuildProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public BuildProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link BuildProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements BuildProps {
private final software.amazon.awscdk.services.gamelift.alpha.Content content;
private final java.lang.String buildName;
private final java.lang.String buildVersion;
private final software.amazon.awscdk.services.gamelift.alpha.OperatingSystem operatingSystem;
private final software.amazon.awscdk.services.iam.IRole role;
private final java.lang.String serverSdkVersion;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.content = software.amazon.jsii.Kernel.get(this, "content", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.Content.class));
this.buildName = software.amazon.jsii.Kernel.get(this, "buildName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.buildVersion = software.amazon.jsii.Kernel.get(this, "buildVersion", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.operatingSystem = software.amazon.jsii.Kernel.get(this, "operatingSystem", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.OperatingSystem.class));
this.role = software.amazon.jsii.Kernel.get(this, "role", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.iam.IRole.class));
this.serverSdkVersion = software.amazon.jsii.Kernel.get(this, "serverSdkVersion", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.content = java.util.Objects.requireNonNull(builder.content, "content is required");
this.buildName = builder.buildName;
this.buildVersion = builder.buildVersion;
this.operatingSystem = builder.operatingSystem;
this.role = builder.role;
this.serverSdkVersion = builder.serverSdkVersion;
}
@Override
public final software.amazon.awscdk.services.gamelift.alpha.Content getContent() {
return this.content;
}
@Override
public final java.lang.String getBuildName() {
return this.buildName;
}
@Override
public final java.lang.String getBuildVersion() {
return this.buildVersion;
}
@Override
public final software.amazon.awscdk.services.gamelift.alpha.OperatingSystem getOperatingSystem() {
return this.operatingSystem;
}
@Override
public final software.amazon.awscdk.services.iam.IRole getRole() {
return this.role;
}
@Override
public final java.lang.String getServerSdkVersion() {
return this.serverSdkVersion;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("content", om.valueToTree(this.getContent()));
if (this.getBuildName() != null) {
data.set("buildName", om.valueToTree(this.getBuildName()));
}
if (this.getBuildVersion() != null) {
data.set("buildVersion", om.valueToTree(this.getBuildVersion()));
}
if (this.getOperatingSystem() != null) {
data.set("operatingSystem", om.valueToTree(this.getOperatingSystem()));
}
if (this.getRole() != null) {
data.set("role", om.valueToTree(this.getRole()));
}
if (this.getServerSdkVersion() != null) {
data.set("serverSdkVersion", om.valueToTree(this.getServerSdkVersion()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-gamelift-alpha.BuildProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BuildProps.Jsii$Proxy that = (BuildProps.Jsii$Proxy) o;
if (!content.equals(that.content)) return false;
if (this.buildName != null ? !this.buildName.equals(that.buildName) : that.buildName != null) return false;
if (this.buildVersion != null ? !this.buildVersion.equals(that.buildVersion) : that.buildVersion != null) return false;
if (this.operatingSystem != null ? !this.operatingSystem.equals(that.operatingSystem) : that.operatingSystem != null) return false;
if (this.role != null ? !this.role.equals(that.role) : that.role != null) return false;
return this.serverSdkVersion != null ? this.serverSdkVersion.equals(that.serverSdkVersion) : that.serverSdkVersion == null;
}
@Override
public final int hashCode() {
int result = this.content.hashCode();
result = 31 * result + (this.buildName != null ? this.buildName.hashCode() : 0);
result = 31 * result + (this.buildVersion != null ? this.buildVersion.hashCode() : 0);
result = 31 * result + (this.operatingSystem != null ? this.operatingSystem.hashCode() : 0);
result = 31 * result + (this.role != null ? this.role.hashCode() : 0);
result = 31 * result + (this.serverSdkVersion != null ? this.serverSdkVersion.hashCode() : 0);
return result;
}
}
}