def match()

in cfn-lint-serverless/cfn_lint_serverless/rules/api_gateway.py [0:0]


    def match(self, cfn):
        """
        Match against API Gateway stages not using structured logging
        """

        matches = []

        for key, value in cfn.get_resources(["AWS::ApiGateway::Stage", "AWS::ApiGatewayV2::Stage"]).items():
            if value["Type"] == "AWS::ApiGateway::Stage":
                # REST APIs
                log_format = value.get("Properties", {}).get("AccessLogSetting", {}).get("Format", None)
            else:
                # HTTPI APIs
                log_format = value.get("Properties", {}).get("AccessLogSettings", {}).get("Format", None)

            # Ignore if it's not set. Another rule should catch it.
            if log_format is None:
                continue

            if not self._check_log_format(log_format):
                matches.append(RuleMatch(["Resources", key], self._message.format(key)))

        return matches