{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-arc/json-schema/microsoft-azure-arc-license-schema.json",
  "title": "License",
  "description": "Describes a license in a hybrid machine.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-arc-licenses-api-openapi.yml#/components/schemas/License",
  "type": "object",
  "properties": {
    "properties": {
      "$ref": "#/$defs/LicenseProperties",
      "description": "Hybrid Compute License properties",
      "x-ms-client-flatten": true
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/TrackedResource"
    }
  ],
  "$defs": {
    "LicenseCoreType": {
      "type": "string",
      "description": "Describes the license core type (pCore or vCore).",
      "enum": [
        "pCore",
        "vCore"
      ],
      "x-ms-enum": {
        "name": "LicenseCoreType",
        "modelAsString": true,
        "values": [
          {
            "name": "pCore",
            "value": "pCore",
            "description": "pCore"
          },
          {
            "name": "vCore",
            "value": "vCore",
            "description": "vCore"
          }
        ]
      }
    },
    "LicenseDetails": {
      "type": "object",
      "description": "Describes the properties of a License.",
      "properties": {
        "state": {
          "$ref": "#/$defs/LicenseState",
          "description": "Describes the state of the license."
        },
        "target": {
          "$ref": "#/$defs/LicenseTarget",
          "description": "Describes the license target server."
        },
        "edition": {
          "$ref": "#/$defs/LicenseEdition",
          "description": "Describes the edition of the license. The values are either Standard or Datacenter."
        },
        "type": {
          "$ref": "#/$defs/LicenseCoreType",
          "description": "Describes the license core type (pCore or vCore)."
        },
        "processors": {
          "type": "integer",
          "format": "int32",
          "description": "Describes the number of processors."
        },
        "assignedLicenses": {
          "type": "integer",
          "format": "int32",
          "description": "Describes the number of assigned licenses.",
          "readOnly": true
        },
        "immutableId": {
          "type": "string",
          "description": "Describes the immutable id.",
          "readOnly": true
        },
        "volumeLicenseDetails": {
          "type": "array",
          "description": "A list of volume license details.",
          "items": {
            "$ref": "#/$defs/VolumeLicenseDetails"
          }
        }
      }
    },
    "LicenseEdition": {
      "type": "string",
      "description": "Describes the edition of the license. The values are either Standard or Datacenter.",
      "enum": [
        "Standard",
        "Datacenter"
      ],
      "x-ms-enum": {
        "name": "LicenseEdition",
        "modelAsString": true,
        "values": [
          {
            "name": "Standard",
            "value": "Standard",
            "description": "Standard"
          },
          {
            "name": "Datacenter",
            "value": "Datacenter",
            "description": "Datacenter"
          }
        ]
      }
    },
    "LicenseProperties": {
      "type": "object",
      "description": "Describes the properties of a License Profile.",
      "properties": {
        "provisioningState": {
          "$ref": "#/$defs/ProvisioningState",
          "description": "The provisioning state, which only appears in the response.",
          "readOnly": true
        },
        "tenantId": {
          "type": "string",
          "description": "Describes the tenant id."
        },
        "licenseType": {
          "$ref": "#/$defs/LicenseType",
          "description": "The type of the license resource."
        },
        "licenseDetails": {
          "$ref": "#/$defs/LicenseDetails",
          "description": "Describes the properties of a License."
        }
      }
    },
    "LicenseState": {
      "type": "string",
      "description": "Describes the state of the license.",
      "enum": [
        "Activated",
        "Deactivated"
      ],
      "x-ms-enum": {
        "name": "LicenseState",
        "modelAsString": true,
        "values": [
          {
            "name": "Activated",
            "value": "Activated",
            "description": "Activated"
          },
          {
            "name": "Deactivated",
            "value": "Deactivated",
            "description": "Deactivated"
          }
        ]
      }
    },
    "LicenseTarget": {
      "type": "string",
      "description": "Describes the license target server.",
      "enum": [
        "Windows Server 2012",
        "Windows Server 2012 R2",
        "Windows Server 2016"
      ],
      "x-ms-enum": {
        "name": "LicenseTarget",
        "modelAsString": true,
        "values": [
          {
            "name": "Windows Server 2012",
            "value": "Windows Server 2012",
            "description": "Windows Server 2012"
          },
          {
            "name": "Windows Server 2012 R2",
            "value": "Windows Server 2012 R2",
            "description": "Windows Server 2012 R2"
          },
          {
            "name": "Windows Server 2016",
            "value": "Windows Server 2016",
            "description": "Windows Server 2016 license target."
          }
        ]
      }
    },
    "LicenseType": {
      "type": "string",
      "description": "The type of the license resource.",
      "enum": [
        "ESU"
      ],
      "x-ms-enum": {
        "name": "LicenseType",
        "modelAsString": true,
        "values": [
          {
            "name": "ESU",
            "value": "ESU",
            "description": "ESU"
          }
        ]
      }
    },
    "ProgramYear": {
      "type": "string",
      "description": "Describes the program year the volume license is for.",
      "enum": [
        "Year 1",
        "Year 2",
        "Year 3"
      ],
      "x-ms-enum": {
        "name": "ProgramYear",
        "modelAsString": true,
        "values": [
          {
            "name": "Year 1",
            "value": "Year 1",
            "description": "Year 1"
          },
          {
            "name": "Year 2",
            "value": "Year 2",
            "description": "Year 2"
          },
          {
            "name": "Year 3",
            "value": "Year 3",
            "description": "Year 3"
          }
        ]
      }
    },
    "ProvisioningState": {
      "type": "string",
      "description": "The provisioning state, which only appears in the response.",
      "enum": [
        "Creating",
        "Updating",
        "Deleting",
        "Succeeded",
        "Failed",
        "Accepted",
        "Canceled",
        "Deleted"
      ],
      "x-ms-enum": {
        "name": "ProvisioningState",
        "modelAsString": true,
        "values": [
          {
            "name": "Creating",
            "value": "Creating",
            "description": "Creating"
          },
          {
            "name": "Updating",
            "value": "Updating",
            "description": "Updating"
          },
          {
            "name": "Deleting",
            "value": "Deleting",
            "description": "Deleting"
          },
          {
            "name": "Succeeded",
            "value": "Succeeded",
            "description": "Succeeded"
          },
          {
            "name": "Failed",
            "value": "Failed",
            "description": "Failed"
          },
          {
            "name": "Accepted",
            "value": "Accepted",
            "description": "Accepted"
          },
          {
            "name": "Canceled",
            "value": "Canceled",
            "description": "Canceled"
          },
          {
            "name": "Deleted",
            "value": "Deleted",
            "description": "Deleted"
          }
        ]
      }
    },
    "TrackedResource": {
      "type": "object",
      "title": "Tracked Resource",
      "description": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'",
      "properties": {
        "tags": {
          "type": "object",
          "description": "Resource tags.",
          "additionalProperties": {
            "type": "string"
          },
          "x-ms-mutability": [
            "read",
            "create",
            "update"
          ]
        },
        "location": {
          "type": "string",
          "description": "The geo-location where the resource lives",
          "x-ms-mutability": [
            "read",
            "create"
          ]
        }
      },
      "required": [
        "location"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/Resource"
        }
      ]
    },
    "VolumeLicenseDetails": {
      "type": "object",
      "properties": {
        "programYear": {
          "$ref": "#/$defs/ProgramYear",
          "description": "Describes the program year the volume license is for."
        },
        "invoiceId": {
          "type": "string",
          "description": "The invoice id for the volume license."
        }
      }
    }
  }
}