{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/MetadataFilter",
  "title": "Metadata filter",
  "type": "object",
  "x-box-resource-id": "metadata_filter",
  "x-box-tag": "search",
  "description": "A metadata template to filter the search results by.",
  "properties": {
    "scope": {
      "description": "Specifies the scope of the template to filter search results by.\n\nThis will be `enterprise_{enterprise_id}` for templates defined\nfor use in this enterprise, and `global` for general templates\nthat are available to all enterprises using Box.",
      "type": "string",
      "example": "enterprise",
      "enum": [
        "global",
        "enterprise",
        "enterprise_{enterprise_id}"
      ]
    },
    "templateKey": {
      "description": "The key of the template to filter search results by.\n\nIn many cases the template key is automatically derived\nof its display name, for example `Contract Template` would\nbecome `contractTemplate`. In some cases the creator of the\ntemplate will have provided its own template key.\n\nPlease [list the templates for an enterprise][list], or\nget all instances on a [file][file] or [folder][folder]\nto inspect a template's key.\n\n[list]: e://get-metadata-templates-enterprise\n[file]: e://get-files-id-metadata\n[folder]: e://get-folders-id-metadata",
      "type": "string",
      "example": "contract"
    },
    "filters": {
      "allOf": [
        {
          "anyOf": [
            {
              "$ref": "#/components/schemas/MetadataFieldFilterString"
            },
            {
              "$ref": "#/components/schemas/MetadataFieldFilterFloat"
            },
            {
              "$ref": "#/components/schemas/MetadataFieldFilterMultiSelect"
            },
            {
              "$ref": "#/components/schemas/MetadataFieldFilterFloatRange"
            },
            {
              "$ref": "#/components/schemas/MetadataFieldFilterDateRange"
            }
          ]
        },
        {
          "description": "Specifies which fields on the template to filter the search\nresults by. When more than one field is specified, the query\nperforms a logical `AND` to ensure that the instance of the\ntemplate matches each of the fields specified."
        },
        {
          "example": {
            "category": "online",
            "contractValue": 1000000
          }
        }
      ]
    }
  }
}