---
policy: /ce/ca/google/logging/sinks-configuration
logic: /ce/ca/google/logging/sinks-configuration/prod.logic.yaml
executionTime: 2025-04-24T23:47:12.487465028Z
rows:
  - id: aKAI
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)
      actual: CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)
    runtimeError: {}
  - id: aTKAY
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: aTKAY5
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: atKAI22
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)
      actual: CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)
    runtimeError: {}
  - id: aAY22
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: atKAI33
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)
      actual: CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)
    runtimeError: {}
  - id: aB1TKAY33
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
usedFiles:
  - path: /ce/ca/google/logging/sinks-configuration/policy.yaml
    md5Hash: FB32B87A29B08CF7E8396410B50D96BC
    content: "---\nnames: \n  full: \"Google Logging Log Sink for All Log Entries\
      \ is not configured\"\n  contextual: \"Log Sink for All Log Entries is not configured\"\
      \ndescription: \"It is recommended to create a sink that will export copies\
      \ of all the log entries. This can \\\n help aggregate logs from multiple projects\
      \ and export them to a Security Information and Event Management (SIEM).\"\n\
      type: COMPLIANCE_POLICY\ncategories:\n  - \"SECURITY\"\nframeworkMappings:\n\
      \  - /frameworks/cis-gcp-v3.0.0/02/02\n  - /frameworks/cloudaware/logging-and-monitoring/logging-and-monitoring-configuration\n\
      similarPolicies:\n  cloudConformity:\n    - url: \"https://www.trendmicro.com/cloudoneconformity-staging/knowledge-base/gcp/CloudLogging/export-all-log-entries.html\"\
      \n      name: \"Export All Log Entries Using Sinks\"\n"
  - path: /ce/ca/google/logging/sinks-configuration/prod.logic.yaml
    md5Hash: CA98E03FF04EC0C24547E3F02CD40C0C
    content: "---\n\ninputType: \"CA10__CaGoogleProject__c\"\ntestData:\n  - file:\
      \ test-data.json\nconditions:\n  - status: \"COMPLIANT\"\n    currentStateMessage:\
      \ \"Sinks are configured for all log entries\"\n    check:\n      RELATED_LIST_HAS:\n\
      \        status: \"COMPLIANT\"\n        relationshipName: \"CA10__Google_Resource_Manager_Projects__r\"\
      \notherwise:\n  status: \"INCOMPLIANT\"\n  currentStateMessage: \"The project\
      \ does not have sinks configured for all log entries.\"\n  remediationMessage:\
      \ \"It is recommended to create a sink that will export copies of all the log\
      \ entries.\"\nrelatedLists:\n  - relationshipName: \"CA10__Google_Resource_Manager_Projects__r\"\
      \n    importExtracts:\n      - file: /types/CA10G1__CaGoogleLoggingLogSink__c/object.extracts.yaml\n\
      \    conditions:\n      - status: \"COMPLIANT\"\n        currentStateMessage:\
      \ \"Resource Manager Organization or Folder or Project with COMPLIANT Sink.\"\
      \n        check:\n          OR:\n            args:\n              - RELATED_LIST_HAS:\n\
      \                  status: \"COMPLIANT\"\n                  relationshipName:\
      \ \"CA10G1__Google_Logging_Log_Sinks1__r\"\n              - RELATED_LIST_HAS:\n\
      \                  status: \"COMPLIANT\"\n                  relationshipName:\
      \ \"CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r\"\n\
      \              - RELATED_LIST_HAS:\n                  status: \"COMPLIANT\"\n\
      \                  relationshipName: \"CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r\"\
      \n    otherwise:\n      status: \"INCOMPLIANT\"\n      currentStateMessage:\
      \ \"There is no COMPLIANT sink connected with project.\"\n    relatedLists:\n\
      \        # # ORG level\n      - relationshipName: \"CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r\"\
      \n        recordTypes:\n          - \"caGoogleLoggingLogSinkOrganization\"\n\
      \        conditions:\n          - status: \"COMPLIANT\"\n            currentStateMessage:\
      \ \"Resource Manager Organization with COMPLIANT Sink\"\n            check:\n\
      \              AND:\n                args:\n                  - IS_EMPTY:\n\
      \                      arg:\n                        EXTRACT: \"CA10G1__filter__c\"\
      \n                  - NOT_EMPTY:\n                      arg:\n             \
      \           EXTRACT: \"CA10G1__destination__c\"\n        otherwise:\n      \
      \    status: \"INCOMPLIANT\"\n          currentStateMessage: \"Resource Manager\
      \ Organization does not have sinks configured for all log entries.\"\n    #\
      \ FOLDER level\n      - relationshipName: \"CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r\"\
      \n        recordTypes:\n          - \"caGoogleLoggingLogSinkFolder\"\n     \
      \   conditions: \n          - status: \"COMPLIANT\"\n            currentStateMessage:\
      \ \"Resource Manager Folder with COMPLIANT Sink.\"\n            check:\n   \
      \           AND:\n                args:\n                  - IS_EMPTY:\n   \
      \                   arg:\n                        EXTRACT: \"CA10G1__filter__c\"\
      \n                  - NOT_EMPTY:\n                      arg:\n             \
      \           EXTRACT: \"CA10G1__destination__c\"\n        otherwise:\n      \
      \    status: \"INCOMPLIANT\"\n          currentStateMessage: \"Resource Manager\
      \ Folder does not have sinks configured for all log entries.\"\n    # PROJECT\
      \ level  \n      - relationshipName: \"CA10G1__Google_Logging_Log_Sinks1__r\"\
      \n        recordTypes:\n          - \"caGoogleLoggingLogSinkProject\"\n    \
      \    conditions: \n          - status: \"COMPLIANT\"\n            currentStateMessage:\
      \ \"Resource Manager Project with COMPLIANT Sink.\"\n            check:\n  \
      \            AND:\n                args:\n                  - IS_EMPTY:\n  \
      \                    arg:\n                        EXTRACT: \"CA10G1__filter__c\"\
      \n                  - NOT_EMPTY:\n                      arg:\n             \
      \           EXTRACT: \"CA10G1__destination__c\"\n        otherwise:\n      \
      \    status: \"INCOMPLIANT\"\n          currentStateMessage: \"Resource Manager\
      \ Project does not have sinks configured for all log entries.\"\n\n"
  - path: /ce/ca/google/logging/sinks-configuration/test-data.json
    md5Hash: 668BDFEEB4133021CA54DC7D37A33665
    content: "[\n  {\n    \"expectedResult\": {\n      \"status\": \"COMPLIANT\",\n\
      \      \"conditionIndex\": \"199\",\n      \"conditionText\": \"CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)\"\
      ,\n      \"runtimeError\": null\n    },\n    \"context\": { \"snapshotTime\"\
      : \"2024-12-06T06:06:17Z\" },\n    \"Id\": \"aKAI\",\n    \"CA10__Google_Resource_Manager_Projects__r\"\
      : [\n      {\n        \"Id\": \"aDOAW\",\n        \"CA10__disappearanceTime__c\"\
      : null,\n        \"CA10__googleProject__c\": \"aKAI\",\n        \"CA10__resourceManagerOrganization__c\"\
      : \"\",\n        \"CA10__resourceManagerFolder__c\": \"\",\n        \"CA10__resourceManagerOrganization__r\"\
      : {\n          \"Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\"\
      : []\n        },\n        \"CA10__resourceManagerFolder__r\": {\n          \"\
      Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n      \
      \  },\n        \"CA10G1__Google_Logging_Log_Sinks1__r\": [\n          {\n  \
      \          \"Id\": \"a11Q\",\n            \"RecordTypeId\": \"012IA0\",\n  \
      \          \"CA10G1__disappearanceTime__c\": null,\n            \"CA10G1__filter__c\"\
      : \"\",\n            \"CA10G1__destination__c\": \"logging.googleapis.com/projects\"\
      ,\n            \"CA10G1__resourceManagerProject__c\": \"aDOAW\",\n         \
      \   \"RecordType\": {\n              \"DeveloperName\": \"caGoogleLoggingLogSinkProject\"\
      ,\n              \"Id\": \"012IA0\"\n            }\n          },\n         \
      \ {\n            \"Id\": \"a12Q\",\n            \"RecordTypeId\": \"012IA0\"\
      ,\n            \"CA10G1__disappearanceTime__c\": null,\n            \"CA10G1__filter__c\"\
      : \"LOG_ID(\\\"activity\\\") OR LOG_ID(\\\"googleapis.com/activity\\\")\",\n\
      \            \"CA10G1__destination__c\": \"logging.googleapis.com/projects\"\
      ,\n            \"CA10G1__resourceManagerProject__c\": \"aDOAW\",\n         \
      \   \"RecordType\": {\n              \"DeveloperName\": \"caGoogleLoggingLogSinkProject\"\
      ,\n              \"Id\": \"012IA0\"\n            }\n          }\n        ]\n\
      \      }\n    ]\n  },\n  {\n    \"expectedResult\": {\n      \"status\": \"\
      INCOMPLIANT\",\n      \"conditionIndex\": \"200\",\n      \"conditionText\"\
      : \"otherwise\",\n      \"runtimeError\": null\n    },\n    \"context\": { \"\
      snapshotTime\": \"2024-12-06T06:06:17Z\" },\n    \"Id\": \"aTKAY\",\n    \"\
      CA10__Google_Resource_Manager_Projects__r\": [\n      {\n        \"Id\": \"\
      aDtOAI\",\n        \"CA10__disappearanceTime__c\": null,\n        \"CA10__googleProject__c\"\
      : \"aTKAY\",\n        \"CA10__resourceManagerOrganization__c\": \"\",\n    \
      \    \"CA10__resourceManagerFolder__c\": \"\",\n        \"CA10__resourceManagerOrganization__r\"\
      : {\n          \"Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\"\
      : []\n        },\n        \"CA10__resourceManagerFolder__r\": {\n          \"\
      Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n      \
      \  },\n        \"CA10G1__Google_Logging_Log_Sinks1__r\": [\n          {\n  \
      \          \"Id\": \"a1oKAI\",\n            \"RecordTypeId\": \"012IA0\",\n\
      \            \"CA10G1__disappearanceTime__c\": null,\n            \"CA10G1__filter__c\"\
      : \"LOG_ID(\\\"activity\\\") OR LOG_ID(\\\"googleapis.com/activity\\\")\",\n\
      \            \"CA10G1__destination__c\": \"logging.googleapis.com/projects\"\
      ,\n            \"CA10G1__resourceManagerProject__c\": \"aDtOAI\",\n        \
      \    \"RecordType\": {\n              \"DeveloperName\": \"caGoogleLoggingLogSinkProject\"\
      ,\n              \"Id\": \"012IA0\"\n            }\n          }\n        ]\n\
      \      }\n    ]\n  },\n  {\n    \"expectedResult\": {\n      \"status\": \"\
      INCOMPLIANT\",\n      \"conditionIndex\": \"200\",\n      \"conditionText\"\
      : \"otherwise\",\n      \"runtimeError\": null\n    },\n    \"context\": { \"\
      snapshotTime\": \"2024-12-06T06:06:17Z\" },\n    \"Id\": \"aTKAY5\",\n    \"\
      CA10__Google_Resource_Manager_Projects__r\": [\n      {\n        \"Id\": \"\
      aDtOAI5\",\n        \"CA10__disappearanceTime__c\": null,\n        \"CA10__googleProject__c\"\
      : \"aTKAY5\",\n        \"CA10__resourceManagerOrganization__c\": \"\",\n   \
      \     \"CA10__resourceManagerFolder__c\": \"\",\n        \"CA10__resourceManagerOrganization__r\"\
      : {\n          \"Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\"\
      : []\n        },\n        \"CA10__resourceManagerFolder__r\": {\n          \"\
      Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n      \
      \  },\n        \"CA10G1__Google_Logging_Log_Sinks1__r\": [\n          {\n  \
      \          \"Id\": \"a1oKAI5\",\n            \"RecordTypeId\": \"012IA0\",\n\
      \            \"CA10G1__disappearanceTime__c\": null,\n            \"CA10G1__filter__c\"\
      : \"\",\n            \"CA10G1__destination__c\": \"\",\n            \"CA10G1__resourceManagerProject__c\"\
      : \"aDtOAI5\",\n            \"RecordType\": {\n              \"DeveloperName\"\
      : \"caGoogleLoggingLogSinkProject\",\n              \"Id\": \"012IA0\"\n   \
      \         }\n          }\n        ]\n      }\n    ]\n  },\n\n\n\n  {\n    \"\
      expectedResult\": {\n      \"status\": \"COMPLIANT\",\n      \"conditionIndex\"\
      : \"199\",\n      \"conditionText\": \"CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)\"\
      ,\n      \"runtimeError\": null\n    },\n    \"context\": { \"snapshotTime\"\
      : \"2024-12-06T06:06:17Z\" },\n    \"Id\": \"atKAI22\",\n    \"CA10__Google_Resource_Manager_Projects__r\"\
      : [\n      {\n        \"Id\": \"aDOAW22\",\n        \"CA10__disappearanceTime__c\"\
      : null,\n        \"CA10__googleProject__c\": \"atKAI22\",\n        \"CA10__resourceManagerOrganization__c\"\
      : \"\",\n        \"CA10__resourceManagerFolder__c\": \"aDOAW22FF\",\n      \
      \  \"CA10__resourceManagerOrganization__r\": {\n          \"Id\": null,\n  \
      \        \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n        },\n        \"\
      CA10__resourceManagerFolder__r\": {\n          \"Id\": \"aDOAW22FF\",\n    \
      \      \"CA10G1__Google_Logging_Log_Sinks1__r\": [          \n            {\n\
      \              \"Id\": \"aRKAQ22\",\n              \"RecordTypeId\": \"012A022FF\"\
      ,\n              \"CA10G1__disappearanceTime__c\": null,\n              \"CA10G1__filter__c\"\
      : \"\",\n              \"CA10G1__destination__c\": \"logging.googleapis.com/projects\"\
      ,\n              \"CA10G1__resourceManagerFolder__c\": \"aDOAW22FF\",\n    \
      \          \"RecordType\": {\n              \"DeveloperName\": \"caGoogleLoggingLogSinkFolder\"\
      ,\n              \"Id\": \"012A022FF\"\n              }\n            }\n   \
      \       ]\n        },\n        \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n\
      \      }\n    ]\n  },\n  {\n    \"expectedResult\": {\n      \"status\": \"\
      INCOMPLIANT\",\n      \"conditionIndex\": \"200\",\n      \"conditionText\"\
      : \"otherwise\",\n      \"runtimeError\": null\n    },\n    \"context\": { \"\
      snapshotTime\": \"2024-12-06T06:06:17Z\" },\n    \"Id\": \"aAY22\",\n    \"\
      CA10__Google_Resource_Manager_Projects__r\": [\n      {\n        \"Id\": \"\
      atOAI22\",\n        \"CA10__disappearanceTime__c\": null,\n        \"CA10__googleProject__c\"\
      : \"aAY22\",\n        \"CA10__resourceManagerOrganization__c\": \"\",\n    \
      \    \"CA10__resourceManagerFolder__c\": \"aOAI22FF\",\n        \"CA10__resourceManagerOrganization__r\"\
      : {\n          \"Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\"\
      : []\n        },\n        \"CA10__resourceManagerFolder__r\": {\n          \"\
      Id\": \"aOAI22FF\",\n          \"CA10G1__Google_Logging_Log_Sinks1__r\": [\n\
      \            {\n              \"Id\": \"aR21HoKAI22\",\n              \"RecordTypeId\"\
      : \"012A022FF\",\n              \"CA10G1__disappearanceTime__c\": null,\n  \
      \            \"CA10G1__filter__c\": \"LOG_ID(\\\"activity\\\") OR LOG_ID(\\\"\
      googleapis.com/activity\\\")\",\n              \"CA10G1__destination__c\": \"\
      logging.googleapis.com/projects\",\n              \"CA10G1__resourceManagerFolder__c\"\
      : \"aOAI22FF\",\n              \"RecordType\": {\n                \"DeveloperName\"\
      : \"caGoogleLoggingLogSinkFolder\",\n                \"Id\": \"012A022FF\"\n\
      \              }\n            }\n          ]\n        },\n        \"CA10G1__Google_Logging_Log_Sinks1__r\"\
      : []\n      }\n    ]\n  },\n\n\n\n  {\n    \"expectedResult\": {\n      \"status\"\
      : \"COMPLIANT\",\n      \"conditionIndex\": \"199\",\n      \"conditionText\"\
      : \"CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)\",\n      \"runtimeError\"\
      : null\n    },\n    \"context\": { \"snapshotTime\": \"2024-12-06T06:06:17Z\"\
      \ },\n    \"Id\": \"atKAI33\",\n    \"CA10__Google_Resource_Manager_Projects__r\"\
      : [\n      {\n        \"Id\": \"anDOAW33\",\n        \"CA10__disappearanceTime__c\"\
      : null,\n        \"CA10__googleProject__c\": \"atKAI33\",\n        \"CA10__resourceManagerOrganization__c\"\
      : \"aBAW33OO\",\n        \"CA10__resourceManagerFolder__c\": \"\",\n       \
      \ \"CA10__resourceManagerOrganization__r\": {\n          \"Id\": \"aBAW33OO\"\
      ,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\": [\n            {\n  \
      \            \"Id\": \"aKAQ33\",\n              \"RecordTypeId\": \"0A033OO\"\
      ,\n              \"CA10G1__disappearanceTime__c\": null,\n              \"CA10G1__filter__c\"\
      : \"\",\n              \"CA10G1__destination__c\": \"logging.googleapis.com/projects\"\
      ,\n              \"CA10G1__resourceManagerOrganization__c\": \"aBAW33OO\",\n\
      \              \"RecordType\": {\n                \"DeveloperName\": \"caGoogleLoggingLogSinkOrganization\"\
      ,\n                \"Id\": \"0A033OO\"\n              }\n            }\n   \
      \       ]\n        },\n        \"CA10__resourceManagerFolder__r\": {\n     \
      \     \"Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n\
      \        },\n        \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n      }\n\
      \    ]\n  },\n  {\n    \"expectedResult\": {\n      \"status\": \"INCOMPLIANT\"\
      ,\n      \"conditionIndex\": \"200\",\n      \"conditionText\": \"otherwise\"\
      ,\n      \"runtimeError\": null\n    },\n    \"context\": { \"snapshotTime\"\
      : \"2024-12-06T06:06:17Z\" },\n    \"Id\": \"aB1TKAY33\",\n    \"CA10__Google_Resource_Manager_Projects__r\"\
      : [\n      {\n        \"Id\": \"aB1OAI33\",\n        \"CA10__disappearanceTime__c\"\
      : null,\n        \"CA10__googleProject__c\": \"aB1TKAY33\",\n        \"CA10__resourceManagerOrganization__c\"\
      : \"aB1AI33OO\",\n        \"CA10__resourceManagerFolder__c\": \"\",\n      \
      \  \"CA10__resourceManagerOrganization__r\": {\n          \"Id\": \"aB1AI33OO\"\
      ,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\": [\n            {\n  \
      \            \"Id\": \"aR12KAI33\",\n              \"RecordTypeId\": \"0A033OO\"\
      ,\n              \"CA10G1__disappearanceTime__c\": null,\n              \"CA10G1__filter__c\"\
      : \"LOG_ID(\\\"activity\\\") OR LOG_ID(\\\"googleapis.com/activity\\\")\",\n\
      \              \"CA10G1__destination__c\": \"logging.googleapis.com/projects\"\
      ,\n              \"CA10G1__resourceManagerOrganization__c\": \"aB1AI33OO\",\n\
      \              \"RecordType\": {\n                \"DeveloperName\": \"caGoogleLoggingLogSinkOrganization\"\
      ,\n                \"Id\": \"0A033OO\"\n              }\n            }\n   \
      \       ]\n        },\n        \"CA10__resourceManagerFolder__r\": {\n     \
      \     \"Id\": null,\n          \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n\
      \        },\n        \"CA10G1__Google_Logging_Log_Sinks1__r\": []\n      }\n\
      \    ]\n  }\n\n]\n"
  - path: /types/CA10G1__CaGoogleLoggingLogSink__c/object.extracts.yaml
    md5Hash: 0A52360258DB3850B42C9067DA520816
    content: "---\nextracts:\n  - name: \"CA10G1__filter__c\"\n    value: \n     \
      \ FIELD:\n        path: \"CA10G1__filter__c\"\n  - name: \"CA10G1__destination__c\"\
      \n    value: \n      FIELD:\n        path: \"CA10G1__destination__c\""
