{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-promotion-search-result-schema.json",
  "title": "PromotionSearchResult",
  "description": "Document representing a promotion search result.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-promotions-api-openapi.yml#/components/schemas/PromotionSearchResult",
  "allOf": [
    {
      "$ref": "#/$defs/PaginatedSearchResult"
    }
  ],
  "properties": {
    "hits": {
      "description": "The sorted array of promotion search hits. Can be empty.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Promotion"
      }
    }
  },
  "type": "object",
  "required": [
    "hits"
  ],
  "$defs": {
    "BoolFilter": {
      "description": "Allows you to combine other filters into (possibly recursive) logical expression trees. A boolean filter is composed of a logical operator (`AND`, `OR`, `NOT`) and a list of filters that the operator relates to. Multiple filters can be negated with a single `NOT` operator, even when the filters are combined with the `AND` operator.",
      "type": "object",
      "properties": {
        "filters": {
          "description": "A list of filters that are logically combined by an operator.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Filter"
          }
        },
        "operator": {
          "description": "The logical operator that is used to combine the filters.",
          "enum": [
            "and",
            "or",
            "not"
          ],
          "type": "string"
        }
      },
      "required": [
        "operator"
      ],
      "additionalProperties": false
    },
    "BoolQuery": {
      "description": "A boolean query allows construction of full logical expression trees that are composed of other queries (usually term queries and text queries). A boolean query has three sets of clauses:\n  \n  - `must`, which combines as an `AND` operator.\n  - `should`, which combines as an `OR` operator.\n  - `must_not`, which combines as a `NOT` operator.\n  \nIf `must`, `mustNot`, or `should` appear in the same boolean query, they are combined logically using the `AND` operator. For example:\n\n    (must-1 AND must-1 AND ...)\n      AND (should-1 OR should-2 OR ...)\n      AND NOT (must_not-1 OR must_not-2 OR ...)\n",
      "type": "object",
      "properties": {
        "must": {
          "description": "List of queries to be evaluated as an `AND` operator.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        },
        "mustNot": {
          "description": "List of queries to be evaluated as a `NOT` operator.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        },
        "should": {
          "description": "List of queries to be evaluated as an `OR` operator.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Query"
          }
        }
      },
      "additionalProperties": false
    },
    "Campaign": {
      "description": "Document representing a campaign.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "properties": {
        "campaignId": {
          "$ref": "#/$defs/CampaignId"
        },
        "coupons": {
          "description": "The array of assigned coupon IDs, not sorted.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "creationDate": {
          "description": "Returns the value of attribute 'creationDate'.",
          "type": "string",
          "format": "date-time"
        },
        "customerGroups": {
          "description": "The array of assigned customer groups, not sorted.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "description": {
          "maxLength": 4000,
          "description": "The description of the campaign.",
          "type": "string"
        },
        "enabled": {
          "description": "The enabled flag for campaign.",
          "type": "boolean"
        },
        "endDate": {
          "description": "The date the scenario ends.",
          "type": "string",
          "format": "date-time"
        },
        "lastModified": {
          "description": "Returns the value of attribute 'lastModified'.",
          "type": "string",
          "format": "date-time"
        },
        "sourceCodeGroups": {
          "description": "The array of assigned source code groups, not sorted.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "startDate": {
          "description": "The date the scenario begins.",
          "type": "string",
          "format": "date-time"
        }
      },
      "type": "object",
      "required": [
        "campaignId"
      ]
    },
    "CampaignId": {
      "minLength": 1,
      "maxLength": 256,
      "description": "The ID of the campaign.",
      "type": "string"
    },
    "Field": {
      "description": "Name of the field. Might be a custom field name prefixed with c_.",
      "maxLength": 260,
      "type": "string"
    },
    "Filter": {
      "minProperties": 1,
      "maxProperties": 1,
      "description": "Contains a set of objects that define criteria used to select records. A filter can contain one of the following:\n  * `TermFilter`\n   - Matches records where a field (or fields) exactly matches some simple value (including `null`).\n  * `RangeFilter`\n   - Matches records where a field value lies within a specified range.\n  * `Range2Filter`\n   - Matches records in a specified range across fields.\n  * `QueryFilter`\n   - Matches records based on a query.\n  * `BoolFilter`\n   - Provides filtering of records using a set of filters combined using a logical operator.",
      "type": "object",
      "properties": {
        "boolFilter": {
          "$ref": "#/$defs/BoolFilter"
        },
        "queryFilter": {
          "$ref": "#/$defs/QueryFilter"
        },
        "range2Filter": {
          "$ref": "#/$defs/Range2Filter"
        },
        "rangeFilter": {
          "$ref": "#/$defs/RangeFilter"
        },
        "termFilter": {
          "$ref": "#/$defs/TermFilter"
        }
      },
      "additionalProperties": false
    },
    "FilteredQuery": {
      "description": "Allows to filter the result of a possibly complex query using a possibly complex filter.",
      "type": "object",
      "properties": {
        "filter": {
          "$ref": "#/$defs/Filter"
        },
        "query": {
          "$ref": "#/$defs/Query"
        }
      },
      "required": [
        "filter",
        "query"
      ],
      "additionalProperties": false
    },
    "MatchAllQuery": {
      "description": "Matches all documents (namespace and document type). This query comes in handy if you just want to filter a search result or really do not have any constraints.",
      "type": "object"
    },
    "NestedQuery": {
      "description": "Allows you to query nested documents that are part of a larger document. Say, for example, that you have a main product with variations in one big document, and you want to constrain a search to main products that have variations that match multiple constraints. \n\nA `NestedQuery` is only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation.\n",
      "type": "object",
      "properties": {
        "path": {
          "description": "The path to the nested document.",
          "type": "string",
          "maxLength": 2048
        },
        "query": {
          "$ref": "#/$defs/Query"
        },
        "scoreMode": {
          "description": "Indicates how scores for matching child objects affect the root parent document’s relevance score.",
          "enum": [
            "avg",
            "total",
            "max",
            "none"
          ],
          "type": "string"
        }
      },
      "required": [
        "path",
        "query"
      ],
      "additionalProperties": false
    },
    "Offset": {
      "default": 0,
      "minimum": 0,
      "format": "int32",
      "description": "The zero-based index of the first hit/data to include in the result.",
      "type": "integer"
    },
    "PaginatedResultBase": {
      "description": "Schema defining generic pageable result. Each response schema of a resource requiring pagination should extend this schema. \nIf you use this extend this schema directly, it needs to be defined what data is returned. Allowed names for the data field is `data`.",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/ResultBase"
        }
      ],
      "properties": {
        "offset": {
          "$ref": "#/$defs/Offset"
        }
      },
      "required": [
        "limit",
        "offset",
        "total"
      ]
    },
    "PaginatedSearchResult": {
      "description": "Document representing a generic search result. Each search resource should extend this to define what is returned in the `hits`.",
      "properties": {
        "query": {
          "$ref": "#/$defs/Query"
        },
        "sorts": {
          "description": "The sorting that was applied to the result.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Sort"
          }
        },
        "hits": {
          "description": "The sorted array of search hits. Can be empty.",
          "type": "array",
          "items": {
            "type": "object"
          }
        }
      },
      "allOf": [
        {
          "$ref": "#/$defs/PaginatedResultBase"
        }
      ],
      "type": "object",
      "required": [
        "query"
      ],
      "additionalProperties": false
    },
    "Promotion": {
      "description": "Document representing a promotion. Unless otherwise stated, attributes of this document are not supported when using\nthe Open Commerce API to update multiple promotions at once.",
      "additionalProperties": {
        "title": "Additional Property Support",
        "description": "This type supports additional properties passed along with the defined properties of this API.\nTo indicate that the properties were defined and expected to be handled as additional properties, they are expected to be prefixed with a `c_`.\nThe type will reject any property that does not fit this pattern, only allowing additional properties beginning with the known prefix."
      },
      "properties": {
        "archived": {
          "description": "Determines if this promotion is archived. This attribute is allowed to be updated when using the Open\n Commerce API to update multiple promotions at once.",
          "type": "boolean"
        },
        "assignmentInformation": {
          "description": "Information about the assignments and assignment schedules of this promotion.",
          "allOf": [
            {
              "$ref": "#/$defs/PromotionAssignmentInformation"
            }
          ]
        },
        "creationDate": {
          "description": "Returns the value of attribute 'creationDate'.",
          "type": "string",
          "format": "date-time"
        },
        "currencyCode": {
          "maxLength": 3,
          "description": "The ISO 4217 mnemonic code of the currency this promotion is restricted to. If not populated, then there is no\n currency restriction on the promotion.",
          "type": "string"
        },
        "disableGloballyExcluded": {
          "description": "Determines if this promotion ignores the global product exclusions for promotions.",
          "type": "boolean"
        },
        "enabled": {
          "description": "Determines if this promotion is enabled. This attribute is allowed to be updated when using the Open\n Commerce API to update multiple promotions at once.",
          "type": "boolean"
        },
        "exclusivity": {
          "description": "Determines if the promotion can be combined with other promotions of the same promotion class or if it cannot be\n combined with any other promotions. This attribute is allowed to be updated when using the Open Commerce API to\n update multiple promotions at once.",
          "enum": [
            "no",
            "class",
            "global"
          ],
          "type": "string"
        },
        "id": {
          "description": "The ID for the promotion.",
          "type": "string"
        },
        "lastModified": {
          "description": "Returns the value of attribute 'lastModified'.",
          "type": "string",
          "format": "date-time"
        },
        "name": {
          "description": "The user supplied name of this promotion, which can be localized.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "promotionClass": {
          "description": "The class of the promotion. If the promotion class is modified, then the promotion rule and all of its values,\n such as whether or not to disable global product exclusions, are reset.",
          "enum": [
            "product",
            "shipping",
            "order"
          ],
          "type": "string"
        },
        "tags": {
          "description": "Returns the list of tags assigned to this promotion. If used to set the tags on a promotion, the promotion will\n only have the tags passed in the input. Any existing tags are removed.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Tag"
          }
        }
      },
      "type": "object"
    },
    "PromotionAbtestGroupAssignment": {
      "additionalProperties": false,
      "properties": {
        "abtestDescription": {
          "type": "string"
        },
        "abtestId": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "schedule": {
          "$ref": "#/$defs/Schedule"
        },
        "segmentDescription": {
          "type": "string"
        },
        "segmentId": {
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "abtestDescription",
        "abtestId",
        "enabled",
        "schedule",
        "segmentDescription",
        "segmentId"
      ]
    },
    "PromotionAssignmentInformation": {
      "additionalProperties": false,
      "properties": {
        "abtestId": {
          "description": "If there is only one assignment, and that assignment is an A/B test segment, the ID of the A/B test the segment\nbelongs to. Otherwise, empty.",
          "type": "string"
        },
        "abtestSegmentId": {
          "description": "If there is only one assignment, and that assignment is an A/B test segment, the ID of the A/B test segment.\n Otherwise, empty.",
          "type": "string"
        },
        "active": {
          "description": "True if the individual assignment or the multiple assignments are currently active.",
          "type": "boolean"
        },
        "activeAbtestAssignments": {
          "description": "A list of currently active A/B tests this is assigned to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PromotionAbtestGroupAssignment"
          }
        },
        "activeCampaignAssignments": {
          "description": "A list of currently active campaigns this is assigned to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PromotionCampaignAssignment"
          }
        },
        "campaignId": {
          "description": "If there is only one assignment, and that assignment is a campaign, the ID of the campaign. Otherwise, empty.",
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "endDate": {
          "description": "The end date of the container of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null. Also, a null\n date returns null.",
          "type": "string",
          "format": "date-time"
        },
        "schedule": {
          "description": "The schedule of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null.",
          "allOf": [
            {
              "$ref": "#/$defs/Schedule"
            }
          ]
        },
        "scheduleType": {
          "description": "If there is only one active assignment, or no active assignments and one upcoming assignment, this is that type\n of assignment (scheduleType : \"campaign\" or scheduleType : \"abtest\"). If there are no\n assignments, it is scheduleType : \"none\", otherwise, scheduleType : \"multiple\".",
          "enum": [
            "none",
            "campaign",
            "abtest",
            "multiple"
          ],
          "type": "string"
        },
        "startDate": {
          "description": "The start date of the container of the assignment (a Campaign or ABTest). If scheduleType is\n scheduleType : \"multiple\" or scheduleType : \"none\", then then result is null. Also, a null\n date returns null.",
          "type": "string",
          "format": "date-time"
        },
        "upcomingAbtestAssignments": {
          "description": "A list of upcoming A/B tests this is assigned to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PromotionAbtestGroupAssignment"
          }
        },
        "upcomingCampaignAssignments": {
          "description": "A list of upcoming campaigns this is assigned to.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/PromotionCampaignAssignment"
          }
        }
      },
      "type": "object",
      "required": [
        "active",
        "activeCampaignAssignments",
        "campaignId",
        "enabled",
        "schedule",
        "scheduleType"
      ]
    },
    "PromotionCampaignAssignment": {
      "description": "Document representing a promotion campaign assignment.",
      "additionalProperties": false,
      "properties": {
        "campaign": {
          "description": "The campaign.",
          "allOf": [
            {
              "$ref": "#/$defs/Campaign"
            }
          ]
        },
        "campaignId": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The ID of the campaign.",
          "type": "string"
        },
        "coupons": {
          "description": "The sorted array of assigned coupon IDs.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "customerGroups": {
          "description": "The sorted array of assigned customer groups.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "description": {
          "maxLength": 4000,
          "description": "The description of the promotion campaign assignment.",
          "type": "string"
        },
        "enabled": {
          "description": "True if the assignment resource is enabled.",
          "type": "boolean"
        },
        "promotion": {
          "description": "The promotion.",
          "allOf": [
            {
              "$ref": "#/$defs/Promotion"
            }
          ]
        },
        "promotionId": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The ID of the promotion.",
          "type": "string"
        },
        "rank": {
          "format": "int32",
          "description": "The rank of promotion campaign assignment.",
          "type": "integer"
        },
        "schedule": {
          "description": "The schedule of the assignment resource.",
          "allOf": [
            {
              "$ref": "#/$defs/Schedule"
            }
          ]
        },
        "sourceCodeGroups": {
          "description": "The sorted array of assigned source code groups.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "type": "object",
      "required": [
        "campaignId",
        "description",
        "enabled",
        "promotionId",
        "schedule"
      ]
    },
    "Query": {
      "minProperties": 1,
      "maxProperties": 1,
      "description": "A set of objects that define criteria used to select records. A query can contain one of the following:\n* `MatchAllQuery`\n - Matches all documents.\n* `TermQuery`\n - Matches one or more documents against one or more document fields.\n* `TextQuery`\n - Matches text against one or more fields.\n* `BoolQuery`\n - Allows construction of a logical expression of multiple queries.\n* `FilteredQuery`\n - Allows a filter to be applied to a query.\n* `NestedQuery`\n - Allows you to query on nested documents.\n - _Only supported by some Commerce APIs. For more details, see the endpoint descriptions in the API documentation._",
      "type": "object",
      "properties": {
        "boolQuery": {
          "$ref": "#/$defs/BoolQuery"
        },
        "filteredQuery": {
          "$ref": "#/$defs/FilteredQuery"
        },
        "matchAllQuery": {
          "$ref": "#/$defs/MatchAllQuery"
        },
        "nestedQuery": {
          "$ref": "#/$defs/NestedQuery"
        },
        "termQuery": {
          "$ref": "#/$defs/TermQuery"
        },
        "textQuery": {
          "$ref": "#/$defs/TextQuery"
        }
      },
      "additionalProperties": false
    },
    "QueryFilter": {
      "description": "Wraps any query and allows it to be used as a filter.",
      "type": "object",
      "properties": {
        "query": {
          "$ref": "#/$defs/Query"
        }
      },
      "required": [
        "query"
      ]
    },
    "Range2Filter": {
      "description": "Allows you to restrict a search result to hits where a range defined by specified attributes has a certain relationship to a specified range.\n\nThe first range (R1) is defined by a pair of attributes (`fromField` and `toField`) that specify the extent of a range, such as attributes `validFrom` and `validTo`.\n\nThe second range (R2) is defined by `fromValue` and `toValue`.\n\nThe filter mode specifies the method used to compare the two ranges:\n\n* `overlap`: R1 overlaps fully or partially with R2.\n* `containing`: R1 contains R2.\n* `contained`: R1 is contained in R2.\n\nThe range filter supports several value types, and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended, but only at one end of the range. You can configure whether the lower bounds and upper bounds are inclusive or exclusive.\n\nA range 2 filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.",
      "type": "object",
      "properties": {
        "filterMode": {
          "default": "overlap",
          "description": "Compare mode: overlap, containing, or contained.",
          "enum": [
            "overlap",
            "containing",
            "contained"
          ],
          "type": "string"
        },
        "fromField": {
          "description": "The field name of the field that starts the first range.",
          "allOf": [
            {
              "$ref": "#/$defs/Field"
            }
          ]
        },
        "fromInclusive": {
          "default": true,
          "description": "A flag indicating if the lower bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.",
          "type": "boolean"
        },
        "fromValue": {
          "description": "The lower bound of the second range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended."
        },
        "toField": {
          "description": "The field name of the field that ends the first range.",
          "allOf": [
            {
              "$ref": "#/$defs/Field"
            }
          ]
        },
        "toInclusive": {
          "default": true,
          "description": "A flag indicating if the upper bound of the second range is inclusive. To make the lower bound exclusive, set to `false`.",
          "type": "boolean"
        },
        "toValue": {
          "description": "The upper bound of the second range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended."
        }
      },
      "required": [
        "fromField",
        "toField"
      ],
      "additionalProperties": false
    },
    "RangeFilter": {
      "description": "Allows you to restrict a search result to hits that have values for a given attribute that fall within a given value range. The range filter supports several value types and relies on the natural sorting of the value type for range interpretation. Value ranges can be open-ended, but only at one end of the range. You can configure whether the lower bounds and upper bounds are inclusive or exclusive.\n\nA range filter is useful for general restrictions that can be shared between searches (like a static date range) because the filter result is cached in memory. Range filters are not appropriate if the range is expected to be different for every query (for example, if the user controls the date range down to the hour via a UI control). Range filters are inclusive by default.",
      "type": "object",
      "properties": {
        "field": {
          "description": "The search field.",
          "allOf": [
            {
              "$ref": "#/$defs/Field"
            }
          ]
        },
        "from": {
          "oneOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            }
          ],
          "description": "The lower bound of the filter range. If not specified, the range is open-ended with respect to the lower bound. You can't leave both the lower and upper bounds open-ended."
        },
        "fromInclusive": {
          "default": true,
          "description": "A flag indicating if the lower bound of the range is inclusive. To make the lower bound exclusive, set to `false`.",
          "type": "boolean"
        },
        "to": {
          "oneOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "integer"
            },
            {
              "type": "number"
            }
          ],
          "description": "The upper bound of the filter range. If not specified, the range is open-ended with respect to the upper bound. You can't leave both the upper and lower bounds open-ended."
        },
        "toInclusive": {
          "default": true,
          "description": "A flag indicating if the upper bound of the range is inclusive. To make the upper bound exclusive, set to `false`.",
          "type": "boolean"
        }
      },
      "required": [
        "field"
      ]
    },
    "Recurrence": {
      "type": "object",
      "description": "Document representing a schedule recurrence.",
      "additionalProperties": false,
      "properties": {
        "dayOfWeek": {
          "description": "The days of week for recurrence.",
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "monday",
              "tuesday",
              "wednesday",
              "thursday",
              "friday",
              "saturday",
              "sunday"
            ]
          }
        },
        "timeOfDay": {
          "description": "The time of the day for recurrence.",
          "allOf": [
            {
              "$ref": "#/$defs/TimeOfDay"
            }
          ]
        }
      }
    },
    "ResultBase": {
      "description": "Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. \nAdditionally it needs to be defined what data is returned.",
      "type": "object",
      "required": [
        "limit",
        "total"
      ],
      "properties": {
        "limit": {
          "format": "int32",
          "description": "Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema.",
          "type": "integer"
        },
        "total": {
          "$ref": "#/$defs/Total"
        }
      }
    },
    "Schedule": {
      "type": "object",
      "description": "Document representing a time schedule. Defines an optional validity window (startDate/endDate) and an optional recurrence. Omitting a bound leaves that side of the window open (unbounded).",
      "additionalProperties": false,
      "properties": {
        "startDate": {
          "description": "The date to start validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.",
          "type": "string",
          "format": "date-time"
        },
        "endDate": {
          "description": "The date to end of validity. ISO8601 date time format: yyyy-MM-dd'T'HH:mm:ssZ.",
          "type": "string",
          "format": "date-time"
        },
        "recurrence": {
          "description": "The recurrence of the schedule by day of week and time of day. Not all schedules support a recurrence.",
          "allOf": [
            {
              "$ref": "#/$defs/Recurrence"
            }
          ]
        }
      }
    },
    "Sort": {
      "description": "Document representing a sort request. Each API has a different default sort configuration that can be modified in the request.",
      "type": "object",
      "properties": {
        "field": {
          "description": "The name of the field to sort on.",
          "type": "string",
          "maxLength": 256
        },
        "sortOrder": {
          "default": "asc",
          "description": "The sort order to be applied when sorting. When omitted, the default sort order (asc) is used.",
          "enum": [
            "asc",
            "desc"
          ],
          "type": "string"
        }
      },
      "required": [
        "field"
      ],
      "additionalProperties": false
    },
    "Tag": {
      "description": "Document representing a tag",
      "additionalProperties": false,
      "properties": {
        "tagId": {
          "description": "The ID of the tag.",
          "type": "string"
        }
      },
      "type": "object",
      "required": [
        "tagId"
      ]
    },
    "TermFilter": {
      "description": "Allows you to restrict a search result to hits that match exactly one of the values configured for the filter. A term filter is useful for general restrictions that can be shared between searches. Use term filters whenever the criteria you filter on is a shared property of multiple searches (for example, like filtering by an order status). Use term filters for fields that have a discrete and small set of values only.",
      "type": "object",
      "properties": {
        "field": {
          "description": "The filter field.",
          "allOf": [
            {
              "$ref": "#/$defs/Field"
            }
          ]
        },
        "operator": {
          "description": "The operator used to compare the field's values with the given values.",
          "enum": [
            "is",
            "one_of",
            "is_null",
            "is_not_null",
            "less",
            "greater",
            "not_in",
            "neq"
          ],
          "type": "string"
        },
        "values": {
          "description": "The filter values.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "field",
        "operator"
      ],
      "additionalProperties": false
    },
    "TermQuery": {
      "description": "A term query matches one or more values against one or more document fields. A document is considered a hit if one of the values matches exactly with at least one of the given fields. The operator `is` can only take one value, while `one_of` can take multiple values. If multiple fields are specified, they are combined using a logical `OR` operator.\n\n**Limitations:**\n\n* The `greater` and `less` operators are not supported under certain conditions. Both operators are permitted unless the API documentation states otherwise.\n* A subset of Commerce APIs handle queries with multiple fields differently. If the query has multiple fields, the query is internally handled as a logical `OR` of `DisjointMaxQueries` (with the dismax matching a value against all fields). The dismax makes sure that a document carrying a single term in multiple fields does not get higher scores than a document matching multiple terms in multiple fields.",
      "type": "object",
      "properties": {
        "fields": {
          "minItems": 1,
          "description": "The document fields that the values are matched against, combined with the operator.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Field"
          }
        },
        "operator": {
          "description": "Returns the operator to use for the term query.",
          "enum": [
            "is",
            "one_of",
            "is_null",
            "is_not_null",
            "less",
            "greater",
            "not_in",
            "neq"
          ],
          "type": "string"
        },
        "values": {
          "description": "The values that the fields are compared against, combined with the operator.",
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "integer"
              }
            ]
          }
        }
      },
      "required": [
        "fields",
        "operator"
      ]
    },
    "TextQuery": {
      "description": "A text query is used to match some text (for example, a search phrase possibly consisting of multiple terms) against one or more fields. When multiple fields are provided, the phrase conceptually forms a logical `OR` over the fields. In this case, the terms of the phrase basically have to match within the text, that would result in concatenating all given fields.",
      "type": "object",
      "properties": {
        "fields": {
          "minItems": 1,
          "description": "The document fields that the search phrase matches against.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Field"
          }
        },
        "searchPhrase": {
          "description": "A search phrase, which can include multiple terms separated by spaces.",
          "type": "string"
        }
      },
      "required": [
        "fields",
        "searchPhrase"
      ],
      "additionalProperties": false
    },
    "TimeOfDay": {
      "type": "object",
      "description": "Document representing a time schedule within a single day.",
      "additionalProperties": false,
      "properties": {
        "timeFrom": {
          "description": "The time to start from. Time format: HH:mm or HH:mm:ss. Seconds are ignored and set to 0.",
          "type": "string",
          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
        },
        "timeTo": {
          "description": "The time to end on. Time format: HH:mm or HH:mm:ss. Seconds are ignored and set to 0.",
          "type": "string",
          "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?$"
        }
      }
    },
    "Total": {
      "default": 0,
      "minimum": 0,
      "format": "int32",
      "description": "The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.",
      "type": "integer"
    }
  }
}