Skip to content

validate_matchmaking_rule_set

validate_matchmaking_rule_set(
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    rule_set_body: Optional[RuleSetBody] = None,
) -> ValidateMatchmakingRuleSetOutput

This API works with the following fleet types: EC2, Anywhere, Container

Validates the syntax of a matchmaking rule or rule set. This operation checks that the rule set is using syntactically correct JSON and that it conforms to allowed property expressions. To validate syntax, provide a rule set JSON string.

Learn more

Parameters:

  • rule_set_body (Optional[RuleSetBody], default: None ) –

    A collection of matchmaking rules to validate, formatted as a JSON string.

Raises:

  • InternalServiceException –

    The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

  • InvalidRequestException –

    One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

  • UnsupportedRegionException –

    The requested operation is not supported in the Region specified.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_gamelift/_services/game_lift.py
def validate_matchmaking_rule_set(
    self,
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    rule_set_body: Optional["capo_gamelift.types.rule_set_body.RuleSetBody"] = None,
) -> "capo_gamelift.types.validate_matchmaking_rule_set_output.ValidateMatchmakingRuleSetOutput":
    """<p> <b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p> <p>Validates the syntax of a matchmaking rule or rule set. This operation checks that the rule set is using syntactically correct JSON and that it conforms to allowed property expressions. To validate syntax, provide a rule set JSON string.</p> <p> <b>Learn more</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html">Build a rule set</a> </p> </li> </ul>

    Args:
        rule_set_body: <p>A collection of matchmaking rules to validate, formatted as a JSON string.</p>

    Raises:
        capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
        capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
        capo_gamelift.errors.unsupported_region_exception.UnsupportedRegionException: <p>The requested operation is not supported in the Region specified.</p>
        capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_gamelift.types.validate_matchmaking_rule_set_input.ValidateMatchmakingRuleSetInput]",
    ) -> OperationResponse[
        "capo_gamelift.types.validate_matchmaking_rule_set_output.ValidateMatchmakingRuleSetOutput"
    ]:
        import capo_gamelift._operations.game_lift.validate_matchmaking_rule_set

        output, http_response = (
            capo_gamelift._operations.game_lift.validate_matchmaking_rule_set.validate_matchmaking_rule_set(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ValidateMatchmakingRuleSet")
    )
    input_: capo_gamelift.types.validate_matchmaking_rule_set_input.ValidateMatchmakingRuleSetInput = {}
    if rule_set_body is not None:
        input_["rule_set_body"] = rule_set_body

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output