---
policy: /ce/ca/google/logging/audit-logging-configuration
logic: /ce/ca/google/logging/audit-logging-configuration/prod.logic.yaml
executionTime: 2025-04-24T23:47:07.461289223Z
rows:
  - id: a4p1
    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: a4p2
    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: a4p3
    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: a4p3IN
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: a4p3IN2
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: a4p3IN3
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: a4p3IN4
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
usedFiles:
  - path: /ce/ca/google/logging/audit-logging-configuration/policy.yaml
    md5Hash: E55CD7A05B0A5527B600AD75893A83B9
    content: "---\nnames: \n  full: \"Google Cloud Audit Logging is not configured\
      \ properly\"\n  contextual: \"Cloud Audit Logging is not configured properly\"\
      \ndescription: \"It is recommended that Cloud Audit Logging is configured to\
      \ track all admin activities and read, write access to user data.\"\ntype: COMPLIANCE_POLICY\n\
      categories:\n  - \"SECURITY\"\nframeworkMappings:\n  - /frameworks/cis-gcp-v3.0.0/02/01\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/CloudIAM/record-all-activities.html\"\
      \n      name: \"Configure Google Cloud Audit Logs to Track All Activities\"\n"
  - path: /ce/ca/google/logging/audit-logging-configuration/prod.logic.yaml
    md5Hash: 764353DED76D44977BC681241C2EC41A
    content: "---\n\ninputType: \"CA10__CaGoogleProject__c\"\ntestData:\n  - file:\
      \ test-data.json\nimportExtracts:\n  - file: /types/CA10__CaGoogleProject__c/object.extracts.yaml\n\
      conditions:\n  - status: \"COMPLIANT\"\n    currentStateMessage: \"Cloud Audit\
      \ Logging is configured to track all admin activities and read, write access\
      \ to user data.\"\n    check:\n      RELATED_LIST_HAS:\n        status: \"COMPLIANT\"\
      \n        relationshipName: \"CA10__Google_Resource_Manager_Projects__r\"\n\
      otherwise:\n  status: \"INCOMPLIANT\"\n  currentStateMessage: \"Cloud Audit\
      \ Logging is not configured to track all admin activities and read, write access\
      \ to user data.\"\n  remediationMessage: \"Configure Cloud Audit Logging to\
      \ track all admin activities and read, write access to user data.\"\nrelatedLists:\n\
      \  - relationshipName: \"CA10__Google_Resource_Manager_Projects__r\"\n    importExtracts:\n\
      \      - file: /types/CA10__CaGoogleIamPolicyAuditConfig__c/object.extracts.yaml\n\
      \      - file: /types/CA10__CaGoogleIamPolicyAuditLogConfig__c/object.extracts.yaml\n\
      \    conditions:\n      - status: \"COMPLIANT\"\n        currentStateMessage:\
      \ \"Cloud Audit Logging is configured to track all admin activities and read,\
      \ write access to user data.\"\n        check:\n          OR:\n            args:\n\
      \              - RELATED_LIST_HAS:\n                  status: \"COMPLIANT\"\n\
      \                  relationshipName: \"CA10__Google_IAM_Policy_Audit_Configs__r\"\
      \n              - RELATED_LIST_HAS:\n                  status: \"COMPLIANT\"\
      \n                  relationshipName: \"CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r\"\
      \n              - RELATED_LIST_HAS:\n                  status: \"COMPLIANT\"\
      \n                  relationshipName: \"CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r\"\
      \n    otherwise:\n      status: \"INCOMPLIANT\"\n      currentStateMessage:\
      \ \"Resource Manager Project is not configured to track all admin activities\
      \ and read, write access to user data.\"\n    relatedLists:\n    # PROJECT level\n\
      \      - relationshipName: \"CA10__Google_IAM_Policy_Audit_Configs__r\"\n  \
      \      recordTypes:\n        - \"caGoogleIamPolicyAuditConfigProject\"\n   \
      \     conditions:\n          - status: \"COMPLIANT\"\n            currentStateMessage:\
      \ \"Project Audit Config is configured to track all admin activities and read,\
      \ write access to user data.\" \n            check:\n              AND:\n  \
      \              args:\n                  - IS_EQUAL:\n                      left:\n\
      \                        RELATED_LIST_COUNT:\n                          status:\
      \ \"COMPLIANT\"\n                          relationshipName: \"CA10__Google_IAM_Policy_Audit_Log_Config1__r\"\
      \n                      right:\n                        NUMBER: 2.0\n      \
      \            - IS_EMPTY:\n                      arg:\n                     \
      \   EXTRACT: \"CA10__exemptedMembers__c\" # Audit_Configs\n                \
      \  - IS_EQUAL:\n                      left:\n                        EXTRACT:\
      \ \"CA10__service__c\"\n                      right:\n                     \
      \   TEXT: \"allServices\"\n        otherwise:\n          status: \"INCOMPLIANT\"\
      \n          currentStateMessage: \"Project Audit Config is not configured to\
      \ track all admin activities and read, write access to user data.\"\n      \
      \  relatedLists:\n          - relationshipName: \"CA10__Google_IAM_Policy_Audit_Log_Config1__r\"\
      \n            conditions:\n              - status: \"COMPLIANT\"\n         \
      \       currentStateMessage: \"COMPLIANT Audit Log Configs\"\n             \
      \   check:\n                 AND:\n                   args:\n              \
      \      - OR:\n                       args:\n                        - IS_EQUAL:\n\
      \                            left:\n                              EXTRACT: \"\
      CA10__logType__c\"\n                            right:\n                   \
      \           TEXT: \"DATA_WRITE\"\n                        - IS_EQUAL:\n    \
      \                        left:\n                              EXTRACT: \"CA10__logType__c\"\
      \n                            right: \n                              TEXT: \"\
      DATA_READ\"\n                    - IS_EMPTY:\n                        arg:\n\
      \                          EXTRACT: \"CA10__exemptedMembers__c\" # Audit_Log_Config\n\
      \            otherwise:\n              status: \"INCOMPLIANT\"\n           \
      \   currentStateMessage: \"INCOMPLIANT Audit Log Configs\"\n# FOLDER level\n\
      \      - relationshipName: \"CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r\"\
      \n        recordTypes:\n        - \"caGoogleIamPolicyAuditConfigFolder\"\n \
      \       conditions:\n          - status: \"COMPLIANT\"\n            currentStateMessage:\
      \ \"Folder Audit Config is configured to track all admin activities and read,\
      \ write access to user data.\" \n            check:\n              AND:\n  \
      \              args:\n                  - IS_EQUAL:\n                      left:\n\
      \                        RELATED_LIST_COUNT:\n                          status:\
      \ \"COMPLIANT\"\n                          relationshipName: \"CA10__Google_IAM_Policy_Audit_Log_Config1__r\"\
      \n                      right:\n                        NUMBER: 2.0\n      \
      \            - IS_EMPTY:\n                      arg:\n                     \
      \   EXTRACT: \"CA10__exemptedMembers__c\" # Audit_Configs\n                \
      \  - IS_EQUAL:\n                      left:\n                        EXTRACT:\
      \ \"CA10__service__c\"\n                      right:\n                     \
      \   TEXT: \"allServices\"\n        otherwise:\n          status: \"INCOMPLIANT\"\
      \n          currentStateMessage: \"Folder Audit Config is not configured to\
      \ track all admin activities and read, write access to user data.\"\n      \
      \  relatedLists:\n          - relationshipName: \"CA10__Google_IAM_Policy_Audit_Log_Config1__r\"\
      \n            conditions:\n              - status: \"COMPLIANT\"\n         \
      \       currentStateMessage: \"COMPLIANT Audit Log Configs\"\n             \
      \   check:\n                 AND:\n                   args:\n              \
      \      - OR:\n                       args:\n                        - IS_EQUAL:\n\
      \                            left:\n                              EXTRACT: \"\
      CA10__logType__c\"\n                            right:\n                   \
      \           TEXT: \"DATA_WRITE\"\n                        - IS_EQUAL:\n    \
      \                        left:\n                              EXTRACT: \"CA10__logType__c\"\
      \n                            right: \n                              TEXT: \"\
      DATA_READ\"\n                    - IS_EMPTY:\n                        arg:\n\
      \                          EXTRACT: \"CA10__exemptedMembers__c\" # Audit_Log_Config\n\
      \            otherwise:\n              status: \"INCOMPLIANT\"\n           \
      \   currentStateMessage: \"INCOMPLIANT Audit Log Configs\"\n# ORG level\n  \
      \    - relationshipName: \"CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r\"\
      \n        recordTypes:\n        - \"caGoogleIamPolicyAuditConfigOrganization\"\
      \n        conditions:\n          - status: \"COMPLIANT\"\n            currentStateMessage:\
      \ \"Organization Audit Config is configured to track all admin activities and\
      \ read, write access to user data.\" \n            check:\n              AND:\n\
      \                args:\n                  - IS_EQUAL:\n                    \
      \  left:\n                        RELATED_LIST_COUNT:\n                    \
      \      status: \"COMPLIANT\"\n                          relationshipName: \"\
      CA10__Google_IAM_Policy_Audit_Log_Config1__r\"\n                      right:\n\
      \                        NUMBER: 2.0\n                  - IS_EMPTY:\n      \
      \                arg:\n                        EXTRACT: \"CA10__exemptedMembers__c\"\
      \ # Audit_Configs\n                  - IS_EQUAL:\n                      left:\n\
      \                        EXTRACT: \"CA10__service__c\"\n                   \
      \   right:\n                        TEXT: \"allServices\"\n        otherwise:\n\
      \          status: \"INCOMPLIANT\"\n          currentStateMessage: \"Organization\
      \ Audit Config is not configured to track all admin activities and read, write\
      \ access to user data.\"\n        relatedLists:\n          - relationshipName:\
      \ \"CA10__Google_IAM_Policy_Audit_Log_Config1__r\"\n            conditions:\n\
      \              - status: \"COMPLIANT\"\n                currentStateMessage:\
      \ \"COMPLIANT Audit Log Configs\"\n                check:\n                \
      \ AND:\n                   args:\n                    - OR:\n              \
      \         args:\n                        - IS_EQUAL:\n                     \
      \       left:\n                              EXTRACT: \"CA10__logType__c\"\n\
      \                            right:\n                              TEXT: \"\
      DATA_WRITE\"\n                        - IS_EQUAL:\n                        \
      \    left:\n                              EXTRACT: \"CA10__logType__c\"\n  \
      \                          right: \n                              TEXT: \"DATA_READ\"\
      \n                    - IS_EMPTY:\n                        arg:\n          \
      \                EXTRACT: \"CA10__exemptedMembers__c\" # Audit_Log_Config\n\
      \            otherwise:\n              status: \"INCOMPLIANT\"\n           \
      \   currentStateMessage: \"INCOMPLIANT Audit Log Configs\""
  - path: /ce/ca/google/logging/audit-logging-configuration/test-data.json
    md5Hash: 30885C3FD59875830B95D5779DDAD77C
    content: |
      [
        {
          "expectedResult": {
            "status": "COMPLIANT",
            "conditionIndex": "199",
            "conditionText": "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-12-06T03:25:14Z" },
          "Id": "a4p1",
          "CA10__Google_Resource_Manager_Projects__r": [
            {
              "Id": "1111",
              "CA10__disappearanceTime__c": null,
              "CA10__googleProject__c": "a4p1",
              "CA10__resourceManagerFolder__c": "aAFF111",
              "CA10__resourceManagerOrganization__c": "aAOO111",
              "CA10__resourceManagerFolder__r": {
                "Id": "aAFF111",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__resourceManagerOrganization__r": {
                "Id": "aAOO111",
                "CA10__Google_IAM_Policy_Audit_Configs__r": [
                  {
                    "Id": "a9C111",
                    "RecordTypeId": "0124ORG",
                    "CA10__disappearanceTime__c": null,
                    "CA10__exemptedMembers__c": "",
                    "CA10__service__c": "allServices",
                    "CA10__resourceManagerOrganization__c": "aAOO111",
                    "RecordType": {
                      "DeveloperName": "caGoogleIamPolicyAuditConfigOrganization",
                      "Id": "0124ORG"
                    },
                    "CA10__Google_IAM_Policy_Audit_Log_Config1__r": [
                      {
                        "Id": "a9xDIAK111",
                        "RecordTypeId": "0124ORG",
                        "CA10__disappearanceTime__c": null,
                        "CA10__logType__c": "DATA_WRITE",
                        "CA10__exemptedMembers__c": "",
                        "CA10__iamPolicyAuditConfig__c": "a9C111",
                        "RecordType": {
                          "DeveloperName": "caGoogleIamPolicyAuditConfigOrganization",
                          "Id": "0124ORG"
                        }
                      },
                      {
                        "Id": "a9EjIAK111",
                        "RecordTypeId": "0124ORG",
                        "CA10__disappearanceTime__c": null,
                        "CA10__logType__c": "DATA_READ",
                        "CA10__exemptedMembers__c": "",
                        "CA10__iamPolicyAuditConfig__c": "a9C111",
                        "RecordType": {
                          "DeveloperName": "caGoogleIamPolicyAuditConfigOrganization",
                          "Id": "0124ORG"
                        }
                      }
                    ]
                  }
                ]
              },
              "CA10__Google_IAM_Policy_Audit_Configs__r": []
            }
          ]
        },
        {
          "expectedResult": {
            "status": "COMPLIANT",
            "conditionIndex": "199",
            "conditionText": "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-12-06T03:25:14Z" },
          "Id": "a4p2",
          "CA10__Google_Resource_Manager_Projects__r": [
            {
              "Id": "2222",
              "CA10__disappearanceTime__c": null,
              "CA10__googleProject__c": "a4p2",
              "CA10__resourceManagerFolder__c": "aAFF222",
              "CA10__resourceManagerOrganization__c": "aAOO222",
              "CA10__resourceManagerFolder__r": {
                "Id": "aAFF222",
                "CA10__Google_IAM_Policy_Audit_Configs__r": [
                  {
                      "Id": "a9C222",
                      "RecordTypeId": "0124FOLDER",
                      "CA10__disappearanceTime__c": null,
                      "CA10__exemptedMembers__c": "",
                      "CA10__service__c": "allServices",
                      "CA10__resourceManagerFolder__c": "aAFF222",
                      "RecordType": {
                        "DeveloperName": "caGoogleIamPolicyAuditConfigFolder",
                        "Id": "0124FOLDER"
                      },
                      "CA10__Google_IAM_Policy_Audit_Log_Config1__r": [
                        {
                          "Id": "a9xDIAK222",
                          "RecordTypeId": "0124FOLDER",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_WRITE",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C222",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigFolder",
                            "Id": "0124FOLDER"
                          }
                        },
                        {
                          "Id": "a9EjIAK222",
                          "RecordTypeId": "0124FOLDER",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_READ",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C222",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigFolder",
                            "Id": "0124FOLDER"
                          }
                        }
                      ]
                    }
                ]
              },
              "CA10__resourceManagerOrganization__r": {
                "Id": "aAOO222",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__Google_IAM_Policy_Audit_Configs__r": []
            }
          ]
        },
        {
          "expectedResult": {
            "status": "COMPLIANT",
            "conditionIndex": "199",
            "conditionText": "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-12-06T03:25:14Z" },
          "Id": "a4p3",
          "CA10__Google_Resource_Manager_Projects__r": [
            {
              "Id": "333",
              "CA10__disappearanceTime__c": null,
              "CA10__googleProject__c": "a4p3",
              "CA10__resourceManagerFolder__c": "aAFF333",
              "CA10__resourceManagerOrganization__c": "aAOO333",
              "CA10__resourceManagerFolder__r": {
                "Id": "aAFF333",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__resourceManagerOrganization__r": {
                "Id": "aAOO333",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__Google_IAM_Policy_Audit_Configs__r": [
                  {
                      "Id": "a9C333",
                      "RecordTypeId": "0124PRJ",
                      "CA10__disappearanceTime__c": null,
                      "CA10__exemptedMembers__c": "",
                      "CA10__service__c": "allServices",
                      "CA10__resourceManagerProject__c": "333",
                      "RecordType": {
                        "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                        "Id": "0124PRJ"
                      },
                      "CA10__Google_IAM_Policy_Audit_Log_Config1__r": [
                        {
                          "Id": "a9xDIAK333",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_WRITE",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        },
                        {
                          "Id": "a9EjIAK333",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_READ",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        }
                      ]
                    }
              ]
            }
          ]
        },

        {
          "expectedResult": {
            "status": "INCOMPLIANT",
            "conditionIndex": "200",
            "conditionText": "otherwise",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-12-06T03:25:14Z" },
          "Id": "a4p3IN",
          "CA10__Google_Resource_Manager_Projects__r": [
            {
              "Id": "333IN",
              "CA10__disappearanceTime__c": null,
              "CA10__googleProject__c": "a4p3IN",
              "CA10__resourceManagerFolder__c": "aAFF333IN",
              "CA10__resourceManagerOrganization__c": "aAOO333IN",
              "CA10__resourceManagerFolder__r": {
                "Id": "aAFF333IN",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__resourceManagerOrganization__r": {
                "Id": "aAOO333IN",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__Google_IAM_Policy_Audit_Configs__r": [
                  {
                      "Id": "a9C333IN",
                      "RecordTypeId": "0124PRJ",
                      "CA10__disappearanceTime__c": null,
                      "CA10__exemptedMembers__c": "",
                      "CA10__service__c": "someOther",
                      "CA10__resourceManagerProject__c": "333IN",
                      "RecordType": {
                        "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                        "Id": "0124PRJ"
                      },
                      "CA10__Google_IAM_Policy_Audit_Log_Config1__r": [
                        {
                          "Id": "a9xDIAK333IN",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_WRITE",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333IN",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        },
                        {
                          "Id": "a9EjIAK333IN",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_READ",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333IN",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        }
                      ]
                    }
              ]
            }
          ]
        },
        {
          "expectedResult": {
            "status": "INCOMPLIANT",
            "conditionIndex": "200",
            "conditionText": "otherwise",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-12-06T03:25:14Z" },
          "Id": "a4p3IN2",
          "CA10__Google_Resource_Manager_Projects__r": [
            {
              "Id": "333IN2",
              "CA10__disappearanceTime__c": null,
              "CA10__googleProject__c": "a4p3IN2",
              "CA10__resourceManagerFolder__c": "aAFF333IN2",
              "CA10__resourceManagerOrganization__c": "aAOO333IN2",
              "CA10__resourceManagerFolder__r": {
                "Id": "aAFF333IN2",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__resourceManagerOrganization__r": {
                "Id": "aAOO333IN2",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__Google_IAM_Policy_Audit_Configs__r": [
                  {
                      "Id": "a9C333IN2",
                      "RecordTypeId": "0124PRJ",
                      "CA10__disappearanceTime__c": null,
                      "CA10__exemptedMembers__c": "somebody",
                      "CA10__service__c": "allServices",
                      "CA10__resourceManagerProject__c": "333IN2",
                      "RecordType": {
                        "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                        "Id": "0124PRJ"
                      },
                      "CA10__Google_IAM_Policy_Audit_Log_Config1__r": [
                        {
                          "Id": "a9xDIAK333IN2",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_WRITE",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333IN2",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        },
                        {
                          "Id": "a9EjIAK333IN2",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_READ",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333IN2",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        }
                      ]
                    }
              ]
            }
          ]
        },
        {
          "expectedResult": {
            "status": "INCOMPLIANT",
            "conditionIndex": "200",
            "conditionText": "otherwise",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-12-06T03:25:14Z" },
          "Id": "a4p3IN3",
          "CA10__Google_Resource_Manager_Projects__r": [
            {
              "Id": "333IN3",
              "CA10__disappearanceTime__c": null,
              "CA10__googleProject__c": "a4p3IN3",
              "CA10__resourceManagerFolder__c": "aAFF333IN3",
              "CA10__resourceManagerOrganization__c": "aAOO333IN3",
              "CA10__resourceManagerFolder__r": {
                "Id": "aAFF333IN3",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__resourceManagerOrganization__r": {
                "Id": "aAOO333IN3",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__Google_IAM_Policy_Audit_Configs__r": [
                  {
                      "Id": "a9C333IN3",
                      "RecordTypeId": "0124PRJ",
                      "CA10__disappearanceTime__c": null,
                      "CA10__exemptedMembers__c": "",
                      "CA10__service__c": "allServices",
                      "CA10__resourceManagerProject__c": "333IN3",
                      "RecordType": {
                        "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                        "Id": "0124PRJ"
                      },
                      "CA10__Google_IAM_Policy_Audit_Log_Config1__r": [
                        {
                          "Id": "a9xDIAK333IN3",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_WRITE",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333IN3",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        },
                        {
                          "Id": "a9EjIAK333IN3",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "ADMIN_READ",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333IN3",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        }
                      ]
                    }
              ]
            }
          ]
        },
        {
          "expectedResult": {
            "status": "INCOMPLIANT",
            "conditionIndex": "200",
            "conditionText": "otherwise",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-12-06T03:25:14Z" },
          "Id": "a4p3IN4",
          "CA10__Google_Resource_Manager_Projects__r": [
            {
              "Id": "333IN4",
              "CA10__disappearanceTime__c": null,
              "CA10__googleProject__c": "a4p3IN4",
              "CA10__resourceManagerFolder__c": "aAFF333IN4",
              "CA10__resourceManagerOrganization__c": "aAOO333IN4",
              "CA10__resourceManagerFolder__r": {
                "Id": "aAFF333IN4",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__resourceManagerOrganization__r": {
                "Id": "aAOO333IN4",
                "CA10__Google_IAM_Policy_Audit_Configs__r": []
              },
              "CA10__Google_IAM_Policy_Audit_Configs__r": [
                  {
                      "Id": "a9C333IN4",
                      "RecordTypeId": "0124PRJ",
                      "CA10__disappearanceTime__c": null,
                      "CA10__exemptedMembers__c": "",
                      "CA10__service__c": "allServices",
                      "CA10__resourceManagerProject__c": "333IN4",
                      "RecordType": {
                        "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                        "Id": "0124PRJ"
                      },
                      "CA10__Google_IAM_Policy_Audit_Log_Config1__r": [
                        {
                          "Id": "a9xDIAK333IN4",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_WRITE",
                          "CA10__exemptedMembers__c": "some members",
                          "CA10__iamPolicyAuditConfig__c": "a9C333IN4",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        },
                        {
                          "Id": "a9EjIAK333IN4",
                          "RecordTypeId": "0124PRJ",
                          "CA10__disappearanceTime__c": null,
                          "CA10__logType__c": "DATA_READ",
                          "CA10__exemptedMembers__c": "",
                          "CA10__iamPolicyAuditConfig__c": "a9C333IN4",
                          "RecordType": {
                            "DeveloperName": "caGoogleIamPolicyAuditConfigProject",
                            "Id": "0124PRJ"
                          }
                        }
                      ]
                    }
              ]
            }
          ]
        }
      ]
  - path: /types/CA10__CaGoogleIamPolicyAuditConfig__c/object.extracts.yaml
    md5Hash: C0AFDAABBCA4E60A368C5953D05809DF
    content: "---\nextracts:\n  - name: \"CA10__service__c\"\n    value: \n      FIELD:\n\
      \        path: \"CA10__service__c\"\n  - name: \"CA10__exemptedMembers__c\"\n\
      \    value: \n      FIELD:\n        path: \"CA10__exemptedMembers__c\""
  - path: /types/CA10__CaGoogleIamPolicyAuditLogConfig__c/object.extracts.yaml
    md5Hash: 48FDC97ADBDBBB58265E84134754A471
    content: "---\nextracts:\n  - name: \"CA10__exemptedMembers__c\"\n    value: \n\
      \      FIELD:\n        path: \"CA10__exemptedMembers__c\"\n  - name: \"CA10__logType__c\"\
      \n    value: \n      FIELD:\n        path: \"CA10__logType__c\""
  - path: /types/CA10__CaGoogleProject__c/object.extracts.yaml
    md5Hash: 8EB422663BF4493D44ABA5FEC0FB9AD4
    content: "---\nextracts:\n  - name: \"CA10__projectId__c\"\n    value: \n    \
      \   FIELD:\n         path: \"CA10__projectId__c\"\n         undeterminedIf:\n\
      \          isEmpty: \"Corrupted data. Project ID cannot be empty.\"\n  - name:\
      \ \"CA10__enabledServices__c\"\n    value: \n      FIELD:\n        path: \"\
      CA10__enabledServices__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" : "a4p1",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4p2",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4p3",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "CA10__Google_Resource_Manager_Projects__r.has(COMPLIANT)",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4p3IN",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4p3IN2",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4p3IN3",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "a4p3IN4",
    "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-06T03:25:14Z")
    },
    "Id" : "a4p1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a4p2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a4p3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a4p3IN"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a4p3IN2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a4p3IN3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a4p3IN4"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleResourceManagerProject__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__googleProject__c STRING,
      CA10__resourceManagerFolder__c STRING,
      CA10__resourceManagerOrganization__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "1111",
    "CA10__googleProject__c" : "a4p1",
    "CA10__resourceManagerFolder__c" : "aAFF111",
    "CA10__resourceManagerOrganization__c" : "aAOO111"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "2222",
    "CA10__googleProject__c" : "a4p2",
    "CA10__resourceManagerFolder__c" : "aAFF222",
    "CA10__resourceManagerOrganization__c" : "aAOO222"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "333",
    "CA10__googleProject__c" : "a4p3",
    "CA10__resourceManagerFolder__c" : "aAFF333",
    "CA10__resourceManagerOrganization__c" : "aAOO333"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "333IN",
    "CA10__googleProject__c" : "a4p3IN",
    "CA10__resourceManagerFolder__c" : "aAFF333IN",
    "CA10__resourceManagerOrganization__c" : "aAOO333IN"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "333IN2",
    "CA10__googleProject__c" : "a4p3IN2",
    "CA10__resourceManagerFolder__c" : "aAFF333IN2",
    "CA10__resourceManagerOrganization__c" : "aAOO333IN2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "333IN3",
    "CA10__googleProject__c" : "a4p3IN3",
    "CA10__resourceManagerFolder__c" : "aAFF333IN3",
    "CA10__resourceManagerOrganization__c" : "aAOO333IN3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "333IN4",
    "CA10__googleProject__c" : "a4p3IN4",
    "CA10__resourceManagerFolder__c" : "aAFF333IN4",
    "CA10__resourceManagerOrganization__c" : "aAOO333IN4"
  } ];
  """;

  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-06T03:25:14Z")
    },
    "Id" : "aAFF111"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAFF222"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAFF333"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAFF333IN"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAFF333IN2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAFF333IN3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAFF333IN4"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleIamPolicyAuditConfig__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      RecordTypeId STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__exemptedMembers__c STRING,
      CA10__service__c STRING,
      CA10__resourceManagerFolder__c STRING,
      CA10__resourceManagerOrganization__c STRING,
      CA10__resourceManagerProject__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9C111",
    "RecordTypeId" : "0124ORG",
    "CA10__exemptedMembers__c" : "",
    "CA10__service__c" : "allServices",
    "CA10__resourceManagerOrganization__c" : "aAOO111"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9C222",
    "RecordTypeId" : "0124FOLDER",
    "CA10__exemptedMembers__c" : "",
    "CA10__service__c" : "allServices",
    "CA10__resourceManagerFolder__c" : "aAFF222"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9C333",
    "RecordTypeId" : "0124PRJ",
    "CA10__exemptedMembers__c" : "",
    "CA10__service__c" : "allServices",
    "CA10__resourceManagerProject__c" : "333"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9C333IN",
    "RecordTypeId" : "0124PRJ",
    "CA10__exemptedMembers__c" : "",
    "CA10__service__c" : "someOther",
    "CA10__resourceManagerProject__c" : "333IN"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9C333IN2",
    "RecordTypeId" : "0124PRJ",
    "CA10__exemptedMembers__c" : "somebody",
    "CA10__service__c" : "allServices",
    "CA10__resourceManagerProject__c" : "333IN2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9C333IN3",
    "RecordTypeId" : "0124PRJ",
    "CA10__exemptedMembers__c" : "",
    "CA10__service__c" : "allServices",
    "CA10__resourceManagerProject__c" : "333IN3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9C333IN4",
    "RecordTypeId" : "0124PRJ",
    "CA10__exemptedMembers__c" : "",
    "CA10__service__c" : "allServices",
    "CA10__resourceManagerProject__c" : "333IN4"
  } ];
  """;

  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-06T03:25:14Z")
    },
    "DeveloperName" : "caGoogleIamPolicyAuditConfigOrganization",
    "Id" : "0124ORG"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "DeveloperName" : "caGoogleIamPolicyAuditConfigFolder",
    "Id" : "0124FOLDER"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "DeveloperName" : "caGoogleIamPolicyAuditConfigProject",
    "Id" : "0124PRJ"
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleIamPolicyAuditLogConfig__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      RecordTypeId STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__logType__c STRING,
      CA10__exemptedMembers__c STRING,
      CA10__iamPolicyAuditConfig__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9xDIAK111",
    "RecordTypeId" : "0124ORG",
    "CA10__logType__c" : "DATA_WRITE",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C111"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9EjIAK111",
    "RecordTypeId" : "0124ORG",
    "CA10__logType__c" : "DATA_READ",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C111"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9xDIAK222",
    "RecordTypeId" : "0124FOLDER",
    "CA10__logType__c" : "DATA_WRITE",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C222"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9EjIAK222",
    "RecordTypeId" : "0124FOLDER",
    "CA10__logType__c" : "DATA_READ",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C222"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9xDIAK333",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_WRITE",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9EjIAK333",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_READ",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9xDIAK333IN",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_WRITE",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333IN"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9EjIAK333IN",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_READ",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333IN"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9xDIAK333IN2",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_WRITE",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333IN2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9EjIAK333IN2",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_READ",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333IN2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9xDIAK333IN3",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_WRITE",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333IN3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9EjIAK333IN3",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "ADMIN_READ",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333IN3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9xDIAK333IN4",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_WRITE",
    "CA10__exemptedMembers__c" : "some members",
    "CA10__iamPolicyAuditConfig__c" : "a9C333IN4"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "a9EjIAK333IN4",
    "RecordTypeId" : "0124PRJ",
    "CA10__logType__c" : "DATA_READ",
    "CA10__exemptedMembers__c" : "",
    "CA10__iamPolicyAuditConfig__c" : "a9C333IN4"
  } ];
  """;

  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-06T03:25:14Z")
    },
    "Id" : "aAOO111"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAOO222"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAOO333"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAOO333IN"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAOO333IN2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAOO333IN3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-12-06T03:25:14Z")
    },
    "Id" : "aAOO333IN4"
  } ];
  """;

  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__resourceManagerFolder__c STRING,
              CA10__resourceManagerOrganization__c STRING,
              CA10__resourceManagerFolder__r STRUCT<
                  Id STRING,
                  CA10__Google_IAM_Policy_Audit_Configs__r ARRAY<STRUCT<
                      Id STRING,
                      RecordTypeId STRING,
                      CA10__disappearanceTime__c TIMESTAMP,
                      CA10__exemptedMembers__c STRING,
                      CA10__service__c STRING,
                      CA10__resourceManagerFolder__c STRING,
                      RecordType STRUCT<
                          DeveloperName STRING,
                          Id STRING
                      >,
                      CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
                          Id STRING,
                          RecordTypeId STRING,
                          CA10__disappearanceTime__c TIMESTAMP,
                          CA10__logType__c STRING,
                          CA10__exemptedMembers__c STRING,
                          CA10__iamPolicyAuditConfig__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>
                  >>
              >,
              CA10__resourceManagerOrganization__r STRUCT<
                  Id STRING,
                  CA10__Google_IAM_Policy_Audit_Configs__r ARRAY<STRUCT<
                      Id STRING,
                      RecordTypeId STRING,
                      CA10__disappearanceTime__c TIMESTAMP,
                      CA10__exemptedMembers__c STRING,
                      CA10__service__c STRING,
                      CA10__resourceManagerOrganization__c STRING,
                      RecordType STRUCT<
                          DeveloperName STRING,
                          Id STRING
                      >,
                      CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
                          Id STRING,
                          RecordTypeId STRING,
                          CA10__disappearanceTime__c TIMESTAMP,
                          CA10__logType__c STRING,
                          CA10__exemptedMembers__c STRING,
                          CA10__iamPolicyAuditConfig__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>
                  >>
              >,
              CA10__Google_IAM_Policy_Audit_Configs__r ARRAY<STRUCT<
                  Id STRING,
                  RecordTypeId STRING,
                  CA10__disappearanceTime__c TIMESTAMP,
                  CA10__exemptedMembers__c STRING,
                  CA10__service__c STRING,
                  CA10__resourceManagerProject__c STRING,
                  RecordType STRUCT<
                      DeveloperName STRING,
                      Id STRING
                  >,
                  CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
                      Id STRING,
                      RecordTypeId STRING,
                      CA10__disappearanceTime__c TIMESTAMP,
                      CA10__logType__c STRING,
                      CA10__exemptedMembers__c STRING,
                      CA10__iamPolicyAuditConfig__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>
              >>,
              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: "Cloud Audit Logging is configured to track all admin activities and read, write access to user data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "Cloud Audit Logging is not configured to track all admin activities and read, write access to user data.", currentStateReferences: references1.join('\n'), remediation: "Configure Cloud Audit Logging to track all admin activities and read, write access to user data.", runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__resourceManagerOrganization__r_CA10__Google_IAM_Policy_Audit_Configs__r(
      obj STRUCT<
          Id STRING,
          RecordTypeId STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__exemptedMembers__c STRING,
          CA10__service__c STRING,
          CA10__resourceManagerOrganization__c STRING,
          RecordType STRUCT<
              DeveloperName STRING,
              Id STRING
          >,
          CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
              Id STRING,
              RecordTypeId STRING,
              CA10__disappearanceTime__c TIMESTAMP,
              CA10__logType__c STRING,
              CA10__exemptedMembers__c STRING,
              CA10__iamPolicyAuditConfig__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 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 [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};
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Record Type Name [obj.RecordType.DeveloperName]: ' + obj.RecordType.DeveloperName);
      if (!CollectionLib.contains(CollectionLib.fromArray(['caGoogleIamPolicyAuditConfigOrganization']), obj.RecordType.DeveloperName)) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "not(['caGoogleIamPolicyAuditConfigOrganization'].contains(RecordType.DeveloperName))", currentStateMessage: "Object record type is not applicable", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 = 0;
      if (obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r != null) {
          for (var i10 = 0; i10 < obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r.length; i10++) {
              if (obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r[i10].result.status == 'COMPLIANT') {
                  count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 += 1;
              }
          }
      }
      // condition[2], conditionIndex:[200..299]
      function extract5() { if (!this.out) { this.out = obj.CA10__exemptedMembers__c; } return this.out; };
      function extract8() { if (!this.out) { this.out = obj.CA10__service__c; } return this.out; };
      references1.push('Related list [CA10__Google_IAM_Policy_Audit_Log_Config1__r] has ' + count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 + ' objects in COMPLIANT status');
      references1.push('Exempted Members [obj.CA10__exemptedMembers__c]: ' + obj.CA10__exemptedMembers__c);
      references1.push('Service [obj.CA10__service__c]: ' + obj.CA10__service__c);
      if (count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 == 2.0 && TextLib.isEmpty(extract5.call(extract5)) && TextLib.equal(extract8.call(extract8), 'allServices')) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "CA10__Google_IAM_Policy_Audit_Log_Config1__r.count(COMPLIANT) == number(2.0) && extract('CA10__exemptedMembers__c').isEmpty() && extract('CA10__service__c') == 'allServices'", currentStateMessage: "Organization Audit Config is configured to track all admin activities and read, write access to user data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "Organization Audit Config is not configured to track all admin activities and read, write access to user data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__Google_IAM_Policy_Audit_Configs__r(
      obj STRUCT<
          Id STRING,
          RecordTypeId STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__exemptedMembers__c STRING,
          CA10__service__c STRING,
          CA10__resourceManagerProject__c STRING,
          RecordType STRUCT<
              DeveloperName STRING,
              Id STRING
          >,
          CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
              Id STRING,
              RecordTypeId STRING,
              CA10__disappearanceTime__c TIMESTAMP,
              CA10__logType__c STRING,
              CA10__exemptedMembers__c STRING,
              CA10__iamPolicyAuditConfig__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 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 [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};
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Record Type Name [obj.RecordType.DeveloperName]: ' + obj.RecordType.DeveloperName);
      if (!CollectionLib.contains(CollectionLib.fromArray(['caGoogleIamPolicyAuditConfigProject']), obj.RecordType.DeveloperName)) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "not(['caGoogleIamPolicyAuditConfigProject'].contains(RecordType.DeveloperName))", currentStateMessage: "Object record type is not applicable", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 = 0;
      if (obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r != null) {
          for (var i10 = 0; i10 < obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r.length; i10++) {
              if (obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r[i10].result.status == 'COMPLIANT') {
                  count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 += 1;
              }
          }
      }
      // condition[2], conditionIndex:[200..299]
      function extract5() { if (!this.out) { this.out = obj.CA10__exemptedMembers__c; } return this.out; };
      function extract8() { if (!this.out) { this.out = obj.CA10__service__c; } return this.out; };
      references1.push('Related list [CA10__Google_IAM_Policy_Audit_Log_Config1__r] has ' + count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 + ' objects in COMPLIANT status');
      references1.push('Exempted Members [obj.CA10__exemptedMembers__c]: ' + obj.CA10__exemptedMembers__c);
      references1.push('Service [obj.CA10__service__c]: ' + obj.CA10__service__c);
      if (count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 == 2.0 && TextLib.isEmpty(extract5.call(extract5)) && TextLib.equal(extract8.call(extract8), 'allServices')) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "CA10__Google_IAM_Policy_Audit_Log_Config1__r.count(COMPLIANT) == number(2.0) && extract('CA10__exemptedMembers__c').isEmpty() && extract('CA10__service__c') == 'allServices'", currentStateMessage: "Project Audit Config is configured to track all admin activities and read, write access to user data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "Project Audit Config is not configured to track all admin activities and read, write access to user data.", 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__resourceManagerFolder__c STRING,
          CA10__resourceManagerOrganization__c STRING,
          CA10__resourceManagerFolder__r STRUCT<
              Id STRING,
              CA10__Google_IAM_Policy_Audit_Configs__r ARRAY<STRUCT<
                  Id STRING,
                  RecordTypeId STRING,
                  CA10__disappearanceTime__c TIMESTAMP,
                  CA10__exemptedMembers__c STRING,
                  CA10__service__c STRING,
                  CA10__resourceManagerFolder__c STRING,
                  RecordType STRUCT<
                      DeveloperName STRING,
                      Id STRING
                  >,
                  CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
                      Id STRING,
                      RecordTypeId STRING,
                      CA10__disappearanceTime__c TIMESTAMP,
                      CA10__logType__c STRING,
                      CA10__exemptedMembers__c STRING,
                      CA10__iamPolicyAuditConfig__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>
              >>
          >,
          CA10__resourceManagerOrganization__r STRUCT<
              Id STRING,
              CA10__Google_IAM_Policy_Audit_Configs__r ARRAY<STRUCT<
                  Id STRING,
                  RecordTypeId STRING,
                  CA10__disappearanceTime__c TIMESTAMP,
                  CA10__exemptedMembers__c STRING,
                  CA10__service__c STRING,
                  CA10__resourceManagerOrganization__c STRING,
                  RecordType STRUCT<
                      DeveloperName STRING,
                      Id STRING
                  >,
                  CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
                      Id STRING,
                      RecordTypeId STRING,
                      CA10__disappearanceTime__c TIMESTAMP,
                      CA10__logType__c STRING,
                      CA10__exemptedMembers__c STRING,
                      CA10__iamPolicyAuditConfig__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>
              >>
          >,
          CA10__Google_IAM_Policy_Audit_Configs__r ARRAY<STRUCT<
              Id STRING,
              RecordTypeId STRING,
              CA10__disappearanceTime__c TIMESTAMP,
              CA10__exemptedMembers__c STRING,
              CA10__service__c STRING,
              CA10__resourceManagerProject__c STRING,
              RecordType STRUCT<
                  DeveloperName STRING,
                  Id STRING
              >,
              CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
                  Id STRING,
                  RecordTypeId STRING,
                  CA10__disappearanceTime__c TIMESTAMP,
                  CA10__logType__c STRING,
                  CA10__exemptedMembers__c STRING,
                  CA10__iamPolicyAuditConfig__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]
      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__resourceManagerOrganization__r_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT4 = 0;
      if (obj.CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r != null) {
          for (var i5 = 0; i5 < obj.CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r.length; i5++) {
              if (obj.CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r[i5].result.status == 'COMPLIANT') {
                  count_CA10__resourceManagerOrganization__r_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT4 += 1;
              }
          }
      }
      var count_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT2 = 0;
      if (obj.CA10__Google_IAM_Policy_Audit_Configs__r != null) {
          for (var i6 = 0; i6 < obj.CA10__Google_IAM_Policy_Audit_Configs__r.length; i6++) {
              if (obj.CA10__Google_IAM_Policy_Audit_Configs__r[i6].result.status == 'COMPLIANT') {
                  count_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT2 += 1;
              }
          }
      }
      var count_CA10__resourceManagerFolder__r_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT3 = 0;
      if (obj.CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r != null) {
          for (var i7 = 0; i7 < obj.CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r.length; i7++) {
              if (obj.CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r[i7].result.status == 'COMPLIANT') {
                  count_CA10__resourceManagerFolder__r_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT3 += 1;
              }
          }
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Related list [CA10__Google_IAM_Policy_Audit_Configs__r] ' + (count_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT2 > 0 ? 'has' : 'does not have') + ' objects in COMPLIANT status');
      references1.push('Related list [CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r] ' + (count_CA10__resourceManagerFolder__r_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT3 > 0 ? 'has' : 'does not have') + ' objects in COMPLIANT status');
      references1.push('Related list [CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r] ' + (count_CA10__resourceManagerOrganization__r_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT4 > 0 ? 'has' : 'does not have') + ' objects in COMPLIANT status');
      if (count_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT2 > 0 || count_CA10__resourceManagerFolder__r_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT3 > 0 || count_CA10__resourceManagerOrganization__r_CA10__Google_IAM_Policy_Audit_Configs__r_COMPLIANT4 > 0) {
          return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "CA10__Google_IAM_Policy_Audit_Configs__r.has(COMPLIANT) || CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r.has(COMPLIANT) || CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r.has(COMPLIANT)", currentStateMessage: "Cloud Audit Logging is configured to track all admin activities and read, write access to user data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "Resource Manager Project is not configured to track all admin activities and read, write access to user data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__Google_IAM_Policy_Audit_Log_Config1__r(
      obj STRUCT<
          Id STRING,
          RecordTypeId STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__logType__c STRING,
          CA10__exemptedMembers__c STRING,
          CA10__iamPolicyAuditConfig__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 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 [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};
      }
      // condition[1], conditionIndex:[100..199]
      function extract3() { if (!this.out) { this.out = obj.CA10__logType__c; } return this.out; };
      function extract7() { if (!this.out) { this.out = obj.CA10__exemptedMembers__c; } return this.out; };
      references1.push('Log Type [obj.CA10__logType__c]: ' + obj.CA10__logType__c);
      references1.push('Exempted Members [obj.CA10__exemptedMembers__c]: ' + obj.CA10__exemptedMembers__c);
      if ((TextLib.equal(extract3.call(extract3), 'DATA_WRITE') || TextLib.equal(extract3.call(extract3), 'DATA_READ')) && TextLib.isEmpty(extract7.call(extract7))) {
          return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "(extract('CA10__logType__c') == 'DATA_WRITE' || extract('CA10__logType__c') == 'DATA_READ') && extract('CA10__exemptedMembers__c').isEmpty()", currentStateMessage: "COMPLIANT Audit Log Configs", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "INCOMPLIANT Audit Log Configs", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
  """;

  CREATE TEMP FUNCTION process_CA10__resourceManagerFolder__r_CA10__Google_IAM_Policy_Audit_Configs__r(
      obj STRUCT<
          Id STRING,
          RecordTypeId STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__exemptedMembers__c STRING,
          CA10__service__c STRING,
          CA10__resourceManagerFolder__c STRING,
          RecordType STRUCT<
              DeveloperName STRING,
              Id STRING
          >,
          CA10__Google_IAM_Policy_Audit_Log_Config1__r ARRAY<STRUCT<
              Id STRING,
              RecordTypeId STRING,
              CA10__disappearanceTime__c TIMESTAMP,
              CA10__logType__c STRING,
              CA10__exemptedMembers__c STRING,
              CA10__iamPolicyAuditConfig__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 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 [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};
      }
      // condition[1], conditionIndex:[100..199]
      references1.push('Record Type Name [obj.RecordType.DeveloperName]: ' + obj.RecordType.DeveloperName);
      if (!CollectionLib.contains(CollectionLib.fromArray(['caGoogleIamPolicyAuditConfigFolder']), obj.RecordType.DeveloperName)) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "not(['caGoogleIamPolicyAuditConfigFolder'].contains(RecordType.DeveloperName))", currentStateMessage: "Object record type is not applicable", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      var count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 = 0;
      if (obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r != null) {
          for (var i10 = 0; i10 < obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r.length; i10++) {
              if (obj.CA10__Google_IAM_Policy_Audit_Log_Config1__r[i10].result.status == 'COMPLIANT') {
                  count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 += 1;
              }
          }
      }
      // condition[2], conditionIndex:[200..299]
      function extract5() { if (!this.out) { this.out = obj.CA10__exemptedMembers__c; } return this.out; };
      function extract8() { if (!this.out) { this.out = obj.CA10__service__c; } return this.out; };
      references1.push('Related list [CA10__Google_IAM_Policy_Audit_Log_Config1__r] has ' + count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 + ' objects in COMPLIANT status');
      references1.push('Exempted Members [obj.CA10__exemptedMembers__c]: ' + obj.CA10__exemptedMembers__c);
      references1.push('Service [obj.CA10__service__c]: ' + obj.CA10__service__c);
      if (count_CA10__Google_IAM_Policy_Audit_Log_Config1__r_COMPLIANT3 == 2.0 && TextLib.isEmpty(extract5.call(extract5)) && TextLib.equal(extract8.call(extract8), 'allServices')) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "CA10__Google_IAM_Policy_Audit_Log_Config1__r.count(COMPLIANT) == number(2.0) && extract('CA10__exemptedMembers__c').isEmpty() && extract('CA10__service__c') == 'allServices'", currentStateMessage: "Folder Audit Config is configured to track all admin activities and read, write access to user data.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 300, conditionText: "otherwise", currentStateMessage: "Folder Audit Config is not configured to track all admin activities and read, write access to user data.", 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__resourceManagerFolder__c AS CA10__resourceManagerFolder__c,
                      sObject.CA10__resourceManagerOrganization__c AS CA10__resourceManagerOrganization__c,
                      STRUCT (
                          `CA10__resourceManagerFolder__r`.Id AS Id,
                          `CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r`.arr AS CA10__Google_IAM_Policy_Audit_Configs__r
                      ) AS CA10__resourceManagerFolder__r,
                      STRUCT (
                          `CA10__resourceManagerOrganization__r`.Id AS Id,
                          `CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r`.arr AS CA10__Google_IAM_Policy_Audit_Configs__r
                      ) AS CA10__resourceManagerOrganization__r,
                      `CA10__Google_IAM_Policy_Audit_Configs__r`.arr AS CA10__Google_IAM_Policy_Audit_Configs__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__resourceManagerFolder__c AS CA10__resourceManagerFolder__c,
                              sObject.CA10__resourceManagerOrganization__c AS CA10__resourceManagerOrganization__c,
                              STRUCT (
                                  `CA10__resourceManagerFolder__r`.Id AS Id,
                                  `CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r`.arr AS CA10__Google_IAM_Policy_Audit_Configs__r
                              ) AS CA10__resourceManagerFolder__r,
                              STRUCT (
                                  `CA10__resourceManagerOrganization__r`.Id AS Id,
                                  `CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r`.arr AS CA10__Google_IAM_Policy_Audit_Configs__r
                              ) AS CA10__resourceManagerOrganization__r,
                              `CA10__Google_IAM_Policy_Audit_Configs__r`.arr AS CA10__Google_IAM_Policy_Audit_Configs__r
                          ),
                          sObject.context.snapshotTime
                      ) as result
                  )
              ) AS arr
          FROM UNNEST(mock_CA10__CaGoogleResourceManagerProject__c()) AS sObject
          LEFT JOIN UNNEST(mock_CA10__CaGoogleResourceManagerFolder__c()) AS `CA10__resourceManagerFolder__r`
              ON sObject.CA10__resourceManagerFolder__c = `CA10__resourceManagerFolder__r`.Id
          LEFT JOIN UNNEST(mock_CA10__CaGoogleResourceManagerOrganization__c()) AS `CA10__resourceManagerOrganization__r`
              ON sObject.CA10__resourceManagerOrganization__c = `CA10__resourceManagerOrganization__r`.Id
          LEFT JOIN (
              SELECT
                  sObject.CA10__resourceManagerProject__c,
                  ARRAY_AGG(
                      STRUCT(
                          sObject.Id AS Id,
                          sObject.RecordTypeId AS RecordTypeId,
                          sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                          sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                          sObject.CA10__service__c AS CA10__service__c,
                          sObject.CA10__resourceManagerProject__c AS CA10__resourceManagerProject__c,
                          STRUCT (
                              `RecordType`.DeveloperName AS DeveloperName,
                              `RecordType`.Id AS Id
                          ) AS RecordType,
                          `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.arr AS CA10__Google_IAM_Policy_Audit_Log_Config1__r,
                          process_CA10__Google_IAM_Policy_Audit_Configs__r(
                              STRUCT(
                                  sObject.Id AS Id,
                                  sObject.RecordTypeId AS RecordTypeId,
                                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                                  sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                                  sObject.CA10__service__c AS CA10__service__c,
                                  sObject.CA10__resourceManagerProject__c AS CA10__resourceManagerProject__c,
                                  STRUCT (
                                      `RecordType`.DeveloperName AS DeveloperName,
                                      `RecordType`.Id AS Id
                                  ) AS RecordType,
                                  `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.arr AS CA10__Google_IAM_Policy_Audit_Log_Config1__r
                              ),
                              sObject.context.snapshotTime
                          ) as result
                      )
                  ) AS arr
              FROM UNNEST(mock_CA10__CaGoogleIamPolicyAuditConfig__c()) AS sObject
              LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                  ON sObject.RecordTypeId = `RecordType`.Id
              LEFT JOIN (
                  SELECT
                      sObject.CA10__iamPolicyAuditConfig__c,
                      ARRAY_AGG(
                          STRUCT(
                              sObject.Id AS Id,
                              sObject.RecordTypeId AS RecordTypeId,
                              sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                              sObject.CA10__logType__c AS CA10__logType__c,
                              sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                              sObject.CA10__iamPolicyAuditConfig__c AS CA10__iamPolicyAuditConfig__c,
                              STRUCT (
                                  `RecordType`.DeveloperName AS DeveloperName,
                                  `RecordType`.Id AS Id
                              ) AS RecordType,
                              process_CA10__Google_IAM_Policy_Audit_Log_Config1__r(
                                  STRUCT(
                                      sObject.Id AS Id,
                                      sObject.RecordTypeId AS RecordTypeId,
                                      sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                                      sObject.CA10__logType__c AS CA10__logType__c,
                                      sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                                      sObject.CA10__iamPolicyAuditConfig__c AS CA10__iamPolicyAuditConfig__c,
                                      STRUCT (
                                          `RecordType`.DeveloperName AS DeveloperName,
                                          `RecordType`.Id AS Id
                                      ) AS RecordType
                                  ),
                                  sObject.context.snapshotTime
                              ) as result
                          )
                      ) AS arr
                  FROM UNNEST(mock_CA10__CaGoogleIamPolicyAuditLogConfig__c()) AS sObject
                  LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                      ON sObject.RecordTypeId = `RecordType`.Id
                  GROUP BY sObject.CA10__iamPolicyAuditConfig__c
              ) AS `CA10__Google_IAM_Policy_Audit_Log_Config1__r`
                  ON sObject.Id = `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.CA10__iamPolicyAuditConfig__c
              GROUP BY sObject.CA10__resourceManagerProject__c
          ) AS `CA10__Google_IAM_Policy_Audit_Configs__r`
              ON sObject.Id = `CA10__Google_IAM_Policy_Audit_Configs__r`.CA10__resourceManagerProject__c
          LEFT JOIN (
              SELECT
                  sObject.CA10__resourceManagerFolder__c,
                  ARRAY_AGG(
                      STRUCT(
                          sObject.Id AS Id,
                          sObject.RecordTypeId AS RecordTypeId,
                          sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                          sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                          sObject.CA10__service__c AS CA10__service__c,
                          sObject.CA10__resourceManagerFolder__c AS CA10__resourceManagerFolder__c,
                          STRUCT (
                              `RecordType`.DeveloperName AS DeveloperName,
                              `RecordType`.Id AS Id
                          ) AS RecordType,
                          `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.arr AS CA10__Google_IAM_Policy_Audit_Log_Config1__r,
                          process_CA10__resourceManagerFolder__r_CA10__Google_IAM_Policy_Audit_Configs__r(
                              STRUCT(
                                  sObject.Id AS Id,
                                  sObject.RecordTypeId AS RecordTypeId,
                                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                                  sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                                  sObject.CA10__service__c AS CA10__service__c,
                                  sObject.CA10__resourceManagerFolder__c AS CA10__resourceManagerFolder__c,
                                  STRUCT (
                                      `RecordType`.DeveloperName AS DeveloperName,
                                      `RecordType`.Id AS Id
                                  ) AS RecordType,
                                  `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.arr AS CA10__Google_IAM_Policy_Audit_Log_Config1__r
                              ),
                              sObject.context.snapshotTime
                          ) as result
                      )
                  ) AS arr
              FROM UNNEST(mock_CA10__CaGoogleIamPolicyAuditConfig__c()) AS sObject
              LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                  ON sObject.RecordTypeId = `RecordType`.Id
              LEFT JOIN (
                  SELECT
                      sObject.CA10__iamPolicyAuditConfig__c,
                      ARRAY_AGG(
                          STRUCT(
                              sObject.Id AS Id,
                              sObject.RecordTypeId AS RecordTypeId,
                              sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                              sObject.CA10__logType__c AS CA10__logType__c,
                              sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                              sObject.CA10__iamPolicyAuditConfig__c AS CA10__iamPolicyAuditConfig__c,
                              STRUCT (
                                  `RecordType`.DeveloperName AS DeveloperName,
                                  `RecordType`.Id AS Id
                              ) AS RecordType,
                              process_CA10__Google_IAM_Policy_Audit_Log_Config1__r(
                                  STRUCT(
                                      sObject.Id AS Id,
                                      sObject.RecordTypeId AS RecordTypeId,
                                      sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                                      sObject.CA10__logType__c AS CA10__logType__c,
                                      sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                                      sObject.CA10__iamPolicyAuditConfig__c AS CA10__iamPolicyAuditConfig__c,
                                      STRUCT (
                                          `RecordType`.DeveloperName AS DeveloperName,
                                          `RecordType`.Id AS Id
                                      ) AS RecordType
                                  ),
                                  sObject.context.snapshotTime
                              ) as result
                          )
                      ) AS arr
                  FROM UNNEST(mock_CA10__CaGoogleIamPolicyAuditLogConfig__c()) AS sObject
                  LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                      ON sObject.RecordTypeId = `RecordType`.Id
                  GROUP BY sObject.CA10__iamPolicyAuditConfig__c
              ) AS `CA10__Google_IAM_Policy_Audit_Log_Config1__r`
                  ON sObject.Id = `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.CA10__iamPolicyAuditConfig__c
              GROUP BY sObject.CA10__resourceManagerFolder__c
          ) AS `CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r`
              ON `CA10__resourceManagerFolder__r`.Id = `CA10__resourceManagerFolder__r.CA10__Google_IAM_Policy_Audit_Configs__r`.CA10__resourceManagerFolder__c
          LEFT JOIN (
              SELECT
                  sObject.CA10__resourceManagerOrganization__c,
                  ARRAY_AGG(
                      STRUCT(
                          sObject.Id AS Id,
                          sObject.RecordTypeId AS RecordTypeId,
                          sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                          sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                          sObject.CA10__service__c AS CA10__service__c,
                          sObject.CA10__resourceManagerOrganization__c AS CA10__resourceManagerOrganization__c,
                          STRUCT (
                              `RecordType`.DeveloperName AS DeveloperName,
                              `RecordType`.Id AS Id
                          ) AS RecordType,
                          `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.arr AS CA10__Google_IAM_Policy_Audit_Log_Config1__r,
                          process_CA10__resourceManagerOrganization__r_CA10__Google_IAM_Policy_Audit_Configs__r(
                              STRUCT(
                                  sObject.Id AS Id,
                                  sObject.RecordTypeId AS RecordTypeId,
                                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                                  sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                                  sObject.CA10__service__c AS CA10__service__c,
                                  sObject.CA10__resourceManagerOrganization__c AS CA10__resourceManagerOrganization__c,
                                  STRUCT (
                                      `RecordType`.DeveloperName AS DeveloperName,
                                      `RecordType`.Id AS Id
                                  ) AS RecordType,
                                  `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.arr AS CA10__Google_IAM_Policy_Audit_Log_Config1__r
                              ),
                              sObject.context.snapshotTime
                          ) as result
                      )
                  ) AS arr
              FROM UNNEST(mock_CA10__CaGoogleIamPolicyAuditConfig__c()) AS sObject
              LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                  ON sObject.RecordTypeId = `RecordType`.Id
              LEFT JOIN (
                  SELECT
                      sObject.CA10__iamPolicyAuditConfig__c,
                      ARRAY_AGG(
                          STRUCT(
                              sObject.Id AS Id,
                              sObject.RecordTypeId AS RecordTypeId,
                              sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                              sObject.CA10__logType__c AS CA10__logType__c,
                              sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                              sObject.CA10__iamPolicyAuditConfig__c AS CA10__iamPolicyAuditConfig__c,
                              STRUCT (
                                  `RecordType`.DeveloperName AS DeveloperName,
                                  `RecordType`.Id AS Id
                              ) AS RecordType,
                              process_CA10__Google_IAM_Policy_Audit_Log_Config1__r(
                                  STRUCT(
                                      sObject.Id AS Id,
                                      sObject.RecordTypeId AS RecordTypeId,
                                      sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                                      sObject.CA10__logType__c AS CA10__logType__c,
                                      sObject.CA10__exemptedMembers__c AS CA10__exemptedMembers__c,
                                      sObject.CA10__iamPolicyAuditConfig__c AS CA10__iamPolicyAuditConfig__c,
                                      STRUCT (
                                          `RecordType`.DeveloperName AS DeveloperName,
                                          `RecordType`.Id AS Id
                                      ) AS RecordType
                                  ),
                                  sObject.context.snapshotTime
                              ) as result
                          )
                      ) AS arr
                  FROM UNNEST(mock_CA10__CaGoogleIamPolicyAuditLogConfig__c()) AS sObject
                  LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
                      ON sObject.RecordTypeId = `RecordType`.Id
                  GROUP BY sObject.CA10__iamPolicyAuditConfig__c
              ) AS `CA10__Google_IAM_Policy_Audit_Log_Config1__r`
                  ON sObject.Id = `CA10__Google_IAM_Policy_Audit_Log_Config1__r`.CA10__iamPolicyAuditConfig__c
              GROUP BY sObject.CA10__resourceManagerOrganization__c
          ) AS `CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r`
              ON `CA10__resourceManagerOrganization__r`.Id = `CA10__resourceManagerOrganization__r.CA10__Google_IAM_Policy_Audit_Configs__r`.CA10__resourceManagerOrganization__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;
