{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-test-labs/json-schema/azure-test-labs-custom-image-fragment-schema.json",
  "title": "CustomImageFragment",
  "description": "A custom image.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-test-labs-customimages-api-openapi.yml#/components/schemas/CustomImageFragment",
  "allOf": [
    {
      "$ref": "#/$defs/UpdateResource"
    }
  ],
  "properties": {
    "properties": {
      "$ref": "#/$defs/CustomImagePropertiesFragment",
      "description": "The properties of the resource.",
      "x-ms-client-flatten": true
    }
  },
  "type": "object",
  "$defs": {
    "CustomImagePropertiesCustomFragment": {
      "description": "Properties for creating a custom image from a VHD.",
      "properties": {
        "imageName": {
          "description": "The image name.",
          "type": "string"
        },
        "osType": {
          "description": "The OS type of the custom image (i.e. Windows, Linux)",
          "enum": [
            "Windows",
            "Linux",
            "None"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "CustomImageOsType"
          }
        },
        "sysPrep": {
          "description": "Indicates whether sysprep has been run on the VHD.",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "CustomImagePropertiesFragment": {
      "description": "Properties of a custom image.",
      "properties": {
        "author": {
          "description": "The author of the custom image.",
          "type": "string"
        },
        "customImagePlan": {
          "$ref": "#/$defs/CustomImagePropertiesFromPlanFragment",
          "description": "Storage information about the plan related to this custom image"
        },
        "dataDiskStorageInfo": {
          "description": "Storage information about the data disks present in the custom image",
          "items": {
            "$ref": "#/$defs/DataDiskStorageTypeInfoFragment"
          },
          "type": "array"
        },
        "description": {
          "description": "The description of the custom image.",
          "type": "string"
        },
        "isPlanAuthorized": {
          "description": "Whether or not the custom images underlying offer/plan has been enabled for programmatic deployment",
          "type": "boolean"
        },
        "managedImageId": {
          "description": "The Managed Image Id backing the custom image.",
          "type": "string"
        },
        "managedSnapshotId": {
          "description": "The Managed Snapshot Id backing the custom image.",
          "type": "string"
        },
        "vhd": {
          "$ref": "#/$defs/CustomImagePropertiesCustomFragment",
          "description": "The VHD from which the image is to be created."
        },
        "vm": {
          "$ref": "#/$defs/CustomImagePropertiesFromVmFragment",
          "description": "The virtual machine from which the image is to be created."
        }
      },
      "type": "object"
    },
    "CustomImagePropertiesFromPlanFragment": {
      "description": "Properties for plan on a custom image.",
      "properties": {
        "id": {
          "description": "The id of the plan, equivalent to name of the plan",
          "type": "string"
        },
        "offer": {
          "description": "The offer for the plan from the marketplace image the custom image is derived from",
          "type": "string"
        },
        "publisher": {
          "description": "The publisher for the plan from the marketplace image the custom image is derived from",
          "type": "string"
        }
      },
      "type": "object"
    },
    "CustomImagePropertiesFromVmFragment": {
      "description": "Properties for creating a custom image from a virtual machine.",
      "properties": {
        "linuxOsInfo": {
          "$ref": "#/$defs/LinuxOsInfoFragment",
          "description": "The Linux OS information of the VM."
        },
        "sourceVmId": {
          "description": "The source vm identifier.",
          "type": "string"
        },
        "windowsOsInfo": {
          "$ref": "#/$defs/WindowsOsInfoFragment",
          "description": "The Windows OS information of the VM."
        }
      },
      "type": "object"
    },
    "DataDiskStorageTypeInfoFragment": {
      "description": "Storage information about the data disks present in the custom image",
      "properties": {
        "lun": {
          "description": "Disk Lun",
          "type": "string"
        },
        "storageType": {
          "description": "Disk Storage Type",
          "enum": [
            "Standard",
            "Premium",
            "StandardSSD"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "StorageType"
          }
        }
      },
      "type": "object"
    },
    "LinuxOsInfoFragment": {
      "description": "Information about a Linux OS.",
      "properties": {
        "linuxOsState": {
          "description": "The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, DeprovisionApplied).",
          "enum": [
            "NonDeprovisioned",
            "DeprovisionRequested",
            "DeprovisionApplied"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "LinuxOsState"
          }
        }
      },
      "type": "object"
    },
    "UpdateResource": {
      "description": "Represents an update resource",
      "properties": {
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "The tags of the resource.",
          "type": "object"
        }
      },
      "type": "object"
    },
    "WindowsOsInfoFragment": {
      "description": "Information about a Windows OS.",
      "properties": {
        "windowsOsState": {
          "description": "The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, SysprepApplied).",
          "enum": [
            "NonSysprepped",
            "SysprepRequested",
            "SysprepApplied"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "WindowsOsState"
          }
        }
      },
      "type": "object"
    }
  }
}