---
inputType: "CA10__CaAwsApiGatewayRestApi__c"
testData:
  - file: test-data.json
conditions:
  - status: "INCOMPLIANT"
    currentStateMessage: "There is at least one related API Stage where CloudWatch Access Logs are not enabled."
    remediationMessage: "Consider enabling CloudWatch Access Logs for the API Stage."
    check:
      RELATED_LIST_HAS:
        relationshipName: "CA10__AWS_API_Gateway_Stages__r"
        status: "INCOMPLIANT"
otherwise:
  status: "COMPLIANT"
  currentStateMessage: "API is compliant"
relatedLists:
  - relationshipName: "CA10__AWS_API_Gateway_Stages__r"
    conditions:
      - status: "INCOMPLIANT"
        currentStateMessage: "CloudWatch Access Logs are not enabled for this API Stage."
        remediationMessage: "Consider enabling CloudWatch Access Logs for this API Stage."
        check:
          IS_EMPTY_LOOKUP: "CA10__accessLoggingDestination__r"
    otherwise:
      status: "COMPLIANT"
      currentStateMessage: "CloudWatch Access Logs are enabled."