script: |-
  CREATE TEMP FUNCTION mock_ExpectedResult()
  RETURNS ARRAY<STRUCT<
          Id STRING,
          expectedResult STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, runtimeError STRING>
      >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "Id" : "aKAI",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "aTKAY",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "aTKAY5",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "atKAI22",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "aAY22",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "atKAI33",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "aB1TKAY33",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleProject__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aKAI"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aTKAY"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aTKAY5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "atKAI22"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aAY22"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "atKAI33"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aB1TKAY33"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleResourceManagerProject__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__googleProject__c STRING,
      CA10__resourceManagerOrganization__c STRING,
      CA10__resourceManagerFolder__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aDOAW",
    "CA10__googleProject__c" : "aKAI",
    "CA10__resourceManagerOrganization__c" : "",
    "CA10__resourceManagerFolder__c" : ""
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aDtOAI",
    "CA10__googleProject__c" : "aTKAY",
    "CA10__resourceManagerOrganization__c" : "",
    "CA10__resourceManagerFolder__c" : ""
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aDtOAI5",
    "CA10__googleProject__c" : "aTKAY5",
    "CA10__resourceManagerOrganization__c" : "",
    "CA10__resourceManagerFolder__c" : ""
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aDOAW22",
    "CA10__googleProject__c" : "atKAI22",
    "CA10__resourceManagerOrganization__c" : "",
    "CA10__resourceManagerFolder__c" : "aDOAW22FF"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "atOAI22",
    "CA10__googleProject__c" : "aAY22",
    "CA10__resourceManagerOrganization__c" : "",
    "CA10__resourceManagerFolder__c" : "aOAI22FF"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "anDOAW33",
    "CA10__googleProject__c" : "atKAI33",
    "CA10__resourceManagerOrganization__c" : "aBAW33OO",
    "CA10__resourceManagerFolder__c" : ""
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aB1OAI33",
    "CA10__googleProject__c" : "aB1TKAY33",
    "CA10__resourceManagerOrganization__c" : "aB1AI33OO",
    "CA10__resourceManagerFolder__c" : ""
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleResourceManagerOrganization__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : null
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aBAW33OO"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aB1AI33OO"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10G1__CaGoogleLoggingLogSink__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      RecordTypeId STRING,
      CA10G1__disappearanceTime__c TIMESTAMP,
      CA10G1__filter__c STRING,
      CA10G1__destination__c STRING,
      CA10G1__resourceManagerOrganization__c STRING,
      CA10G1__resourceManagerFolder__c STRING,
      CA10G1__resourceManagerProject__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "a11Q",
    "RecordTypeId" : "012IA0",
    "CA10G1__filter__c" : "",
    "CA10G1__destination__c" : "logging.googleapis.com/projects",
    "CA10G1__resourceManagerProject__c" : "aDOAW"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "a12Q",
    "RecordTypeId" : "012IA0",
    "CA10G1__filter__c" : "LOG_ID(\"activity\") OR LOG_ID(\"googleapis.com/activity\")",
    "CA10G1__destination__c" : "logging.googleapis.com/projects",
    "CA10G1__resourceManagerProject__c" : "aDOAW"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "a1oKAI",
    "RecordTypeId" : "012IA0",
    "CA10G1__filter__c" : "LOG_ID(\"activity\") OR LOG_ID(\"googleapis.com/activity\")",
    "CA10G1__destination__c" : "logging.googleapis.com/projects",
    "CA10G1__resourceManagerProject__c" : "aDtOAI"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "a1oKAI5",
    "RecordTypeId" : "012IA0",
    "CA10G1__filter__c" : "",
    "CA10G1__destination__c" : "",
    "CA10G1__resourceManagerProject__c" : "aDtOAI5"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aRKAQ22",
    "RecordTypeId" : "012A022FF",
    "CA10G1__filter__c" : "",
    "CA10G1__destination__c" : "logging.googleapis.com/projects",
    "CA10G1__resourceManagerFolder__c" : "aDOAW22FF"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aR21HoKAI22",
    "RecordTypeId" : "012A022FF",
    "CA10G1__filter__c" : "LOG_ID(\"activity\") OR LOG_ID(\"googleapis.com/activity\")",
    "CA10G1__destination__c" : "logging.googleapis.com/projects",
    "CA10G1__resourceManagerFolder__c" : "aOAI22FF"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aKAQ33",
    "RecordTypeId" : "0A033OO",
    "CA10G1__filter__c" : "",
    "CA10G1__destination__c" : "logging.googleapis.com/projects",
    "CA10G1__resourceManagerOrganization__c" : "aBAW33OO"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aR12KAI33",
    "RecordTypeId" : "0A033OO",
    "CA10G1__filter__c" : "LOG_ID(\"activity\") OR LOG_ID(\"googleapis.com/activity\")",
    "CA10G1__destination__c" : "logging.googleapis.com/projects",
    "CA10G1__resourceManagerOrganization__c" : "aB1AI33OO"
  } ];
  """;

  CREATE TEMP FUNCTION mock_RecordType()
  RETURNS ARRAY<STRUCT<
      DeveloperName STRING,
      Id STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "DeveloperName" : "caGoogleLoggingLogSinkProject",
    "Id" : "012IA0"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "DeveloperName" : "caGoogleLoggingLogSinkFolder",
    "Id" : "012A022FF"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "DeveloperName" : "caGoogleLoggingLogSinkOrganization",
    "Id" : "0A033OO"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleResourceManagerFolder__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : null
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aDOAW22FF"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T06:06:17Z")
    },
    "Id" : "aOAI22FF"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaGoogleProject__c(
      obj STRUCT<
          Id STRING,
          CA10__Google_Resource_Manager_Projects__r ARRAY<STRUCT<
              Id STRING,
              CA10__disappearanceTime__c TIMESTAMP,
              CA10__googleProject__c STRING,
              CA10__resourceManagerOrganization__c STRING,
              CA10__resourceManagerFolder__c STRING,
              CA10__resourceManagerOrganization__r STRUCT<
                  Id STRING,
                  CA10G1__Google_Logging_Log_Sinks1__r ARRAY<STRUCT<
                      Id STRING,
                      RecordTypeId STRING,
                      CA10G1__disappearanceTime__c TIMESTAMP,
                      CA10G1__filter__c STRING,
                      CA10G1__destination__c STRING,
                      CA10G1__resourceManagerOrganization__c STRING,
                      RecordType STRUCT<
                          DeveloperName STRING,
                          Id STRING
                      >,
                      result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
                  >>
              >,
              CA10__resourceManagerFolder__r STRUCT<
                  Id STRING,
                  CA10G1__Google_Logging_Log_Sinks1__r ARRAY<STRUCT<
                      Id STRING,
                      RecordTypeId STRING,
                      CA10G1__disappearanceTime__c TIMESTAMP,
                      CA10G1__filter__c STRING,
                      CA10G1__destination__c STRING,
                      CA10G1__resourceManagerFolder__c STRING,
                      RecordType STRUCT<
                          DeveloperName STRING,
                          Id STRING
                      >,
                      result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
                  >>
              >,
              CA10G1__Google_Logging_Log_Sinks1__r ARRAY<STRUCT<
                  Id STRING,
                  RecordTypeId STRING,
                  CA10G1__disappearanceTime__c TIMESTAMP,
                  CA10G1__filter__c STRING,
                  CA10G1__destination__c STRING,
                  CA10G1__resourceManagerProject__c STRING,
                  RecordType STRUCT<
                      DeveloperName STRING,
                      Id STRING
                  >,
                  result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
              >>,
              result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
          >>
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      if (false) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared()", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10__Google_Resource_Manager_Projects__r_COMPLIANT2 = 0;
      if (obj.CA10__Google_Resource_Manager_Projects__r != null) {
          for (var i3 = 0; i3 < obj.CA10__Google_Resource_Manager_Projects__r.length; i3++) {
              if (obj.CA10__Google_Resource_Manager_Projects__r[i3].result.status == 'COMPLIANT') {
                  count_CA10__Google_Resource_Manager_Projects__r_COMPLIANT2 += 1;
              }
          }
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Related list [CA10__Google_Resource_Manager_Projects__r] ' + (count_CA10__Google_Resource_Manager_Projects__r_COMPLIANT2 > 0 ? 'has' : 'does not have') + ' objects in COMPLIANT status');
      if (count_CA10__Google_Resource_Manager_Projects__r_COMPLIANT2 > 0) {
          return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)", currentStateMessage: "Sinks are configured for all log entries", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "The project does not have sinks configured for all log entries.", currentStateReferences: references1.join('\n'), remediation: "It is recommended to create a sink that will export copies of all the log entries.", runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__resourceManagerFolder__r_CA10G1__Google_Logging_Log_Sinks1__r(
      obj STRUCT<
          Id STRING,
          RecordTypeId STRING,
          CA10G1__disappearanceTime__c TIMESTAMP,
          CA10G1__filter__c STRING,
          CA10G1__destination__c STRING,
          CA10G1__resourceManagerFolder__c STRING,
          RecordType STRUCT<
              DeveloperName STRING,
              Id STRING
          >
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var CollectionLib = new function () {
          this.parse = function(arg, separator) {
              let out = new Set();
              if (arg == null) {
                  return out;
              }
              arg.split(separator).forEach(el => {if (TextLib.isNotEmpty(el)) {out.add(TextLib.normalize(el))}});
              return out;
          };
          this.fromArray = function(arr) {
              let out = new Set();
              if (arr == null) {
                  return out;
              }
              arr.forEach(el => {if (TextLib.isNotEmpty(el)) {out.add(TextLib.normalize(el))}});
              return out;
          };
          this.equal = function(left, right) {
              left = left == null ? new Set() : left;
              right = right == null ? new Set() : right;
              return left.size === right.size && new Set([...left, ...right]).size === left.size;
          };
          this.notEqual = function(left, right) {
              left = left == null ? new Set() : left;
              right = right == null ? new Set() : right;
              return left.size !== right.size || new Set([...left, ...right]).size !== left.size;
          };
          this.contains = function(collection, search) {
              if (collection == null || TextLib.isEmpty(search)) {
                  return false;
              }
              return collection.has(TextLib.normalize(search));
          };
          this.size = function(collection) {
              return collection == null ? 0 : collection.size;
          };
      }();
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From Google [CA10G1__disappearanceTime__c]: ' + obj.CA10G1__disappearanceTime__c);
      if (obj.CA10G1__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10G1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Record Type Name [obj.RecordType.DeveloperName]: ' + obj.RecordType.DeveloperName);
      if (!CollectionLib.contains(CollectionLib.fromArray(['caGoogleLoggingLogSinkFolder']), obj.RecordType.DeveloperName)) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "not(['caGoogleLoggingLogSinkFolder'].contains(RecordType.DeveloperName))", currentStateMessage: "Object record type is not applicable", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      function extract4() { if (!this.out) { this.out = obj.CA10G1__filter__c; } return this.out; };
      function extract7() { if (!this.out) { this.out = obj.CA10G1__destination__c; } return this.out; };
      references1.push('Filter [obj.CA10G1__filter__c]: ' + obj.CA10G1__filter__c);
      references1.push('Destination [obj.CA10G1__destination__c]: ' + obj.CA10G1__destination__c);
      if (TextLib.isEmpty(extract4.call(extract4)) && TextLib.isNotEmpty(extract7.call(extract7))) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "extract('CA10G1__filter__c').isEmpty() && extract('CA10G1__destination__c').isNotEmpty()", currentStateMessage: "Resource Manager Folder with COMPLIANT Sink.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "Resource Manager Folder does not have sinks configured for all log entries.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__Google_Resource_Manager_Projects__r(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__googleProject__c STRING,
          CA10__resourceManagerOrganization__c STRING,
          CA10__resourceManagerFolder__c STRING,
          CA10__resourceManagerOrganization__r STRUCT<
              Id STRING,
              CA10G1__Google_Logging_Log_Sinks1__r ARRAY<STRUCT<
                  Id STRING,
                  RecordTypeId STRING,
                  CA10G1__disappearanceTime__c TIMESTAMP,
                  CA10G1__filter__c STRING,
                  CA10G1__destination__c STRING,
                  CA10G1__resourceManagerOrganization__c STRING,
                  RecordType STRUCT<
                      DeveloperName STRING,
                      Id STRING
                  >,
                  result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
              >>
          >,
          CA10__resourceManagerFolder__r STRUCT<
              Id STRING,
              CA10G1__Google_Logging_Log_Sinks1__r ARRAY<STRUCT<
                  Id STRING,
                  RecordTypeId STRING,
                  CA10G1__disappearanceTime__c TIMESTAMP,
                  CA10G1__filter__c STRING,
                  CA10G1__destination__c STRING,
                  CA10G1__resourceManagerFolder__c STRING,
                  RecordType STRUCT<
                      DeveloperName STRING,
                      Id STRING
                  >,
                  result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
              >>
          >,
          CA10G1__Google_Logging_Log_Sinks1__r ARRAY<STRUCT<
              Id STRING,
              RecordTypeId STRING,
              CA10G1__disappearanceTime__c TIMESTAMP,
              CA10G1__filter__c STRING,
              CA10G1__destination__c STRING,
              CA10G1__resourceManagerProject__c STRING,
              RecordType STRUCT<
                  DeveloperName STRING,
                  Id STRING
              >,
              result STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
          >>
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From Google [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c);
      if (obj.CA10__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10__resourceManagerFolder__r_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT3 = 0;
      if (obj.CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r != null) {
          for (var i5 = 0; i5 < obj.CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r.length; i5++) {
              if (obj.CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r[i5].result.status == 'COMPLIANT') {
                  count_CA10__resourceManagerFolder__r_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT3 += 1;
              }
          }
      }
      var count_CA10__resourceManagerOrganization__r_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT4 = 0;
      if (obj.CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r != null) {
          for (var i6 = 0; i6 < obj.CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r.length; i6++) {
              if (obj.CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r[i6].result.status == 'COMPLIANT') {
                  count_CA10__resourceManagerOrganization__r_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT4 += 1;
              }
          }
      }
      var count_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT2 = 0;
      if (obj.CA10G1__Google_Logging_Log_Sinks1__r != null) {
          for (var i7 = 0; i7 < obj.CA10G1__Google_Logging_Log_Sinks1__r.length; i7++) {
              if (obj.CA10G1__Google_Logging_Log_Sinks1__r[i7].result.status == 'COMPLIANT') {
                  count_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT2 += 1;
              }
          }
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Related list [CA10G1__Google_Logging_Log_Sinks1__r] ' + (count_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT2 > 0 ? 'has' : 'does not have') + ' objects in COMPLIANT status');
      references1.push('Related list [CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r] ' + (count_CA10__resourceManagerFolder__r_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT3 > 0 ? 'has' : 'does not have') + ' objects in COMPLIANT status');
      references1.push('Related list [CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r] ' + (count_CA10__resourceManagerOrganization__r_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT4 > 0 ? 'has' : 'does not have') + ' objects in COMPLIANT status');
      if (count_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT2 > 0 || count_CA10__resourceManagerFolder__r_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT3 > 0 || count_CA10__resourceManagerOrganization__r_CA10G1__Google_Logging_Log_Sinks1__r_COMPLIANT4 > 0) {
          return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "CA10G1__Google_Logging_Log_Sinks1__r.has(COMPLIANT) || CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r.has(COMPLIANT) || CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r.has(COMPLIANT)", currentStateMessage: "Resource Manager Organization or Folder or Project with COMPLIANT Sink.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "There is no COMPLIANT sink connected with project.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__resourceManagerOrganization__r_CA10G1__Google_Logging_Log_Sinks1__r(
      obj STRUCT<
          Id STRING,
          RecordTypeId STRING,
          CA10G1__disappearanceTime__c TIMESTAMP,
          CA10G1__filter__c STRING,
          CA10G1__destination__c STRING,
          CA10G1__resourceManagerOrganization__c STRING,
          RecordType STRUCT<
              DeveloperName STRING,
              Id STRING
          >
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var CollectionLib = new function () {
          this.parse = function(arg, separator) {
              let out = new Set();
              if (arg == null) {
                  return out;
              }
              arg.split(separator).forEach(el => {if (TextLib.isNotEmpty(el)) {out.add(TextLib.normalize(el))}});
              return out;
          };
          this.fromArray = function(arr) {
              let out = new Set();
              if (arr == null) {
                  return out;
              }
              arr.forEach(el => {if (TextLib.isNotEmpty(el)) {out.add(TextLib.normalize(el))}});
              return out;
          };
          this.equal = function(left, right) {
              left = left == null ? new Set() : left;
              right = right == null ? new Set() : right;
              return left.size === right.size && new Set([...left, ...right]).size === left.size;
          };
          this.notEqual = function(left, right) {
              left = left == null ? new Set() : left;
              right = right == null ? new Set() : right;
              return left.size !== right.size || new Set([...left, ...right]).size !== left.size;
          };
          this.contains = function(collection, search) {
              if (collection == null || TextLib.isEmpty(search)) {
                  return false;
              }
              return collection.has(TextLib.normalize(search));
          };
          this.size = function(collection) {
              return collection == null ? 0 : collection.size;
          };
      }();
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From Google [CA10G1__disappearanceTime__c]: ' + obj.CA10G1__disappearanceTime__c);
      if (obj.CA10G1__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10G1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Record Type Name [obj.RecordType.DeveloperName]: ' + obj.RecordType.DeveloperName);
      if (!CollectionLib.contains(CollectionLib.fromArray(['caGoogleLoggingLogSinkOrganization']), obj.RecordType.DeveloperName)) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "not(['caGoogleLoggingLogSinkOrganization'].contains(RecordType.DeveloperName))", currentStateMessage: "Object record type is not applicable", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      function extract4() { if (!this.out) { this.out = obj.CA10G1__filter__c; } return this.out; };
      function extract7() { if (!this.out) { this.out = obj.CA10G1__destination__c; } return this.out; };
      references1.push('Filter [obj.CA10G1__filter__c]: ' + obj.CA10G1__filter__c);
      references1.push('Destination [obj.CA10G1__destination__c]: ' + obj.CA10G1__destination__c);
      if (TextLib.isEmpty(extract4.call(extract4)) && TextLib.isNotEmpty(extract7.call(extract7))) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "extract('CA10G1__filter__c').isEmpty() && extract('CA10G1__destination__c').isNotEmpty()", currentStateMessage: "Resource Manager Organization with COMPLIANT Sink", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "Resource Manager Organization does not have sinks configured for all log entries.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10G1__Google_Logging_Log_Sinks1__r(
      obj STRUCT<
          Id STRING,
          RecordTypeId STRING,
          CA10G1__disappearanceTime__c TIMESTAMP,
          CA10G1__filter__c STRING,
          CA10G1__destination__c STRING,
          CA10G1__resourceManagerProject__c STRING,
          RecordType STRUCT<
              DeveloperName STRING,
              Id STRING
          >
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var CollectionLib = new function () {
          this.parse = function(arg, separator) {
              let out = new Set();
              if (arg == null) {
                  return out;
              }
              arg.split(separator).forEach(el => {if (TextLib.isNotEmpty(el)) {out.add(TextLib.normalize(el))}});
              return out;
          };
          this.fromArray = function(arr) {
              let out = new Set();
              if (arr == null) {
                  return out;
              }
              arr.forEach(el => {if (TextLib.isNotEmpty(el)) {out.add(TextLib.normalize(el))}});
              return out;
          };
          this.equal = function(left, right) {
              left = left == null ? new Set() : left;
              right = right == null ? new Set() : right;
              return left.size === right.size && new Set([...left, ...right]).size === left.size;
          };
          this.notEqual = function(left, right) {
              left = left == null ? new Set() : left;
              right = right == null ? new Set() : right;
              return left.size !== right.size || new Set([...left, ...right]).size !== left.size;
          };
          this.contains = function(collection, search) {
              if (collection == null || TextLib.isEmpty(search)) {
                  return false;
              }
              return collection.has(TextLib.normalize(search));
          };
          this.size = function(collection) {
              return collection == null ? 0 : collection.size;
          };
      }();
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From Google [CA10G1__disappearanceTime__c]: ' + obj.CA10G1__disappearanceTime__c);
      if (obj.CA10G1__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10G1__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Record Type Name [obj.RecordType.DeveloperName]: ' + obj.RecordType.DeveloperName);
      if (!CollectionLib.contains(CollectionLib.fromArray(['caGoogleLoggingLogSinkProject']), obj.RecordType.DeveloperName)) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "not(['caGoogleLoggingLogSinkProject'].contains(RecordType.DeveloperName))", currentStateMessage: "Object record type is not applicable", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      function extract4() { if (!this.out) { this.out = obj.CA10G1__filter__c; } return this.out; };
      function extract7() { if (!this.out) { this.out = obj.CA10G1__destination__c; } return this.out; };
      references1.push('Filter [obj.CA10G1__filter__c]: ' + obj.CA10G1__filter__c);
      references1.push('Destination [obj.CA10G1__destination__c]: ' + obj.CA10G1__destination__c);
      if (TextLib.isEmpty(extract4.call(extract4)) && TextLib.isNotEmpty(extract7.call(extract7))) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "extract('CA10G1__filter__c').isEmpty() && extract('CA10G1__destination__c').isNotEmpty()", currentStateMessage: "Resource Manager Project with COMPLIANT Sink.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "Resource Manager Project does not have sinks configured for all log entries.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;


  SELECT
    expectedResult.Id as Id,
    IF (
      IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '')
      AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1)
      AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '')
      AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''),
      "MATCH",
      "FAIL"
    ) as match,
    expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus,
    expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex,
    expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText,
    expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError
  FROM UNNEST(mock_ExpectedResult()) expectedResult
  LEFT JOIN (
      SELECT
          sObject.Id AS Id,
          `CA10__Google_Resource_Manager_Projects__r`.arr AS CA10__Google_Resource_Manager_Projects__r,
          process_CA10__CaGoogleProject__c(
              STRUCT(
                  sObject.Id AS Id,
                  `CA10__Google_Resource_Manager_Projects__r`.arr AS CA10__Google_Resource_Manager_Projects__r
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaGoogleProject__c()) AS sObject
      LEFT JOIN (
          SELECT
              sObject.CA10__googleProject__c,
              ARRAY_AGG(
                  STRUCT(
                      sObject.Id AS Id,
                      sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                      sObject.CA10__googleProject__c AS CA10__googleProject__c,
                      sObject.CA10__resourceManagerOrganization__c AS CA10__resourceManagerOrganization__c,
                      sObject.CA10__resourceManagerFolder__c AS CA10__resourceManagerFolder__c,
                      STRUCT (
                          `CA10__resourceManagerOrganization__r`.Id AS Id,
                          `CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r`.arr AS CA10G1__Google_Logging_Log_Sinks1__r
                      ) AS CA10__resourceManagerOrganization__r,
                      STRUCT (
                          `CA10__resourceManagerFolder__r`.Id AS Id,
                          `CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r`.arr AS CA10G1__Google_Logging_Log_Sinks1__r
                      ) AS CA10__resourceManagerFolder__r,
                      `CA10G1__Google_Logging_Log_Sinks1__r`.arr AS CA10G1__Google_Logging_Log_Sinks1__r,
                      process_CA10__Google_Resource_Manager_Projects__r(
                          STRUCT(
                              sObject.Id AS Id,
                              sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                              sObject.CA10__googleProject__c AS CA10__googleProject__c,
                              sObject.CA10__resourceManagerOrganization__c AS CA10__resourceManagerOrganization__c,
                              sObject.CA10__resourceManagerFolder__c AS CA10__resourceManagerFolder__c,
                              STRUCT (
                                  `CA10__resourceManagerOrganization__r`.Id AS Id,
                                  `CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r`.arr AS CA10G1__Google_Logging_Log_Sinks1__r
                              ) AS CA10__resourceManagerOrganization__r,
                              STRUCT (
                                  `CA10__resourceManagerFolder__r`.Id AS Id,
                                  `CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r`.arr AS CA10G1__Google_Logging_Log_Sinks1__r
                              ) AS CA10__resourceManagerFolder__r,
                              `CA10G1__Google_Logging_Log_Sinks1__r`.arr AS CA10G1__Google_Logging_Log_Sinks1__r
                          ),
                          sObject.context.snapshotTime
                      ) as result
                  )
              ) AS arr
          FROM UNNEST(mock_CA10__CaGoogleResourceManagerProject__c()) AS sObject
          LEFT JOIN UNNEST(mock_CA10__CaGoogleResourceManagerOrganization__c()) AS `CA10__resourceManagerOrganization__r`
              ON sObject.CA10__resourceManagerOrganization__c = `CA10__resourceManagerOrganization__r`.Id
          LEFT JOIN UNNEST(mock_CA10__CaGoogleResourceManagerFolder__c()) AS `CA10__resourceManagerFolder__r`
              ON sObject.CA10__resourceManagerFolder__c = `CA10__resourceManagerFolder__r`.Id
          LEFT JOIN (
              SELECT
                  sObject.CA10G1__resourceManagerOrganization__c,
                  ARRAY_AGG(
                      STRUCT(
                          sObject.Id AS Id,
                          sObject.RecordTypeId AS RecordTypeId,
                          sObject.CA10G1__disappearanceTime__c AS CA10G1__disappearanceTime__c,
                          sObject.CA10G1__filter__c AS CA10G1__filter__c,
                          sObject.CA10G1__destination__c AS CA10G1__destination__c,
                          sObject.CA10G1__resourceManagerOrganization__c AS CA10G1__resourceManagerOrganization__c,
                          STRUCT (
                              `RecordType`.DeveloperName AS DeveloperName,
                              `RecordType`.Id AS Id
                          ) AS RecordType,
                          process_CA10__resourceManagerOrganization__r_CA10G1__Google_Logging_Log_Sinks1__r(
                              STRUCT(
                                  sObject.Id AS Id,
                                  sObject.RecordTypeId AS RecordTypeId,
                                  sObject.CA10G1__disappearanceTime__c AS CA10G1__disappearanceTime__c,
                                  sObject.CA10G1__filter__c AS CA10G1__filter__c,
                                  sObject.CA10G1__destination__c AS CA10G1__destination__c,
                                  sObject.CA10G1__resourceManagerOrganization__c AS CA10G1__resourceManagerOrganization__c,
                                  STRUCT (
                                      `RecordType`.DeveloperName AS DeveloperName,
                                      `RecordType`.Id AS Id
                                  ) AS RecordType
                              ),
                              sObject.context.snapshotTime
                          ) as result
                      )
                  ) AS arr
              FROM UNNEST(mock_CA10G1__CaGoogleLoggingLogSink__c()) AS sObject
              LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                  ON sObject.RecordTypeId = `RecordType`.Id
              GROUP BY sObject.CA10G1__resourceManagerOrganization__c
          ) AS `CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r`
              ON `CA10__resourceManagerOrganization__r`.Id = `CA10__resourceManagerOrganization__r.CA10G1__Google_Logging_Log_Sinks1__r`.CA10G1__resourceManagerOrganization__c
          LEFT JOIN (
              SELECT
                  sObject.CA10G1__resourceManagerFolder__c,
                  ARRAY_AGG(
                      STRUCT(
                          sObject.Id AS Id,
                          sObject.RecordTypeId AS RecordTypeId,
                          sObject.CA10G1__disappearanceTime__c AS CA10G1__disappearanceTime__c,
                          sObject.CA10G1__filter__c AS CA10G1__filter__c,
                          sObject.CA10G1__destination__c AS CA10G1__destination__c,
                          sObject.CA10G1__resourceManagerFolder__c AS CA10G1__resourceManagerFolder__c,
                          STRUCT (
                              `RecordType`.DeveloperName AS DeveloperName,
                              `RecordType`.Id AS Id
                          ) AS RecordType,
                          process_CA10__resourceManagerFolder__r_CA10G1__Google_Logging_Log_Sinks1__r(
                              STRUCT(
                                  sObject.Id AS Id,
                                  sObject.RecordTypeId AS RecordTypeId,
                                  sObject.CA10G1__disappearanceTime__c AS CA10G1__disappearanceTime__c,
                                  sObject.CA10G1__filter__c AS CA10G1__filter__c,
                                  sObject.CA10G1__destination__c AS CA10G1__destination__c,
                                  sObject.CA10G1__resourceManagerFolder__c AS CA10G1__resourceManagerFolder__c,
                                  STRUCT (
                                      `RecordType`.DeveloperName AS DeveloperName,
                                      `RecordType`.Id AS Id
                                  ) AS RecordType
                              ),
                              sObject.context.snapshotTime
                          ) as result
                      )
                  ) AS arr
              FROM UNNEST(mock_CA10G1__CaGoogleLoggingLogSink__c()) AS sObject
              LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                  ON sObject.RecordTypeId = `RecordType`.Id
              GROUP BY sObject.CA10G1__resourceManagerFolder__c
          ) AS `CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r`
              ON `CA10__resourceManagerFolder__r`.Id = `CA10__resourceManagerFolder__r.CA10G1__Google_Logging_Log_Sinks1__r`.CA10G1__resourceManagerFolder__c
          LEFT JOIN (
              SELECT
                  sObject.CA10G1__resourceManagerProject__c,
                  ARRAY_AGG(
                      STRUCT(
                          sObject.Id AS Id,
                          sObject.RecordTypeId AS RecordTypeId,
                          sObject.CA10G1__disappearanceTime__c AS CA10G1__disappearanceTime__c,
                          sObject.CA10G1__filter__c AS CA10G1__filter__c,
                          sObject.CA10G1__destination__c AS CA10G1__destination__c,
                          sObject.CA10G1__resourceManagerProject__c AS CA10G1__resourceManagerProject__c,
                          STRUCT (
                              `RecordType`.DeveloperName AS DeveloperName,
                              `RecordType`.Id AS Id
                          ) AS RecordType,
                          process_CA10G1__Google_Logging_Log_Sinks1__r(
                              STRUCT(
                                  sObject.Id AS Id,
                                  sObject.RecordTypeId AS RecordTypeId,
                                  sObject.CA10G1__disappearanceTime__c AS CA10G1__disappearanceTime__c,
                                  sObject.CA10G1__filter__c AS CA10G1__filter__c,
                                  sObject.CA10G1__destination__c AS CA10G1__destination__c,
                                  sObject.CA10G1__resourceManagerProject__c AS CA10G1__resourceManagerProject__c,
                                  STRUCT (
                                      `RecordType`.DeveloperName AS DeveloperName,
                                      `RecordType`.Id AS Id
                                  ) AS RecordType
                              ),
                              sObject.context.snapshotTime
                          ) as result
                      )
                  ) AS arr
              FROM UNNEST(mock_CA10G1__CaGoogleLoggingLogSink__c()) AS sObject
              LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                  ON sObject.RecordTypeId = `RecordType`.Id
              GROUP BY sObject.CA10G1__resourceManagerProject__c
          ) AS `CA10G1__Google_Logging_Log_Sinks1__r`
              ON sObject.Id = `CA10G1__Google_Logging_Log_Sinks1__r`.CA10G1__resourceManagerProject__c
          GROUP BY sObject.CA10__googleProject__c
      ) AS `CA10__Google_Resource_Manager_Projects__r`
          ON sObject.Id = `CA10__Google_Resource_Manager_Projects__r`.CA10__googleProject__c
  ) sObject ON sObject.Id = expectedResult.Id;
