software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSet Maven / Gradle / Ivy
Show all versions of gamelift-alpha Show documentation
package software.amazon.awscdk.services.gamelift.alpha;
/**
* (experimental) Creates a new rule set for FlexMatch matchmaking.
*
* The rule set determines the two key elements of a match: your game's team structure and size, and how to group players together for the best possible match.
*
* For example, a rule set might describe a match like this:
*
*
* - Create a match with two teams of five players each, one team is the defenders and the other team the invaders.
* - A team can have novice and experienced players, but the average skill of the two teams must be within 10 points of each other.
* - If no match is made after 30 seconds, gradually relax the skill requirements.
*
*
* Rule sets must be defined in the same Region as the matchmaking configuration they are used with.
*
* Example:
*
*
* MatchmakingRuleSet.Builder.create(this, "RuleSet")
* .matchmakingRuleSetName("my-test-ruleset")
* .content(RuleSetContent.fromJsonFile(join(__dirname, "my-ruleset", "ruleset.json")))
* .build();
*
*
* @see https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.104.0 (build e79254c)", date = "2024-12-27T17:02:12.133Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.gamelift.alpha.$Module.class, fqn = "@aws-cdk/aws-gamelift-alpha.MatchmakingRuleSet")
public class MatchmakingRuleSet extends software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSetBase {
protected MatchmakingRuleSet(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected MatchmakingRuleSet(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param id This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public MatchmakingRuleSet(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSetProps props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) Import a ruleSet into CDK using its ARN.
*
* @param scope This parameter is required.
* @param id This parameter is required.
* @param matchmakingRuleSetArn This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.IMatchmakingRuleSet fromMatchmakingRuleSetArn(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull java.lang.String matchmakingRuleSetArn) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSet.class, "fromMatchmakingRuleSetArn", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.IMatchmakingRuleSet.class), new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(matchmakingRuleSetArn, "matchmakingRuleSetArn is required") });
}
/**
* (experimental) Import an existing matchmaking ruleSet from its attributes.
*
* @param scope This parameter is required.
* @param id This parameter is required.
* @param attrs This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.IMatchmakingRuleSet fromMatchmakingRuleSetAttributes(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSetAttributes attrs) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSet.class, "fromMatchmakingRuleSetAttributes", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.IMatchmakingRuleSet.class), new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(attrs, "attrs is required") });
}
/**
* (experimental) Import a ruleSet into CDK using its name.
*
* @param scope This parameter is required.
* @param id This parameter is required.
* @param matchmakingRuleSetName This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.gamelift.alpha.IMatchmakingRuleSet fromMatchmakingRuleSetName(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull java.lang.String matchmakingRuleSetName) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSet.class, "fromMatchmakingRuleSetName", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.gamelift.alpha.IMatchmakingRuleSet.class), new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(matchmakingRuleSetName, "matchmakingRuleSetName is required") });
}
/**
* (experimental) The ARN of the ruleSet.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getMatchmakingRuleSetArn() {
return software.amazon.jsii.Kernel.get(this, "matchmakingRuleSetArn", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) The unique name of the ruleSet.
*/
@Override
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getMatchmakingRuleSetName() {
return software.amazon.jsii.Kernel.get(this, "matchmakingRuleSetName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* (experimental) A fluent builder for {@link software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSet}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
* @param id This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope, final java.lang.String id) {
return new Builder(scope, id);
}
private final software.constructs.Construct scope;
private final java.lang.String id;
private final software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSetProps.Builder props;
private Builder(final software.constructs.Construct scope, final java.lang.String id) {
this.scope = scope;
this.id = id;
this.props = new software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSetProps.Builder();
}
/**
* (experimental) A collection of matchmaking rules.
*
* @return {@code this}
* @param content A collection of matchmaking rules. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder content(final software.amazon.awscdk.services.gamelift.alpha.RuleSetContent content) {
this.props.content(content);
return this;
}
/**
* (experimental) A unique identifier for the matchmaking rule set.
*
* A matchmaking configuration identifies the rule set it uses by this name value.
*
* Note: the rule set name is different from the optional name field in the rule set body
*
* @return {@code this}
* @param matchmakingRuleSetName A unique identifier for the matchmaking rule set. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder matchmakingRuleSetName(final java.lang.String matchmakingRuleSetName) {
this.props.matchmakingRuleSetName(matchmakingRuleSetName);
return this;
}
/**
* @return a newly built instance of {@link software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSet}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSet build() {
return new software.amazon.awscdk.services.gamelift.alpha.MatchmakingRuleSet(
this.scope,
this.id,
this.props.build()
);
}
}
}