---
extracts:
# TEST
  - name: "CA10Z1__name__c"
    value:
      FIELD:
        path: "CA10Z1__name__c"

# Nullable. Text.
  - name: "CA10Z1__policySettings__c"
    value:
      FIELD:
        path: "CA10Z1__policySettings__c"
        returnType: BYTES
# Nullable.
  - name: "caJsonFrom__policySettings__c"
    value:
      JSON_FROM:
        arg:
          EXTRACT: "CA10Z1__policySettings__c"
        undeterminedIf:
          isInvalid: "Policy Settings JSON is invalid"
# Number. RequestBodyCheck status.
  - name: "caJsonBoolean__policySettingsRequestBodyCheck__c"
    value: 
      JSON_QUERY_BOOLEAN:
        arg: 
          EXTRACT: "caJsonFrom__policySettings__c"
        expression: "requestBodyCheck"
        undeterminedIf: 
          evaluationError: "The JSON query has failed."
          resultTypeMismatch: "The JSON query did not return a boolean type."
# Nullable. Text.
  - name: "CA10Z1__managedRulesDefinition__c"
    value:
      FIELD:
        path: "CA10Z1__managedRulesDefinition__c"
        returnType: BYTES
# Nullable.
  - name: "caJsonFrom__managedRulesDefinition__c"
    value:
      JSON_FROM:
        arg:
          EXTRACT: "CA10Z1__managedRulesDefinition__c"
        undeterminedIf:
          isInvalid: "Managed Rules Definition JSON is invalid"
# Namber of "MicrosoftBotManagerRuleSet".
  - name: "caJsonFrom__managedRulesDefinitionMicrosoftBotManagerRuleSetCount__c"
    value: 
      JSON_QUERY_NUMBER:
        arg: 
          EXTRACT: "caJsonFrom__managedRulesDefinition__c"
        expression: "length(managedRuleSets[?ruleSetType == 'Microsoft_BotManagerRuleSet'])"
        undeterminedIf: 
          evaluationError: "The JSON query has failed."
          resultTypeMismatch: "The JSON query did not return a number type."
# Number of "ruleGroupOverrides"
  - name: "caJsonFrom__managedRulesDefinitionMicrosoftBotManagerRuleSetRuleGroupOverridesCount__c"
    value: 
      JSON_QUERY_NUMBER:
        arg: 
          EXTRACT: "caJsonFrom__managedRulesDefinition__c"
        expression: "length(managedRuleSets[?ruleSetType == 'Microsoft_BotManagerRuleSet'].ruleGroupOverrides[])"
        undeterminedIf: 
          evaluationError: "The JSON query has failed."
          resultTypeMismatch: "The JSON query did not return a number type." 
# Boolean. ruleGroupOverrides for ruleGroupName "BadBots" with state Disabled
  - name: "caJsonFrom__managedRulesDefinitionMicrosoftBotManagerRuleSetRuleGroupOverridesBadBotsRulesDisabledExist__c"
    value: 
      JSON_QUERY_BOOLEAN:
        arg: 
          EXTRACT: "caJsonFrom__managedRulesDefinition__c"
        expression: "managedRuleSets[?ruleSetType == 'Microsoft_BotManagerRuleSet'].ruleGroupOverrides[] | contains([?ruleGroupName == 'BadBots'].rules[].state, 'Disabled')"
        undeterminedIf: 
          evaluationError: "The JSON query has failed."
          resultTypeMismatch: "The JSON query did not return a boolean type."
