{ "$schema":                  "https://json-schema.org/draft/2020-12/schema",
  "$id":                      "https://schemas.mpai.community/MMM4/V2.2/data/Licence.json",
  "title":                    "Licence V2.2",
  "type":                     "object",
  "additionalProperties":     false,
  "required":                 [ "Header", "LicenceID", "LicensorID", "LicenseeID", "LicensorRights", "LicenseeRights" ],
  "properties":               {

    "Header":                 { "type": "string", "const": "MMM-LIC-V2.2" },
    "MInstanceID":            { "type": "string", "minLength": 1 },
    "MEnvironmentID":         { "type": "string" },
    "LicenceID":              { "type": "string", "minLength": 1 },
    "LicenceTime":            { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SimpleTime.json" },
    "LicenceIssuanceTime":    { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SimpleTime.json" },
    "LicenceDuration":        { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SimpleTime.json" },

    "LicenceStatus":          { "type": "string", "enum": ["Model", "Final" ] },

    "LicensorID":             { "type": "string", "minLength": 1 },
    "LicenseeID":             { "type": "string", "minLength": 1 },
    "ServiceProviderID":      { "type": "string" },

    "LicensorRights":         { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Rights.json" },
    "LicenseeRights":         { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Rights.json" },

    "IsRootLicence":          { "type": "boolean", "default": true, "description": "True for the root licence; False for subsequent licences." },

    "ThirdPartyID":           { "type": "string", "enum": ["THIRD-PARTY-DUMMY"], "description": "Dummy third party identifier required for non-root licences." },

    "ThirdPartyRights":       { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Rights.json" },

    "NewLicenseeRights":      { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Rights.json" },

    "Transaction":            { "$ref": "https://schemas.mpai.community/MMM4/V2.2/data/Transaction.json" },

    "DataXMData":             { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json" },
    "DescrMetadata":          { "type": "string", "maxLength": 2048 } } }
