{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-compute-engine/json-schema/google-cloud-compute-engine-capacity-history-response-schema.json",
  "title": "CapacityHistoryResponse",
  "description": "Contains the capacity history.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-compute-engine-advice-api-openapi.yml#/components/schemas/CapacityHistoryResponse",
  "properties": {
    "machineType": {
      "type": "string",
      "description": "The machine type for which the capacity history is returned."
    },
    "location": {
      "description": "Output only. The location (region or zone) for which the capacity history is returned.\nIt is returned as a URL - For example,https://www.googleapis.com/compute/v1/projects/project/zones/zone.",
      "type": "string",
      "readOnly": true
    },
    "preemptionHistory": {
      "items": {
        "$ref": "#/$defs/CapacityHistoryResponsePreemptionRecord"
      },
      "description": "The preemption history for the requested machine type and location.",
      "type": "array"
    },
    "priceHistory": {
      "items": {
        "$ref": "#/$defs/CapacityHistoryResponsePriceRecord"
      },
      "type": "array",
      "description": "The price history for the requested machine type and location."
    }
  },
  "type": "object",
  "$defs": {
    "CapacityHistoryResponsePreemptionRecord": {
      "properties": {
        "interval": {
          "$ref": "#/$defs/Interval",
          "description": "The time interval for this preemption record."
        },
        "preemptionRate": {
          "description": "The preemption rate during the interval, representing the fraction of\nSpot VMs that were preempted. Range: 0.0 to 1.0. Preemption rate is\ncalculated as (total preempted Spots) / (total Spots that stopped\nrunning).",
          "format": "double",
          "type": "number"
        }
      },
      "type": "object",
      "description": "A record of Spot VM preemption history."
    },
    "CapacityHistoryResponsePriceRecord": {
      "type": "object",
      "properties": {
        "listPrice": {
          "$ref": "#/$defs/Money",
          "description": "The Spot VM list price during the interval."
        },
        "interval": {
          "$ref": "#/$defs/Interval",
          "description": "The time interval for this price record."
        }
      },
      "description": "A record of price history."
    },
    "Interval": {
      "type": "object",
      "properties": {
        "endTime": {
          "format": "google-datetime",
          "description": "Optional. Exclusive end of the interval.\n\nIf specified, a Timestamp matching this interval will have to be before the\nend.",
          "type": "string"
        },
        "startTime": {
          "description": "Optional. Inclusive start of the interval.\n\nIf specified, a Timestamp matching this interval will have to be the same\nor after the start.",
          "format": "google-datetime",
          "type": "string"
        }
      },
      "description": "Represents a time interval, encoded as a Timestamp start (inclusive) and a\nTimestamp end (exclusive).\n\nThe start must be less than or equal to the end.\nWhen the start equals the end, the interval is empty (matches no time).\nWhen both start and end are unspecified, the interval matches any time."
    },
    "Money": {
      "properties": {
        "nanos": {
          "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.",
          "format": "int32",
          "type": "integer"
        },
        "currencyCode": {
          "description": "The three-letter currency code defined in ISO 4217.",
          "type": "string"
        },
        "units": {
          "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.",
          "format": "int64",
          "type": "string"
        }
      },
      "type": "object",
      "description": "Represents an amount of money with its currency type."
    }
  }
}