{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iot-core/json-schema/amazon-iot-core-update-fleet-metric-request-schema.json",
  "title": "UpdateFleetMetricRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iot-core-fleet-metric-api-openapi.yml#/components/schemas/UpdateFleetMetricRequest",
  "type": "object",
  "properties": {
    "metricName": {
      "type": "string",
      "description": "The name of the fleet metric to update."
    },
    "queryString": {
      "type": "string",
      "description": "The search query string."
    },
    "aggregationType": {
      "$ref": "#/$defs/AggregationType"
    },
    "period": {
      "type": "integer",
      "description": "The time in seconds between fleet metric emissions. Range [60(1 min), 86400(1 day)] and must be multiple of 60."
    },
    "aggregationField": {
      "type": "string",
      "description": "The field to aggregate."
    },
    "description": {
      "type": "string",
      "description": "The description of the fleet metric."
    },
    "queryVersion": {
      "type": "string",
      "description": "The version of the query."
    },
    "indexName": {
      "type": "string",
      "description": "The name of the index to search."
    },
    "unit": {
      "type": "string",
      "enum": [
        "Seconds",
        "Microseconds",
        "Milliseconds",
        "Bytes",
        "Kilobytes",
        "Megabytes",
        "Gigabytes",
        "Terabytes",
        "Bits",
        "Kilobits",
        "Megabits",
        "Gigabits",
        "Terabits",
        "Percent",
        "Count",
        "Bytes/Second",
        "Kilobytes/Second",
        "Megabytes/Second",
        "Gigabytes/Second",
        "Terabytes/Second",
        "Bits/Second",
        "Kilobits/Second",
        "Megabits/Second",
        "Gigabits/Second",
        "Terabits/Second",
        "Count/Second",
        "None"
      ],
      "description": "Used to support unit transformation such as milliseconds to seconds. The unit must be supported by CW metric."
    },
    "expectedVersion": {
      "type": "integer",
      "description": "The expected version of the fleet metric record in the registry."
    }
  },
  "required": [
    "metricName",
    "indexName"
  ],
  "$defs": {
    "AggregationType": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "Statistics",
            "Percentiles",
            "Cardinality"
          ],
          "description": "The name of the aggregation type."
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of the values of aggregation types."
        }
      },
      "required": [
        "name"
      ]
    }
  }
}