{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-q/json-schema/amazon-q-search-message-templates-request-schema.json",
  "title": "SearchMessageTemplatesRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-q-search-api-openapi.yml#/components/schemas/SearchMessageTemplatesRequest",
  "type": "object",
  "properties": {
    "knowledgeBaseId": {
      "type": "string",
      "description": "The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN."
    },
    "searchExpression": {
      "$ref": "#/$defs/MessageTemplateSearchExpression"
    },
    "nextToken": {
      "type": "string",
      "description": "The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results."
    },
    "maxResults": {
      "type": "integer",
      "description": "The maximum number of results to return per page."
    }
  },
  "required": [
    "knowledgeBaseId",
    "searchExpression"
  ],
  "$defs": {
    "MessageTemplateFilterField": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the attribute field to filter the message templates by."
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The values of attribute field to filter the message template by."
        },
        "operator": {
          "type": "string",
          "description": "The operator to use for filtering."
        },
        "includeNoExistence": {
          "type": "boolean",
          "description": "Whether to treat null value as a match for the attribute field."
        }
      },
      "required": [
        "name",
        "operator"
      ]
    },
    "MessageTemplateOrderField": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the message template."
        },
        "order": {
          "type": "string",
          "description": "The order at which the message templates are sorted by."
        }
      },
      "required": [
        "name"
      ]
    },
    "MessageTemplateQueryField": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the attribute to query the message templates by."
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The values of the attribute to query the message templates by."
        },
        "operator": {
          "type": "string",
          "description": "The operator to use for matching attribute field values in the query."
        },
        "allowFuzziness": {
          "type": "boolean",
          "description": "Whether the query expects only exact matches on the attribute field values. The results of the query will only include exact matches if this parameter is set to false."
        },
        "priority": {
          "type": "string",
          "description": "The importance of the attribute field when calculating query result relevancy scores. The value set for this parameter affects the ordering of search results."
        }
      },
      "required": [
        "name",
        "values",
        "operator"
      ]
    },
    "MessageTemplateSearchExpression": {
      "type": "object",
      "properties": {
        "queries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MessageTemplateQueryField"
          },
          "description": "The message template query expressions."
        },
        "filters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MessageTemplateFilterField"
          },
          "description": "The configuration of filtering rules applied to message template query results."
        },
        "orderOnField": {
          "$ref": "#/$defs/MessageTemplateOrderField"
        }
      }
    }
  }
}