{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/acronis/main/json-schema/acronis-batch-usage-list-schema.json",
  "title": "batchUsageList",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acronis-tenants-api-openapi.yml#/components/schemas/batchUsageList",
  "type": "object",
  "required": [
    "items"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "tenant",
          "usages"
        ],
        "properties": {
          "tenant": {
            "$ref": "#/$defs/uuid"
          },
          "usages": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/usageOutput"
            }
          }
        }
      }
    }
  },
  "$defs": {
    "item1": {
      "description": "RFC3339 Formatted date.",
      "type": "string",
      "pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([\\+\\-]\\d{2}\\:\\d{2})?",
      "minLength": 19,
      "maxLength": 32
    },
    "measurementUnits": {
      "description": "Measurement unit in which offering item's usages are kept.",
      "enum": [
        "bytes",
        "quantity",
        "seconds",
        "n/a"
      ],
      "type": "string"
    },
    "offeringItemType": {
      "enum": [
        "count",
        "feature",
        "infra"
      ],
      "type": "string"
    },
    "quota": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "overage",
        "version"
      ],
      "properties": {
        "value": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "overage": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "version": {
          "description": "Version of the quota. Equals to 0 if `value` and `overage` are `null`. Otherwise, contains the version number.",
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "usageOutput": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "application_id",
        "name",
        "edition",
        "usage_name",
        "type",
        "measurement_unit",
        "range_start",
        "value"
      ],
      "properties": {
        "application_id": {
          "$ref": "#/$defs/uuid"
        },
        "name": {
          "type": "string"
        },
        "edition": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "usage_name": {
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/offeringItemType"
        },
        "measurement_unit": {
          "$ref": "#/$defs/measurementUnits"
        },
        "infra_id": {
          "$ref": "#/$defs/uuid"
        },
        "tenant_uuid": {
          "$ref": "#/$defs/uuid"
        },
        "tenant_id": {
          "type": "integer"
        },
        "range_start": {
          "$ref": "#/$defs/item1"
        },
        "absolute_value": {
          "type": "integer",
          "minimum": 0
        },
        "value": {
          "type": "integer",
          "minimum": 0
        },
        "offering_item": {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "integer"
            },
            "quota": {
              "$ref": "#/$defs/quota"
            }
          }
        }
      }
    },
    "uuid": {
      "type": "string",
      "pattern": "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}",
      "minLength": 36,
      "maxLength": 36
    }
  }
}