---
policy: /ce/ca/google/load-balancing/external-forwarding-rule-http-proxy
logic: /ce/ca/google/load-balancing/external-forwarding-rule-http-proxy/prod.logic.yaml
executionTime: 2025-10-25T12:02:47.827762175Z
generationMs: 76
executionMs: 637
rows:
  - id: test1
    match: true
    status:
      expected: DISAPPEARED
      actual: DISAPPEARED
    conditionIndex:
      expected: 99
      actual: 99
    conditionText:
      expected: isDisappeared(CA10__disappearanceTime__c)
      actual: isDisappeared(CA10__disappearanceTime__c)
    runtimeError: {}
  - id: test2
    match: true
    status:
      expected: INAPPLICABLE
      actual: INAPPLICABLE
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: "not(setOfText(['caGoogleGceForwardingRuleGlobal', 'caGoogleGceForwardingRuleExternal']).contains(RecordType.DeveloperName))"
      actual: "not(setOfText(['caGoogleGceForwardingRuleGlobal', 'caGoogleGceForwardingRuleExternal']).contains(RecordType.DeveloperName))"
    runtimeError: {}
  - id: test3
    match: true
    status:
      expected: INAPPLICABLE
      actual: INAPPLICABLE
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: "not(setOfText(['EXTERNAL', 'EXTERNAL_MANAGED']).contains(extract('CA10__loadBalancingScheme__c')))"
      actual: "not(setOfText(['EXTERNAL', 'EXTERNAL_MANAGED']).contains(extract('CA10__loadBalancingScheme__c')))"
    runtimeError: {}
  - id: test4
    match: true
    status:
      expected: INCOMPLIANT
      actual: INCOMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: extract('CA10__targetHttpProxyUniqueId__c').isNotEmpty()
      actual: extract('CA10__targetHttpProxyUniqueId__c').isNotEmpty()
    runtimeError: {}
  - id: test5
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 499
      actual: 499
    conditionText:
      expected: extract('CA10__targetHttpsProxyUniqueId__c').isNotEmpty()
      actual: extract('CA10__targetHttpsProxyUniqueId__c').isNotEmpty()
    runtimeError: {}
  - id: test6
    match: true
    status:
      expected: INAPPLICABLE
      actual: INAPPLICABLE
    conditionIndex:
      expected: 500
      actual: 500
    conditionText:
      expected: otherwise
      actual: otherwise
    runtimeError: {}
