---
policy: /ce/ca/google/iam/essential-contacts-for-organization
logic: /ce/ca/google/iam/essential-contacts-for-organization/prod.logic.yaml
executionTime: 2025-05-10T12:05:19.558149165Z
rows:
  - id: aA41
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL')
        || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))
      actual: extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL')
        || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))
    runtimeError: {}
  - id: aA42
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL')
        || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))
      actual: extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL')
        || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION')
        && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))
    runtimeError: {}
  - id: aA43
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: aA44
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
  - id: aA45
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 200
      actual: 200
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
usedFiles:
  - path: /ce/ca/google/iam/essential-contacts-for-organization/policy.yaml
    md5Hash: 5791896754FAEBA01148936DCBA81FD0
    content: "---\nnames: \n  full: \"Google Organization Essential Contacts is not\
      \ configured\"\n  contextual: \"Organization Essential Contacts is not configured\"\
      \ndescription: \"It is recommended that Essential Contacts is configured to\
      \ designate email addresses \\\n for Google Cloud services to notify of important\
      \ technical or security information.\"\ntype: COMPLIANCE_POLICY\ncategories:\n\
      \  - \"SECURITY\"\nframeworkMappings:\n  - /frameworks/cis-gcp-v3.0.0/01/16\n\
      \  - /frameworks/cloudaware/identity-and-access-governance/general-access-controls\n\
      similarPolicies:\n  cloudConformity:\n    - url: \"https://www.trendmicro.com/cloudoneconformity/knowledge-base/gcp/CloudIAM/essential-contacts.html\"\
      \n      name: \"Configure Essential Contacts for Organizations\"\n "
  - path: /ce/ca/google/iam/essential-contacts-for-organization/prod.logic.yaml
    md5Hash: 4A420770D696ECC09E12854758F705DF
    content: |-
      ---

      inputType: "CA10__CaGoogleResourceManagerOrganization__c"
      testData:
        - file: test-data.json
      importExtracts:
        - file: /types/CA10__CaGoogleResourceManagerOrganization__c/object.extracts.yaml
      conditions:
        - status: "COMPLIANT"
          currentStateMessage: "Essential Contacts is configured for Organization."
          check:
            OR:
              args:
                - CONTAINS:
                    arg:
                      EXTRACT: "caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail"
                    substring:
                      TEXT: "ALL"
                - AND:
                    args:
                      - CONTAINS:
                          arg:
                            EXTRACT: "caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail"
                          substring:
                            TEXT: "LEGAL"
                      - CONTAINS:
                          arg:
                            EXTRACT: "caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail"
                          substring:
                            TEXT: "SECURITY"
                      - CONTAINS:
                          arg:
                            EXTRACT: "caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail"
                          substring:
                            TEXT: "SUSPENSION"
                      - CONTAINS:
                          arg:
                            EXTRACT: "caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail"
                          substring:
                            TEXT: "TECHNICAL"
      otherwise:
        status: "INCOMPLIANT"
        currentStateMessage: "Essential Contacts is not configured for Organization."
        remediationMessage: "Add organization Essential Contacts for following notification categories: LEGAL, SECURITY, SUSPENSION, TECHNICAL"
  - path: /types/CA10__CaGoogleResourceManagerOrganization__c/object.extracts.yaml
    md5Hash: 2D2C19059D3B64302B00AFEC051B96ED
    content: "---\nextracts:\n  - name: \"CA10__essentialContactsConfiguration__c\"\
      \n    value: \n       FIELD:\n         path: \"CA10__essentialContactsConfiguration__c\"\
      \n         returnType: BYTES\n  - name: \"caJsonFrom__essentialContactsConfiguration__c\"\
      \n    value: \n      JSON_FROM:\n        arg:\n          EXTRACT: \"CA10__essentialContactsConfiguration__c\"\
      \n        undeterminedIf:\n          isInvalid: \"JSON is invalid\"\n  - name:\
      \ \"caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail\"\
      \n    value: \n      JSON_QUERY_TEXT:\n        arg:\n          EXTRACT: \"caJsonFrom__essentialContactsConfiguration__c\"\
      \n        expression: \"to_string([?email != null].notificationCategorySubscriptions)\"\
      \n        undeterminedIf:\n          evaluationError: \"The JSON query failed.\"\
      \n          resultTypeMismatch: \"The JSON query did not return a text.\"\n\
      \          resultIsEmpty: \"The JSON query did not return a value.\"\n  - name:\
      \ \"CA10__accessApprovalStatus__c\"\n    value: \n       FIELD:\n         path:\
      \ \"CA10__accessApprovalStatus__c\"\n  - name: \"caJsonFrom__accessApprovalStatus__c\"\
      \n    value:\n      JSON_FROM:\n        arg:\n          EXTRACT: \"CA10__accessApprovalStatus__c\"\
      \n        undeterminedIf:\n          isInvalid: \"JSON is invalid\""
  - path: /ce/ca/google/iam/essential-contacts-for-organization/test-data.json
    md5Hash: 966F1902AC387D71FD17579AD9E07820
    content: |
      [
        {
          "expectedResult": {
            "status": "COMPLIANT",
            "conditionIndex": "199",
            "conditionText": "extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL') || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-23T11:48:39Z" },
          "Id": "aA41",
          "CA10__disappearanceTime__c": null,
          "CA10__essentialContactsConfiguration__c": "[{\"email\":\"test@mail.com\",\"languageTag\":\"en-US\",\"notificationCategorySubscriptions\":[\"SUSPENSION\",\"SECURITY\",\"TECHNICAL\",\"TECHNICAL_INCIDENTS\",\"BILLING\",\"LEGAL\",\"PRODUCT_UPDATES\"],\"validateTime\":\"2024-03-26T20:59:46.580493Z\",\"validationState\":\"VALID\"}]"
        },
        {
          "expectedResult": {
            "status": "COMPLIANT",
            "conditionIndex": "199",
            "conditionText": "extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL') || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-23T11:48:39Z" },
          "Id": "aA42",
          "CA10__disappearanceTime__c": null,
          "CA10__essentialContactsConfiguration__c": "[{\"email\":\"test@mail.com\",\"languageTag\":\"en-US\",\"notificationCategorySubscriptions\":[\"ALL\"],\"validateTime\":\"2024-03-26T20:59:46.580493Z\",\"validationState\":\"VALID\"}]"
        },
        {
          "expectedResult": {
            "status": "INCOMPLIANT",
            "conditionIndex": "200",
            "conditionText": "otherwise",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-23T11:48:39Z" },
          "Id": "aA43",
          "CA10__disappearanceTime__c": null,
          "CA10__essentialContactsConfiguration__c": "[{\"email\":\"test@mail.com\",\"languageTag\":\"en-US\",\"notificationCategorySubscriptions\":[\"SUSPENSION\",\"SECURITY\",\"TECHNICAL\"],\"validateTime\":\"2024-03-26T20:59:46.580493Z\",\"validationState\":\"VALID\"}]"
        },
        {
          "expectedResult": {
            "status": "INCOMPLIANT",
            "conditionIndex": "200",
            "conditionText": "otherwise",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-23T11:48:39Z" },
          "Id": "aA44",
          "CA10__disappearanceTime__c": null,
          "CA10__essentialContactsConfiguration__c": "[{\"languageTag\":\"en-US\",\"notificationCategorySubscriptions\":[\"ALL\"],\"validateTime\":\"2024-03-26T20:59:46.580493Z\",\"validationState\":\"VALID\"}]"
        },
        {
          "expectedResult": {
            "status": "INCOMPLIANT",
            "conditionIndex": "200",
            "conditionText": "otherwise",
            "runtimeError": null
          },
          "context": { "snapshotTime": "2024-09-23T11:48:39Z" },
          "Id": "aA45",
          "CA10__disappearanceTime__c": null,
          "CA10__essentialContactsConfiguration__c": null
        }
      ]
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" : "aA41",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL') || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "aA42",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "199",
      "conditionText" : "extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL') || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))",
      "runtimeError" : null
    }
  }, {
    "Id" : "aA43",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "aA44",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  }, {
    "Id" : "aA45",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "200",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleResourceManagerOrganization__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__essentialContactsConfiguration__c STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-09-23T11:48:39Z")
    },
    "Id" : "aA41",
    "CA10__essentialContactsConfiguration__c" : "[{\"email\":\"test@mail.com\",\"languageTag\":\"en-US\",\"notificationCategorySubscriptions\":[\"SUSPENSION\",\"SECURITY\",\"TECHNICAL\",\"TECHNICAL_INCIDENTS\",\"BILLING\",\"LEGAL\",\"PRODUCT_UPDATES\"],\"validateTime\":\"2024-03-26T20:59:46.580493Z\",\"validationState\":\"VALID\"}]"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-09-23T11:48:39Z")
    },
    "Id" : "aA42",
    "CA10__essentialContactsConfiguration__c" : "[{\"email\":\"test@mail.com\",\"languageTag\":\"en-US\",\"notificationCategorySubscriptions\":[\"ALL\"],\"validateTime\":\"2024-03-26T20:59:46.580493Z\",\"validationState\":\"VALID\"}]"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-09-23T11:48:39Z")
    },
    "Id" : "aA43",
    "CA10__essentialContactsConfiguration__c" : "[{\"email\":\"test@mail.com\",\"languageTag\":\"en-US\",\"notificationCategorySubscriptions\":[\"SUSPENSION\",\"SECURITY\",\"TECHNICAL\"],\"validateTime\":\"2024-03-26T20:59:46.580493Z\",\"validationState\":\"VALID\"}]"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-09-23T11:48:39Z")
    },
    "Id" : "aA44",
    "CA10__essentialContactsConfiguration__c" : "[{\"languageTag\":\"en-US\",\"notificationCategorySubscriptions\":[\"ALL\"],\"validateTime\":\"2024-03-26T20:59:46.580493Z\",\"validationState\":\"VALID\"}]"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-09-23T11:48:39Z")
    },
    "Id" : "aA45",
    "CA10__essentialContactsConfiguration__c" : null
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaGoogleResourceManagerOrganization__c(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__essentialContactsConfiguration__c STRING
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  OPTIONS (library=['gs://compliance-platform-public/jmespath.min.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 jsonQueryChecked4() {
          var input = extract6.call(extract6);
          var out;
          try {
              out = jmespath.search(input, 'to_string([?email != null].notificationCategorySubscriptions)');
          if (out != null && typeof out != 'string') {
              throw new Error("UNDETERMINED condition:102", {cause: {status: 'UNDETERMINED', conditionIndex: 102, conditionText: "extract('caJsonFrom__essentialContactsConfiguration__c').jsonQueryText('to_string([?email != null].notificationCategorySubscriptions)').isResultTypeMismatch()", currentStateMessage: "The JSON query did not return a text.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          } catch (e) {
              throw new Error("UNDETERMINED condition:103", {cause: {status: 'UNDETERMINED', conditionIndex: 103, conditionText: "extract('caJsonFrom__essentialContactsConfiguration__c').jsonQueryText('to_string([?email != null].notificationCategorySubscriptions)').isEvaluationFailed()", currentStateMessage: "The JSON query failed.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          if (TextLib.isEmpty(out)) {
              throw new Error("UNDETERMINED condition:104", {cause: {status: 'UNDETERMINED', conditionIndex: 104, conditionText: "extract('caJsonFrom__essentialContactsConfiguration__c').jsonQueryText('to_string([?email != null].notificationCategorySubscriptions)').isResultEmpty()", currentStateMessage: "The JSON query did not return a value.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null}});
          }
          return out;
      }
      function jsonChecked7() {
          var input = extract9.call(extract9);
          input = TextLib.isEmpty(input) ? null : input;
          var out;
          try {
              out = JSON.parse(input);
          } catch (e) {
              throw new Error("UNDETERMINED condition:101", {cause: {status: 'UNDETERMINED', conditionIndex: 101, conditionText: "extract('CA10__essentialContactsConfiguration__c').asJson().isInvalid()", currentStateMessage: "JSON is invalid", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: e.message}});
          }
          return out;
      }
      function extract9() { if (!this.out) { this.out = obj.CA10__essentialContactsConfiguration__c; } return this.out; };
      function extract6() { if (!this.out) { this.out = jsonChecked7(); } return this.out; };
      function extract3() { if (!this.out) { this.out = jsonQueryChecked4(); } return this.out; };
      references1.push('Essential Contacts Configuration [obj.CA10__essentialContactsConfiguration__c]: ' + obj.CA10__essentialContactsConfiguration__c);
      try {
          if (TextLib.contains(extract3.call(extract3), 'ALL') || (TextLib.contains(extract3.call(extract3), 'LEGAL') && TextLib.contains(extract3.call(extract3), 'SECURITY') && TextLib.contains(extract3.call(extract3), 'SUSPENSION') && TextLib.contains(extract3.call(extract3), 'TECHNICAL'))) {
              return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('ALL') || (extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('LEGAL') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SECURITY') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('SUSPENSION') && extract('caJsonFrom__essentialContactsConfiguration__notificationCategory_withEmail').contains('TECHNICAL'))", currentStateMessage: "Essential Contacts is configured for Organization.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
          }
      } catch (err) {
          if (err.cause && err.cause.status) { return err.cause; } else { throw err; }
      }
      return {status: 'INCOMPLIANT', conditionIndex: 200, conditionText: "otherwise", currentStateMessage: "Essential Contacts is not configured for Organization.", currentStateReferences: references1.join('\n'), remediation: "Add organization Essential Contacts for following notification categories: LEGAL, SECURITY, SUSPENSION, TECHNICAL", 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,
          sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
          sObject.CA10__essentialContactsConfiguration__c AS CA10__essentialContactsConfiguration__c,
          process_CA10__CaGoogleResourceManagerOrganization__c(
              STRUCT(
                  sObject.Id AS Id,
                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                  sObject.CA10__essentialContactsConfiguration__c AS CA10__essentialContactsConfiguration__c
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaGoogleResourceManagerOrganization__c()) AS sObject
  ) sObject ON sObject.Id = expectedResult.Id;
