{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.mp.microsoft.com/schema/container-plan-technical-configuration/2022-03-01-preview3",
  "title": "Container Plan Technical Configuration",
  "description": "Container plan technical configurations.",
  "allOf": [
    {
      "$ref": "https://schema.mp.microsoft.com/schema/resource/2022-03-01-preview2"
    },
    {
      "type": "object",
      "required": [
        "product",
        "plan"
      ],
      "properties": {
        "product": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-03-01-preview2"
        },
        "plan": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-03-01-preview2"
        }
      }
    },
    {
      "oneOf": [
        {
          "$ref": "https://schema.mp.microsoft.com/schema/container-cnab-plan-technical-configuration-properties/2022-03-01-preview3"
        },
        {
          "$ref": "https://schema.mp.microsoft.com/schema/container-image-plan-technical-configuration-properties/2022-03-01-preview3"
        }
      ]
    }
  ],
  "$defs": {
    "https://schema.mp.microsoft.com/schema/resource/2022-03-01-preview2": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/resource/2022-03-01-preview2",
      "$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-03-01-preview2"
        },
        "validations": {
          "type": "array",
          "items": {
            "$ref": "https://schema.mp.microsoft.com/schema/validation/2022-03-01-preview2"
          },
          "readonly": true
        }
      },
      "required": [
        "$schema"
      ],
      "additionalProperties": true
    },
    "https://schema.mp.microsoft.com/schema/resource-reference/2022-03-01-preview2": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/resource-reference/2022-03-01-preview2",
      "oneOf": [
        {
          "$ref": "https://schema.mp.microsoft.com/schema/durable-id/2022-03-01-preview2"
        },
        {
          "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/container-cnab-plan-technical-configuration-properties/2022-03-01-preview3": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/container-cnab-plan-technical-configuration-properties/2022-03-01-preview3",
      "title": "List-and-Sell Container Plan Technical Configuration Properties",
      "description": "List-and-sell container plan technical configuration properties.",
      "type": "object",
      "required": [
        "payloadType",
        "clusterExtensionType",
        "cnabReferences"
      ],
      "properties": {
        "payloadType": {
          "type": "string",
          "const": "cnab"
        },
        "clusterExtensionType": {
          "type": "string",
          "minLength": 1,
          "maxLength": 50,
          "pattern": "^[a-zA-Z\\.-]{1,50}$"
        },
        "cnabReferences": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "tenantId",
              "subscriptionId",
              "resourceGroupName",
              "registryName",
              "repositoryName",
              "tag",
              "digest"
            ],
            "properties": {
              "tenantId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 36,
                "pattern": "^[({]?[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12}[})]?$"
              },
              "subscriptionId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 36,
                "pattern": "^[({]?[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12}[})]?$"
              },
              "resourceGroupName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "registryName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "repositoryName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "tag": {
                "type": "string",
                "minLength": 1
              },
              "digest": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "pattern": "^[a-z0-9]\u002B([\u002B._\\-][a-z0-9]\u002B)*:[a-zA-Z0-9=_\\-]\u002B$"
              }
            },
            "additionalProperties": false
          }
        }
      }
    },
    "https://schema.mp.microsoft.com/schema/container-image-plan-technical-configuration-properties/2022-03-01-preview3": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/container-image-plan-technical-configuration-properties/2022-03-01-preview3",
      "title": "List-Only Container Plan Technical Configuration Properties",
      "description": "List-only container plan technical configuration properties.",
      "type": "object",
      "required": [
        "payloadType",
        "imageRepositoryDetails",
        "imageTags"
      ],
      "properties": {
        "payloadType": {
          "type": "string",
          "const": "image"
        },
        "imageRepositoryDetails": {
          "type": "object",
          "required": [
            "subscriptionId",
            "resourceGroupName",
            "registryName",
            "userName",
            "password"
          ],
          "properties": {
            "subscriptionId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 36,
              "pattern": "^[({]?[a-fA-F0-9]{8}[-]?([a-fA-F0-9]{4}[-]?){3}[a-fA-F0-9]{12}[})]?$"
            },
            "resourceGroupName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "registryName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "userName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "password": {
              "oneOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "not": {
                    "const": "*********"
                  }
                },
                {
                  "$ref": "https://schema.mp.microsoft.com/schema/masked-secret/2022-03-01-preview2"
                }
              ]
            },
            "repositoryName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "additionalProperties": false
        },
        "imageTags": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        }
      }
    },
    "https://schema.mp.microsoft.com/schema/durable-id/2022-03-01-preview2": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/durable-id/2022-03-01-preview2",
      "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-03-01-preview2": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/validation/2022-03-01-preview2",
      "allOf": [
        {
          "$ref": "https://schema.mp.microsoft.com/schema/inner-error/2022-03-01-preview2"
        },
        {
          "properties": {
            "$schema": {
              "$ref": "https://schema.mp.microsoft.com/schema/schema-uri/2022-03-01-preview2"
            },
            "level": {
              "type": "string",
              "enum": [
                "informational",
                "warning"
              ]
            }
          },
          "required": [
            "level"
          ]
        }
      ]
    },
    "https://schema.mp.microsoft.com/schema/inner-error/2022-03-01-preview2": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/inner-error/2022-03-01-preview2",
      "type": "object",
      "properties": {
        "resourceId": {
          "$ref": "https://schema.mp.microsoft.com/schema/resource-reference/2022-03-01-preview2"
        },
        "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-03-01-preview2"
          }
        }
      },
      "required": [
        "code"
      ]
    },
    "https://schema.mp.microsoft.com/schema/schema-uri/2022-03-01-preview2": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/schema-uri/2022-03-01-preview2",
      "title": "Product Ingestion schema uri",
      "type": "string",
      "pattern": "^https://(schema(-int)?\\.mp\\.microsoft\\.com)|(product-ingestion(-int)?\\.azureedge\\.net)/schema/[a-z][a-z0-9]\u002B(?:-[a-z0-9]\u002B)*/\\d{4}(?:-\\d\\d){2}(?:-dev|-preview\\d\u002B)?$"
    },
    "https://schema.mp.microsoft.com/schema/masked-secret/2022-03-01-preview2": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "$id": "https://schema.mp.microsoft.com/schema/masked-secret/2022-03-01-preview2",
      "type": "string",
      "const": "*********",
      "readOnly": true
    }
  }
}