{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cisco-catalyst-center/json-schema/cisco-catalyst-center-issues-trend-analytics-request-schema.json",
  "title": "IssuesTrendAnalyticsRequest",
  "description": "The input payload to query Trend Analytics Issue data.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cisco-catalyst-center-issues-api-openapi.yml#/components/schemas/IssuesTrendAnalyticsRequest",
  "required": [
    "trendInterval"
  ],
  "type": "object",
  "properties": {
    "trendInterval": {
      "$ref": "#/$defs/IssuesTrendInterval"
    },
    "groupBy": {
      "maxItems": 2,
      "type": "array",
      "items": {
        "$ref": "#/$defs/IssuesAnalyticsGroupByKey"
      }
    },
    "filters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/IssuesFilter"
      }
    },
    "attributes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/IssuesAnalyticsAttributeKey"
      }
    },
    "aggregateAttributes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/IssuesAnalyticsAggregateAttribute"
      }
    },
    "page": {
      "$ref": "#/$defs/IssuesPaginationWithTrendRequest"
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/startAndEndTime"
    }
  ],
  "$defs": {
    "IssuesAnalyticsAggregateAttribute": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/IssuesAnalyticsAggregateAttributeKey"
        },
        "function": {
          "$ref": "#/$defs/IssuesAnalyticsFunction"
        }
      }
    },
    "IssuesAnalyticsAggregateAttributeKey": {
      "type": "string",
      "description": "Field name on which the aggregate function should be applied when querying the data.",
      "enum": [
        "issueId",
        "deviceId",
        "floorId",
        "buildingId",
        "areaId",
        "outdoorId"
      ]
    },
    "IssuesAnalyticsAttributeKey": {
      "type": "string",
      "enum": [
        "areaName",
        "buildingName",
        "floorName",
        "outdoorName",
        "siteHierarchy",
        "siteHierarchyId",
        "displayName",
        "firstOccurredTime",
        "mostRecentOccurredTime"
      ]
    },
    "IssuesAnalyticsFunction": {
      "type": "string",
      "description": "Name of the aggregate function that should be applied when querying the data.",
      "enum": [
        "distinctCount"
      ]
    },
    "IssuesAnalyticsGroupByKey": {
      "type": "string",
      "description": "Field names which are supported as groupBy in Summary, TopN and Trend Aanalytics API",
      "enum": [
        "priority",
        "deviceType",
        "deviceFamily",
        "category",
        "status",
        "entityType",
        "severity",
        "name",
        "floorId",
        "buildingId",
        "areaId",
        "outdoorId",
        "entityId"
      ]
    },
    "IssuesFilter": {
      "type": "object",
      "properties": {
        "key": {
          "$ref": "#/$defs/IssuesFilterAttribute"
        },
        "operator": {
          "$ref": "#/$defs/IssuesOperator"
        },
        "logicalOperator": {
          "$ref": "#/$defs/LogicalOperator"
        },
        "value": {
          "type": "object",
          "description": "Field value(s) to filter the data set. Array of values is used for   \"in\" or \"out\" operator. Values will be of whatever type the   specific field being filtered is defined with.\n\nFor other operators, filter value is of whatever type the specific   field being filtered is defined with.\n\nIn the case of an \"and\" or \"or\" operator, this values array will be   ignored, and the values arrays in each of the *nested filters*   will be used.\n"
        },
        "filters": {
          "type": "array",
          "description": "Nested array of filters in case of AND/OR based filters. Only one   level of nesting will be supported.\n\nStructure of nested filter is the same as parent with all operators   supported except AND or OR.\n",
          "items": {
            "$ref": "#/$defs/IssuesFilter"
          }
        }
      },
      "description": "In case of single filter, please use `key`, `operator` and `value` combination. If multiple filters need to be applied using a logical   operation, please use `logicalOperator` and populate the list of `filters`. Filters can be nested to build complex queries.\n"
    },
    "IssuesFilterAttribute": {
      "type": "string",
      "description": "Field names which are supported by this API as filter keys",
      "enum": [
        "issueId",
        "name",
        "priority",
        "severity",
        "status",
        "entityType",
        "entityId",
        "deviceType",
        "deviceFamily",
        "category",
        "isGlobal",
        "siteHierarchy",
        "siteHierarchyId",
        "siteId",
        "fabricSiteId",
        "fabricVnName",
        "fabricTransitSiteId",
        "updatedBy",
        "networkDeviceId",
        "networkDeviceIpAddress",
        "macAddress",
        "aiDriven",
        "fabricDriven",
        "fabricSiteDriven",
        "fabricVnDriven",
        "fabricTransitDriven"
      ]
    },
    "IssuesOperator": {
      "type": "string",
      "description": "Type of filter operator to use for querying data | in and out operator takes multiple values and applies the filters",
      "enum": [
        "in",
        "neq",
        "eq",
        "notIn",
        "like"
      ]
    },
    "IssuesPaginationWithTrendRequest": {
      "type": "object",
      "properties": {
        "limit": {
          "minimum": 1,
          "type": "integer",
          "description": "Number of records to be returned in response",
          "default": 100
        },
        "offset": {
          "minimum": 1,
          "type": "integer",
          "description": "Starting offset of data to fetch and returned",
          "default": 1
        },
        "timestampOrder": {
          "type": "string",
          "description": "The sort order of the timestamp can be either ascending or descending",
          "enum": [
            "asc",
            "desc"
          ]
        }
      }
    },
    "IssuesTrendInterval": {
      "type": "string",
      "description": "The time window to aggregate the issues data.\n",
      "enum": [
        "15MIN",
        "30MIN",
        "1HOUR",
        "4HOUR"
      ]
    },
    "LogicalOperator": {
      "type": "string",
      "description": "Operator to use when attempting to apply a logical conjunction of more   than 1 filter\n\nLogical operations include: 'and', 'or'.\n",
      "enum": [
        "and",
        "or"
      ]
    },
    "startAndEndTime": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "integer",
          "description": "Start time from which the API queries the dataset related to the resource. It must be specified in terms of milliseconds since UNIX epoch. Value is inclusive.\n\nIf `startTime` is not provided, API will default to current time.\n",
          "format": "int64"
        },
        "endTime": {
          "type": "integer",
          "description": "End time to which the API queries the dataset related to the resource. It must be specified in terms of milliseconds since UNIX epoch. Value is inclusive.\n\nIf `endTime` is not provided, API will default to current time.\n",
          "format": "int64"
        }
      },
      "description": "start and end time of data set to query. Data is aggregated   based on time window and timestamped with window start time. | For example - 1. When data events falls in a 5 minute window from 12-13-2023 11:25 PM to 12-13-2023 11:30 PM the timestamp of the aggregated data is 12-13-2023 11:25 PM - 1702509900000 (Unix epochtime). If user needs data from 12-13-2023 11:25 PM to 12-13-2023 11:30 PM user must use below timestamps | startTime = 1702509900000 (12-13-2023 11:25 PM) | endTime = 1702510199000 (12-13-2023 11:29:59 PM) | 2. When data to be queried is for 3 hours period from 12-13-2023 08:30 PM to 12-13-2023 11:30 PM. User must use below timestamps | startTime = 1702528200000 (12-13-2023 08:30 PM) | endTime = 1702510199000 (12-13-2023 11:29:59 PM) | 2. When data to be queried is for 24 hours period from 12-12-2023 11:30 PM to 12-13-2023 11:30 PM. User must use below timestamps | startTime = 1702423800000 (12-12-2023 11:30 PM) | endTime = 1702510199000 (12-13-2023 11:29:59 PM) | 3. When data to be queried is for 7 days period from 12-06-2023 11:30 PM to 12-13-2023 11:30 PM. User must use below timestamps | startTime = 1701905400000 (12-06-2023 11:30 PM) | endTime = 1702510199000 (12-13-2023 11:29:59 PM)"
    }
  }
}