{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.mp.microsoft.com/schema/listing/2022-03-01-preview5",
  "title": "Listing resource schemas",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://schema.mp.microsoft.com/schema/resource/2022-07-01"
    },
    {
      "oneOf": [
        {
          "$ref": "#/$defs/azureVirtualMachine"
        },
        {
          "$ref": "#/$defs/azureSoftwareAsAService"
        },
        {
          "$ref": "#/$defs/azureContainer"
        },
        {
          "$ref": "#/$defs/azureCoreVM"
        },
        {
          "$ref": "#/$defs/xbox360NonBackCompat"
        }
      ]
    }
  ],
  "$defs": {
    "https://schema.mp.microsoft.com/schema/resource-lifecycle-state/2022-07-01": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/resource-lifecycle-state/2022-07-01",
      "type": "string",
      "$comment": "deleted only if in draft and never published. Deprecated replaces StopSold",
      "enum": [
        "notAvailable",
        "neverUsed",
        "test",
        "preview",
        "generallyAvailable",
        "deprecated",
        "decommissioned",
        "deleted"
      ]
    },
    "https://schema.mp.microsoft.com/schema/resource-reference/2022-07-01": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/resource-reference/2022-07-01",
      "oneOf": [
        {
          "$ref": "https://schema.mp.microsoft.com/schema/durable-id/2022-07-01"
        },
        {
          "type": "object",
          "properties": {
            "externalId": {
              "description": "ExternalId for product and plan references. Property reference must be named product or plan.",
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9-_]{2,49}$",
              "minLength": 3,
              "maxLength": 50,
              "$example": {
                "plan": {
                  "externalId": "customerNamedPlan123"
                }
              }
            }
          },
          "required": [
            "externalId"
          ]
        },
        {
          "type": "object",
          "properties": {
            "resourceName": {
              "description": "Resource Name that can be referenced using this value by another resource.",
              "type": "string",
              "pattern": "^[a-zA-Z0-9-_]\u002B$",
              "minLength": 1,
              "maxLength": 50,
              "$example": {
                "plan": {
                  "resourceName": "resourcePlan1"
                }
              }
            }
          },
          "required": [
            "resourceName"
          ]
        }
      ]
    },
    "https://schema.mp.microsoft.com/schema/resource/2022-07-01": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/resource/2022-07-01",
      "$comment": "This schema is extended by a resource type schema. We allow additional properties to enable that",
      "type": "object",
      "properties": {
        "resourceName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        },
        "id": {
          "$ref": "https://schema.mp.microsoft.com/schema/durable-id/2022-07-01"
        },
        "validations": {
          "type": "array",
          "items": {
            "$ref": "https://schema.mp.microsoft.com/schema/validation/2022-07-01"
          },
          "readonly": true
        }
      },
      "required": [
        "$schema"
      ],
      "additionalProperties": true
    },
    "https://schema.mp.microsoft.com/schema/durable-id/2022-07-01": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/durable-id/2022-07-01",
      "description": "A durable-id to an existing resource.",
      "type": "string",
      "pattern": "^[a-z](-?[a-z0-9]\u002B)*/[a-z0-9-]\u002B(\\/?[a-z0-9-])*$"
    },
    "https://schema.mp.microsoft.com/schema/validation/2022-07-01": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/validation/2022-07-01",
      "allOf": [
        {
          "$ref": "https://schema.mp.microsoft.com/schema/inner-error/2022-07-01"
        },
        {
          "properties": {
            "$schema": {
              "$ref": "https://schema.mp.microsoft.com/schema/schema-uri/2022-07-01"
            },
            "level": {
              "type": "string",
              "enum": [
                "informational",
                "warning"
              ]
            }
          },
          "required": [
            "level"
          ]
        }
      ]
    },
    "https://schema.mp.microsoft.com/schema/inner-error/2022-07-01": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/inner-error/2022-07-01",
      "type": "object",
      "properties": {
        "resourceId": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-07-01"
        },
        "code": {
          "type": "string",
          "readOnly": true,
          "enum": [
            "businessValidationError",
            "collectionLimitExceeded",
            "invalidId",
            "invalidEntityStatus",
            "invalidRequest",
            "invalidResource",
            "invalidState",
            "notDeployed",
            "notSupported",
            "operationCanceled",
            "productLocked",
            "resourceNotFound",
            "schemaValidationError"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "$ref": "https://schema.mp.microsoft.com/schema/inner-error/2022-07-01"
          }
        }
      },
      "required": [
        "code"
      ]
    },
    "https://schema.mp.microsoft.com/schema/schema-uri/2022-07-01": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/schema-uri/2022-07-01",
      "title": "Product Ingestion schema uri",
      "type": "string",
      "pattern": "^https://schema\\.mp.microsoft\\.com/schema/[a-z][a-z0-9]\u002B(?:-[a-z0-9]\u002B)*/\\d{4}(?:-\\d\\d){2}(-preview\\d\u002B)?$"
    },
    "azureContainer": {
      "type": "object",
      "required": [
        "kind",
        "product",
        "languageId"
      ],
      "properties": {
        "$schema": {},
        "id": {},
        "lifecycleState": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-lifecycle-state/2022-07-01",
          "default": "generallyAvailable",
          "enum": [
            "generallyAvailable",
            "deleted"
          ]
        },
        "resourceName": {},
        "kind": {
          "const": "azureContainer"
        },
        "product": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-07-01"
        },
        "languageId": {
          "type": "string",
          "minLength": 0,
          "maxLength": 10
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 200
        },
        "searchResultSummary": {
          "type": "string"
        },
        "shortDescription": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "generalLinks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/generalLink"
          }
        },
        "privacyPolicyLink": {
          "type": "string"
        },
        "globalSupportWebsite": {
          "type": "string"
        },
        "governmentSupportWebsite": {
          "type": "string"
        },
        "cloudSolutionProviderMarketingMaterials": {
          "type": "string"
        },
        "supportContact": {
          "$ref": "#/$defs/contact"
        },
        "engineeringContact": {
          "$ref": "#/$defs/contact"
        },
        "cloudSolutionProviderContact": {
          "$ref": "#/$defs/contact"
        }
      },
      "additionalProperties": false
    },
    "azureCoreVM": {
      "type": "object",
      "required": [
        "kind",
        "product",
        "languageId"
      ],
      "properties": {
        "$schema": {},
        "id": {},
        "lifecycleState": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-lifecycle-state/2022-07-01",
          "default": "generallyAvailable",
          "enum": [
            "generallyAvailable",
            "deleted"
          ]
        },
        "resourceName": {},
        "kind": {
          "const": "azureCoreVM"
        },
        "product": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-07-01"
        },
        "languageId": {
          "type": "string",
          "minLength": 0,
          "maxLength": 10
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 200
        },
        "searchResultSummary": {
          "type": "string"
        },
        "shortDescription": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "generalLinks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/generalLink"
          }
        },
        "privacyPolicyLink": {
          "type": "string"
        },
        "globalSupportWebsite": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "azureSoftwareAsAService": {
      "type": "object",
      "required": [
        "kind",
        "product",
        "languageId"
      ],
      "properties": {
        "$schema": {},
        "id": {},
        "lifecycleState": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-lifecycle-state/2022-07-01",
          "default": "generallyAvailable",
          "enum": [
            "generallyAvailable",
            "deleted"
          ]
        },
        "resourceName": {},
        "kind": {
          "const": "azureSaaS"
        },
        "product": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-07-01"
        },
        "languageId": {
          "type": "string",
          "minLength": 0,
          "maxLength": 10
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 200
        },
        "searchResultSummary": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "gettingStartedInstructions": {
          "type": "string"
        },
        "searchKeywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "generalLinks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/generalLink"
          }
        },
        "privacyPolicyLink": {
          "type": "string"
        },
        "globalSupportWebsite": {
          "type": "string"
        },
        "governmentSupportWebsite": {
          "type": "string"
        },
        "cloudSolutionProviderMarketingMaterials": {
          "type": "string"
        },
        "supportContact": {
          "$ref": "#/$defs/supportContact"
        },
        "engineeringContact": {
          "$ref": "#/$defs/contact"
        },
        "cloudSolutionProviderContact": {
          "$ref": "#/$defs/contact"
        }
      },
      "additionalProperties": false
    },
    "azureVirtualMachine": {
      "type": "object",
      "required": [
        "kind",
        "product",
        "languageId"
      ],
      "properties": {
        "$schema": {},
        "id": {},
        "lifecycleState": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-lifecycle-state/2022-07-01",
          "default": "generallyAvailable",
          "enum": [
            "generallyAvailable",
            "deleted"
          ]
        },
        "resourceName": {},
        "kind": {
          "const": "azureVM"
        },
        "product": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-07-01"
        },
        "languageId": {
          "type": "string",
          "minLength": 0,
          "maxLength": 10
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 200
        },
        "searchResultSummary": {
          "type": "string"
        },
        "shortDescription": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "generalLinks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/generalLink"
          }
        },
        "privacyPolicyLink": {
          "type": "string"
        },
        "globalSupportWebsite": {
          "type": "string"
        },
        "governmentSupportWebsite": {
          "type": "string"
        },
        "cloudSolutionProviderMarketingMaterials": {
          "type": "string"
        },
        "supportContact": {
          "$ref": "#/$defs/contact"
        },
        "engineeringContact": {
          "$ref": "#/$defs/contact"
        },
        "cloudSolutionProviderContact": {
          "$ref": "#/$defs/contact"
        }
      },
      "additionalProperties": false
    },
    "contact": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "pattern": "^$|^[A-Za-z0-9-_\\.=\u002B]\u002B@[A-Za-z0-9-]\u002B[\\.][A-Za-z0-9-\\.]*[A-Za-z0-9]$"
        },
        "phone": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "generalLink": {
      "type": "object",
      "required": [
        "displayText",
        "link"
      ],
      "properties": {
        "displayText": {
          "type": "string"
        },
        "link": {
          "type": "string",
          "pattern": "^(http|https)://"
        }
      },
      "additionalProperties": false
    },
    "supportContact": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "pattern": "^$|^[A-Za-z0-9-_\\.=\u002B]\u002B@[A-Za-z0-9-]\u002B[\\.][A-Za-z0-9-\\.]*[A-Za-z0-9]$"
        },
        "phone": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "pattern": "^(http|https)://"
        }
      },
      "additionalProperties": false
    },
    "xbox360NonBackCompat": {
      "type": "object",
      "required": [
        "kind",
        "product",
        "languageId"
      ],
      "properties": {
        "$schema": {},
        "id": {},
        "resourceName": {},
        "kind": {
          "const": "xbox360NonBackCompat"
        },
        "product": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-07-01",
          "$comment": "Resource ref to product"
        },
        "languageId": {
          "type": "string",
          "minLength": 0,
          "maxLength": 10
        },
        "title": {
          "type": "string",
          "minLength": 0,
          "maxLength": 200
        },
        "description": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}