usedFiles:
  - path: /ce/ca/google/load-balancing/external-forwarding-rule-http-proxy/policy.yaml
    md5Hash: D5570868AF7916D6921BB8B4F1736035
    content: "---\nnames: \n  full: \"Google GCE External Forwarding Rule is configured\
      \ to use a Target HTTP Proxy\"\n  contextual: \"External Forwarding Rule is\
      \ configured to use a Target HTTP Proxy\"\ndescription: \"Ensures that external\
      \ Google Cloud forwarding rules use Target HTTPS\\\n  \\ Proxies for secure,\
      \ encrypted traffic, instead of unencrypted Target HTTP Proxies.\"\ntype: \"\
      COMPLIANCE_POLICY\"\ncategories:\n  - \"SECURITY\"\nframeworkMappings:\n  -\
      \ \"/frameworks/pci-dss-v3.2.1/02/03\"\n  - \"/frameworks/cloudaware/resource-security/data-encryption\"\
      \n"
  - path: /ce/ca/google/load-balancing/external-forwarding-rule-http-proxy/prod.logic.yaml
    md5Hash: 435D8EEF249490E3C6AE7750DE3F7BD5
    content: |-
      ---
      inputType: "CA10__CaGoogleGceForwardingRule__c"
      importExtracts:
        - file: /types/CA10__CaGoogleGceForwardingRule__c/object.extracts.yaml
      recordTypes:
        - "caGoogleGceForwardingRuleGlobal"
        - "caGoogleGceForwardingRuleExternal"
      testData:
        - file: "test-data.json"
      conditions:
        - status: "INAPPLICABLE"
          currentStateMessage: "The policy applies only to external forwarding rules."
          check:
            NOT:
              arg:
                CONTAINS:
                  arg:
                    SET:
                      itemType: "TEXT"
                      items:
                        - "EXTERNAL"
                        - "EXTERNAL_MANAGED"
                  search:
                    EXTRACT: "CA10__loadBalancingScheme__c"
        - status: "INCOMPLIANT"
          currentStateMessage: "The external forwarding rule uses an HTTP instead of an HTTPS proxy."
          remediationMessage: "The forwarding rule should use a target HTTPS proxy to ensure traffic is encrypted."
          check:
            NOT_EMPTY:
              arg:
                EXTRACT: "CA10__targetHttpProxyUniqueId__c"
        - status: "COMPLIANT"
          currentStateMessage: "The external forwarding rule is configured to use an HTTPS proxy."
          check:
            NOT_EMPTY:
              arg:
                EXTRACT: "CA10__targetHttpsProxyUniqueId__c"
      otherwise:
        status: "INAPPLICABLE"
        currentStateMessage: "The forwarding rule targets a different type of resource."
  - path: /ce/ca/google/load-balancing/external-forwarding-rule-http-proxy/test-data.json
    md5Hash: C1024DAB296848AD5D3D90AFC993AFC6
    content: |-
      [
          {
              "expectedResult": {
                  "status": "DISAPPEARED",
                  "conditionIndex": "99",
                  "conditionText": "isDisappeared(CA10__disappearanceTime__c)",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-15T03:37:19Z"
              },
              "CA10__disappearanceTime__c": "2025-10-14T09:37:04Z",
              "CA10__loadBalancingScheme__c": "EXTERNAL",
              "CA10__targetHttpProxyUniqueId__c": "",
              "CA10__targetHttpsProxyUniqueId__c": "",
              "Id": "test1",
              "RecordTypeId": "RecordTypeId1",
              "RecordType": {
                  "DeveloperName": "caGoogleGceForwardingRuleExternal",
                  "Id": "RecordTypeId1"
              }
          },
          {
              "expectedResult": {
                  "status": "INAPPLICABLE",
                  "conditionIndex": "199",
                  "conditionText": "not(setOfText(['caGoogleGceForwardingRuleGlobal', 'caGoogleGceForwardingRuleExternal']).contains(RecordType.DeveloperName))",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-15T03:37:19Z"
              },
              "CA10__disappearanceTime__c": null,
              "CA10__loadBalancingScheme__c": "INTERNAL",
              "CA10__targetHttpProxyUniqueId__c": "",
              "CA10__targetHttpsProxyUniqueId__c": "",
              "Id": "test2",
              "RecordTypeId": "RecordTypeId2",
              "RecordType": {
                  "DeveloperName": "caGoogleGceForwardingRuleInternal",
                  "Id": "RecordTypeId2"
              }
          },
          {
              "expectedResult": {
                  "status": "INAPPLICABLE",
                  "conditionIndex": "299",
                  "conditionText": "not(setOfText(['EXTERNAL', 'EXTERNAL_MANAGED']).contains(extract('CA10__loadBalancingScheme__c')))",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-15T03:37:19Z"
              },
              "CA10__disappearanceTime__c": null,
              "CA10__loadBalancingScheme__c": "",
              "CA10__targetHttpProxyUniqueId__c": "",
              "CA10__targetHttpsProxyUniqueId__c": "",
              "Id": "test3",
              "RecordTypeId": "RecordTypeId3",
              "RecordType": {
                  "DeveloperName": "caGoogleGceForwardingRuleGlobal",
                  "Id": "RecordTypeId3"
              }
          },
          {
              "expectedResult": {
                  "status": "INCOMPLIANT",
                  "conditionIndex": "399",
                  "conditionText": "extract('CA10__targetHttpProxyUniqueId__c').isNotEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-15T03:37:19Z"
              },
              "CA10__disappearanceTime__c": null,
              "CA10__loadBalancingScheme__c": "EXTERNAL",
              "CA10__targetHttpProxyUniqueId__c": "targetHttpProxyUniqueId",
              "CA10__targetHttpsProxyUniqueId__c": "",
              "Id": "test4",
              "RecordTypeId": "RecordTypeId3",
              "RecordType": {
                  "DeveloperName": "caGoogleGceForwardingRuleGlobal",
                  "Id": "RecordTypeId3"
              }
          },
          {
              "expectedResult": {
                  "status": "COMPLIANT",
                  "conditionIndex": "499",
                  "conditionText": "extract('CA10__targetHttpsProxyUniqueId__c').isNotEmpty()",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-15T03:37:19Z"
              },
              "CA10__disappearanceTime__c": null,
              "CA10__loadBalancingScheme__c": "EXTERNAL",
              "CA10__targetHttpProxyUniqueId__c": "",
              "CA10__targetHttpsProxyUniqueId__c": "targetHttpsProxyUniqueId",
              "Id": "test5",
              "RecordTypeId": "RecordTypeId3",
              "RecordType": {
                  "DeveloperName": "caGoogleGceForwardingRuleGlobal",
                  "Id": "RecordTypeId3"
              }
          },
          {
              "expectedResult": {
                  "status": "INAPPLICABLE",
                  "conditionIndex": "500",
                  "conditionText": "otherwise",
                  "runtimeError": null
              },
              "context": {
                  "snapshotTime": "2025-10-15T03:37:19Z"
              },
              "CA10__disappearanceTime__c": null,
              "CA10__loadBalancingScheme__c": "EXTERNAL",
              "CA10__targetHttpProxyUniqueId__c": "",
              "CA10__targetHttpsProxyUniqueId__c": "",
              "Id": "test6",
              "RecordTypeId": "RecordTypeId1",
              "RecordType": {
                  "DeveloperName": "caGoogleGceForwardingRuleExternal",
                  "Id": "RecordTypeId1"
              }
          }
      ]
  - path: /types/CA10__CaGoogleGceForwardingRule__c/object.extracts.yaml
    md5Hash: BE18BDBE6D507613F938DAE80D0901D0
    content: "---\nextracts:\n# Nullable. Text.\n  - name: \"CA10__loadBalancingScheme__c\"\
      \n    value: \n      FIELD:\n        path: \"CA10__loadBalancingScheme__c\"\n\
      # Nullable. Text.\n  - name: \"CA10__targetHttpProxyUniqueId__c\"\n    value:\
      \ \n      FIELD:\n        path: \"CA10__targetHttpProxyUniqueId__c\"\n# Nullable.\
      \ Text.\n  - name: \"CA10__targetHttpsProxyUniqueId__c\"\n    value: \n    \
      \  FIELD:\n        path: \"CA10__targetHttpsProxyUniqueId__c\"\n"
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" : "test1",
    "expectedResult" : {
      "status" : "DISAPPEARED",
      "conditionIndex" : "99",
      "conditionText" : "isDisappeared(CA10__disappearanceTime__c)",
      "runtimeError" : null
    }
  }, {
    "Id" : "test2",
    "expectedResult" : {
      "status" : "INAPPLICABLE",
      "conditionIndex" : "199",
      "conditionText" : "not(setOfText(['caGoogleGceForwardingRuleGlobal', 'caGoogleGceForwardingRuleExternal']).contains(RecordType.DeveloperName))",
      "runtimeError" : null
    }
  }, {
    "Id" : "test3",
    "expectedResult" : {
      "status" : "INAPPLICABLE",
      "conditionIndex" : "299",
      "conditionText" : "not(setOfText(['EXTERNAL', 'EXTERNAL_MANAGED']).contains(extract('CA10__loadBalancingScheme__c')))",
      "runtimeError" : null
    }
  }, {
    "Id" : "test4",
    "expectedResult" : {
      "status" : "INCOMPLIANT",
      "conditionIndex" : "399",
      "conditionText" : "extract('CA10__targetHttpProxyUniqueId__c').isNotEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test5",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : "499",
      "conditionText" : "extract('CA10__targetHttpsProxyUniqueId__c').isNotEmpty()",
      "runtimeError" : null
    }
  }, {
    "Id" : "test6",
    "expectedResult" : {
      "status" : "INAPPLICABLE",
      "conditionIndex" : "500",
      "conditionText" : "otherwise",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaGoogleGceForwardingRule__c()
  RETURNS ARRAY<STRUCT<
      CA10__disappearanceTime__c TIMESTAMP,
      CA10__loadBalancingScheme__c STRING,
      CA10__targetHttpProxyUniqueId__c STRING,
      CA10__targetHttpsProxyUniqueId__c STRING,
      Id STRING,
      RecordTypeId STRING,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2025-10-15T03:37:19Z")
    },
    "CA10__disappearanceTime__c" : new Date("2025-10-14T09:37:04Z"),
    "CA10__loadBalancingScheme__c" : "EXTERNAL",
    "CA10__targetHttpProxyUniqueId__c" : "",
    "CA10__targetHttpsProxyUniqueId__c" : "",
    "Id" : "test1",
    "RecordTypeId" : "RecordTypeId1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-15T03:37:19Z")
    },
    "CA10__loadBalancingScheme__c" : "INTERNAL",
    "CA10__targetHttpProxyUniqueId__c" : "",
    "CA10__targetHttpsProxyUniqueId__c" : "",
    "Id" : "test2",
    "RecordTypeId" : "RecordTypeId2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-15T03:37:19Z")
    },
    "CA10__loadBalancingScheme__c" : "",
    "CA10__targetHttpProxyUniqueId__c" : "",
    "CA10__targetHttpsProxyUniqueId__c" : "",
    "Id" : "test3",
    "RecordTypeId" : "RecordTypeId3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-15T03:37:19Z")
    },
    "CA10__loadBalancingScheme__c" : "EXTERNAL",
    "CA10__targetHttpProxyUniqueId__c" : "targetHttpProxyUniqueId",
    "CA10__targetHttpsProxyUniqueId__c" : "",
    "Id" : "test4",
    "RecordTypeId" : "RecordTypeId3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-15T03:37:19Z")
    },
    "CA10__loadBalancingScheme__c" : "EXTERNAL",
    "CA10__targetHttpProxyUniqueId__c" : "",
    "CA10__targetHttpsProxyUniqueId__c" : "targetHttpsProxyUniqueId",
    "Id" : "test5",
    "RecordTypeId" : "RecordTypeId3"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-15T03:37:19Z")
    },
    "CA10__loadBalancingScheme__c" : "EXTERNAL",
    "CA10__targetHttpProxyUniqueId__c" : "",
    "CA10__targetHttpsProxyUniqueId__c" : "",
    "Id" : "test6",
    "RecordTypeId" : "RecordTypeId1"
  } ];
  """;

  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("2025-10-15T03:37:19Z")
    },
    "DeveloperName" : "caGoogleGceForwardingRuleExternal",
    "Id" : "RecordTypeId1"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-15T03:37:19Z")
    },
    "DeveloperName" : "caGoogleGceForwardingRuleInternal",
    "Id" : "RecordTypeId2"
  }, {
    "context" : {
      "snapshotTime" : new Date("2025-10-15T03:37:19Z")
    },
    "DeveloperName" : "caGoogleGceForwardingRuleGlobal",
    "Id" : "RecordTypeId3"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaGoogleGceForwardingRule__c(
      obj STRUCT<
          CA10__disappearanceTime__c TIMESTAMP,
          CA10__loadBalancingScheme__c STRING,
          CA10__targetHttpProxyUniqueId__c STRING,
          CA10__targetHttpsProxyUniqueId__c STRING,
          Id STRING,
          RecordTypeId STRING,
          RecordType STRUCT<
              DeveloperName STRING,
              Id STRING
          >
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
  var CollectionLib = new function () {
      this.parse = function(arg, separator, skipEmpty, skipDuplicates, sort, normalize) {
          if (arg == null) return [];
          let parts = arg.split(separator);
          return this.fromArray(parts, skipEmpty, skipDuplicates, sort, normalize);
      };
      this.fromArray = function(arr, skipEmpty, skipDuplicates, sort, normalize) {
          if (arr == null) return [];
          let result = [];
          let seen = new Set();
          arr.forEach(el => {
              let normalized = normalize ? TextLib.normalize(el) : BytesLib.normalize(el);
              if (!skipEmpty || (normalize ? TextLib.isNotEmpty(el) : BytesLib.isNotEmpty(el))) {
                  if (!skipDuplicates || !seen.has(normalized)) {
                      if (skipDuplicates) seen.add(normalized);
                      result.push(normalized);
                  }
              }
          });
          if (sort) result.sort();
          return result;
      };
      this.equal = function(left, right) {
          left = left == null ? [] : left;
          right = right == null ? [] : right;
          if (left.length !== right.length) return false;
          for (let i = 0; i < left.length; i++) {
              if (left[i] !== right[i]) return false;
          }
          return true;
      };
      this.notEqual = function(left, right) {
          return !this.equal(left, right);
      };
      this.size = function(collection) {
          return collection == null ? 0 : collection.length;
      };
      this.startsWith = function(collection, search, normalize) {
          if (collection == null || collection.length === 0) return false;
          let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search);
          return collection[0] === normalizedSearch;
      };
      this.endsWith = function(collection, search, normalize) {
          if (collection == null || collection.length === 0) return false;
          let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search);
          return collection[collection.length - 1] === normalizedSearch;
      };
      this.contains = function(collection, search, normalize) {
          if (collection == null || collection.length === 0) return false;
          return collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search));
      };
      this.containsAll = function(collection, searchArray, normalize) {
          if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false;
          return searchArray.every(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)));
      };
      this.containsAny = function(collection, searchArray, normalize) {
          if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false;
          return searchArray.some(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)));
      };
  }();
  var BytesLib = new function () {
      this.normalize = function(arg) {
          return arg == null ? '' : arg;
      };
      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));
      };
      this.containsAll = function(arg, substrings) {
          if (substrings == null || substrings.length === 0) return false;
          let normalizedArg = this.normalize(arg);
          return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
      };
      this.containsAny = function(arg, substrings) {
          if (substrings == null || substrings.length === 0) return false;
          let normalizedArg = this.normalize(arg);
          return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
      };
  }();
  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));
      };
      this.containsAll = function(arg, substrings) {
          if (substrings == null || substrings.length === 0) return false;
          let normalizedArg = this.normalize(arg);
          return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
      };
      this.containsAny = function(arg, substrings) {
          if (substrings == null || substrings.length === 0) return false;
          let normalizedArg = this.normalize(arg);
          return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
      };
  }();
      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(['caGoogleGceForwardingRuleGlobal', 'caGoogleGceForwardingRuleExternal'], true, true, true, true), obj.RecordType.DeveloperName, true)) {
          return {status: 'INAPPLICABLE', conditionIndex: 199, conditionText: "not(setOfText(['caGoogleGceForwardingRuleGlobal', 'caGoogleGceForwardingRuleExternal']).contains(RecordType.DeveloperName))", currentStateMessage: "Object record type is not applicable", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      function extract4() { if (!this.out) { this.out = obj.CA10__loadBalancingScheme__c; } return this.out; };
      references1.push('Load Balancing Scheme [obj.CA10__loadBalancingScheme__c]: ' + obj.CA10__loadBalancingScheme__c);
      if (!CollectionLib.contains(CollectionLib.fromArray(['EXTERNAL', 'EXTERNAL_MANAGED'], true, true, true, true), extract4.call(extract4), true)) {
          return {status: 'INAPPLICABLE', conditionIndex: 299, conditionText: "not(setOfText(['EXTERNAL', 'EXTERNAL_MANAGED']).contains(extract('CA10__loadBalancingScheme__c')))", currentStateMessage: "The policy applies only to external forwarding rules.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[3], conditionIndex:[300..399]
      function extract7() { if (!this.out) { this.out = obj.CA10__targetHttpProxyUniqueId__c; } return this.out; };
      references1.push('Target HTTP Proxy Unique ID [obj.CA10__targetHttpProxyUniqueId__c]: ' + obj.CA10__targetHttpProxyUniqueId__c);
      if (TextLib.isNotEmpty(extract7.call(extract7))) {
          return {status: 'INCOMPLIANT', conditionIndex: 399, conditionText: "extract('CA10__targetHttpProxyUniqueId__c').isNotEmpty()", currentStateMessage: "The external forwarding rule uses an HTTP instead of an HTTPS proxy.", currentStateReferences: references1.join('\n'), remediation: "The forwarding rule should use a target HTTPS proxy to ensure traffic is encrypted.", runtimeError: null};
      }
      // condition[4], conditionIndex:[400..499]
      function extract10() { if (!this.out) { this.out = obj.CA10__targetHttpsProxyUniqueId__c; } return this.out; };
      references1.push('Target HTTPS Proxy Unique ID [obj.CA10__targetHttpsProxyUniqueId__c]: ' + obj.CA10__targetHttpsProxyUniqueId__c);
      if (TextLib.isNotEmpty(extract10.call(extract10))) {
          return {status: 'COMPLIANT', conditionIndex: 499, conditionText: "extract('CA10__targetHttpsProxyUniqueId__c').isNotEmpty()", currentStateMessage: "The external forwarding rule is configured to use an HTTPS proxy.", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INAPPLICABLE', conditionIndex: 500, conditionText: "otherwise", currentStateMessage: "The forwarding rule targets a different type of resource.", 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.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
          sObject.CA10__loadBalancingScheme__c AS CA10__loadBalancingScheme__c,
          sObject.CA10__targetHttpProxyUniqueId__c AS CA10__targetHttpProxyUniqueId__c,
          sObject.CA10__targetHttpsProxyUniqueId__c AS CA10__targetHttpsProxyUniqueId__c,
          sObject.Id AS Id,
          sObject.RecordTypeId AS RecordTypeId,
          STRUCT (
              `RecordType`.DeveloperName AS DeveloperName,
              `RecordType`.Id AS Id
          ) AS RecordType,
          process_CA10__CaGoogleGceForwardingRule__c(
              STRUCT(
                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
                  sObject.CA10__loadBalancingScheme__c AS CA10__loadBalancingScheme__c,
                  sObject.CA10__targetHttpProxyUniqueId__c AS CA10__targetHttpProxyUniqueId__c,
                  sObject.CA10__targetHttpsProxyUniqueId__c AS CA10__targetHttpsProxyUniqueId__c,
                  sObject.Id AS Id,
                  sObject.RecordTypeId AS RecordTypeId,
                  STRUCT (
                      `RecordType`.DeveloperName AS DeveloperName,
                      `RecordType`.Id AS Id
                  ) AS RecordType
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaGoogleGceForwardingRule__c()) AS sObject
      LEFT JOIN UNNEST(mock_RecordType()) AS `RecordType`
          ON sObject.RecordTypeId = `RecordType`.Id
  ) sObject ON sObject.Id = expectedResult.Id;
