{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amber-electric/main/json-schema/amber-electric-actual-renewable-schema.json",
  "title": "ActualRenewable",
  "x-generated": "2026-10-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amber-electric-state-api-openapi.yml#/components/schemas/ActualRenewable",
  "allOf": [
    {
      "$ref": "#/$defs/Renewable"
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "ActualRenewable"
          ]
        }
      }
    }
  ],
  "$defs": {
    "Renewable": {
      "type": "object",
      "description": "Renewable data",
      "required": [
        "type",
        "duration",
        "date",
        "nemTime",
        "startTime",
        "endTime",
        "renewables",
        "descriptor"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "duration": {
          "type": "integer",
          "description": "Length of the interval in minutes.",
          "enum": [
            5,
            15,
            30
          ]
        },
        "date": {
          "type": "string",
          "description": "Date the interval belongs to (in NEM time). This may be different to the date component of nemTime, as the last interval of the day ends at 12:00 the following day. Formatted as a ISO 8601 date",
          "format": "date"
        },
        "nemTime": {
          "type": "string",
          "description": "The interval's NEM time. This represents the time at the end of the interval UTC+10. Formatted as a ISO 8601 time",
          "format": "date-time"
        },
        "startTime": {
          "type": "string",
          "description": "Start time of the interval in UTC. Formatted as a ISO 8601 time",
          "format": "date-time"
        },
        "endTime": {
          "type": "string",
          "description": "End time of the interval in UTC. Formatted as a ISO 8601 time",
          "format": "date-time"
        },
        "renewables": {
          "type": "number",
          "description": "Percentage of renewables in the grid",
          "minimum": 0,
          "maximum": 100
        },
        "descriptor": {
          "$ref": "#/$defs/RenewableDescriptor"
        }
      }
    },
    "RenewableDescriptor": {
      "type": "string",
      "description": "Describes the state of renewables. Gives you an indication of how green power is right now",
      "enum": [
        "best",
        "great",
        "ok",
        "notGreat",
        "worst"
      ]
    }
  }
}