{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-test-labs/json-schema/azure-test-labs-virtual-network-schema.json",
  "title": "VirtualNetwork",
  "description": "A virtual network.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/azure-test-labs-virtual-networks-api-openapi.yml#/components/schemas/VirtualNetwork",
  "allOf": [
    {
      "$ref": "#/$defs/Resource"
    }
  ],
  "properties": {
    "properties": {
      "$ref": "#/$defs/VirtualNetworkProperties",
      "description": "The properties of the resource.",
      "x-ms-client-flatten": true
    }
  },
  "type": "object",
  "$defs": {
    "ExternalSubnet": {
      "description": "Subnet information as returned by the Microsoft.Network API.",
      "properties": {
        "id": {
          "description": "Gets or sets the identifier.",
          "type": "string"
        },
        "name": {
          "description": "Gets or sets the name.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Port": {
      "description": "Properties of a network port.",
      "properties": {
        "backendPort": {
          "description": "Backend port of the target virtual machine.",
          "format": "int32",
          "type": "integer"
        },
        "transportProtocol": {
          "description": "Protocol type of the port.",
          "enum": [
            "Tcp",
            "Udp"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "TransportProtocol"
          }
        }
      },
      "type": "object"
    },
    "Resource": {
      "description": "An Azure resource.",
      "properties": {
        "id": {
          "description": "The identifier of the resource.",
          "readOnly": true,
          "type": "string"
        },
        "location": {
          "description": "The location of the resource.",
          "type": "string"
        },
        "name": {
          "description": "The name of the resource.",
          "readOnly": true,
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "The tags of the resource.",
          "type": "object"
        },
        "type": {
          "description": "The type of the resource.",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object",
      "x-ms-azure-resource": true
    },
    "Subnet": {
      "description": "Subnet information.",
      "properties": {
        "allowPublicIp": {
          "description": "The permission policy of the subnet for allowing public IP addresses (i.e. Allow, Deny)).",
          "enum": [
            "Default",
            "Deny",
            "Allow"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "UsagePermissionType"
          }
        },
        "labSubnetName": {
          "description": "The name of the subnet as seen in the lab.",
          "type": "string"
        },
        "resourceId": {
          "description": "The resource ID of the subnet.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "SubnetOverride": {
      "description": "Property overrides on a subnet of a virtual network.",
      "properties": {
        "labSubnetName": {
          "description": "The name given to the subnet within the lab.",
          "type": "string"
        },
        "resourceId": {
          "description": "The resource ID of the subnet.",
          "type": "string"
        },
        "sharedPublicIpAddressConfiguration": {
          "$ref": "#/$defs/SubnetSharedPublicIpAddressConfiguration",
          "description": "Properties that virtual machines on this subnet will share."
        },
        "useInVmCreationPermission": {
          "description": "Indicates whether this subnet can be used during virtual machine creation (i.e. Allow, Deny).",
          "enum": [
            "Default",
            "Deny",
            "Allow"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "UsagePermissionType"
          }
        },
        "usePublicIpAddressPermission": {
          "description": "Indicates whether public IP addresses can be assigned to virtual machines on this subnet (i.e. Allow, Deny).",
          "enum": [
            "Default",
            "Deny",
            "Allow"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": true,
            "name": "UsagePermissionType"
          }
        },
        "virtualNetworkPoolName": {
          "description": "The virtual network pool associated with this subnet.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "SubnetSharedPublicIpAddressConfiguration": {
      "description": "Configuration for public IP address sharing.",
      "properties": {
        "allowedPorts": {
          "description": "Backend ports that virtual machines on this subnet are allowed to expose",
          "items": {
            "$ref": "#/$defs/Port"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "VirtualNetworkProperties": {
      "description": "Properties of a virtual network.",
      "properties": {
        "allowedSubnets": {
          "description": "The allowed subnets of the virtual network.",
          "items": {
            "$ref": "#/$defs/Subnet"
          },
          "type": "array"
        },
        "createdDate": {
          "description": "The creation date of the virtual network.",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "description": {
          "description": "The description of the virtual network.",
          "type": "string"
        },
        "externalProviderResourceId": {
          "description": "The Microsoft.Network resource identifier of the virtual network.",
          "type": "string"
        },
        "externalSubnets": {
          "description": "The external subnet properties.",
          "items": {
            "$ref": "#/$defs/ExternalSubnet"
          },
          "readOnly": true,
          "type": "array"
        },
        "provisioningState": {
          "description": "The provisioning status of the resource.",
          "readOnly": true,
          "type": "string"
        },
        "subnetOverrides": {
          "description": "The subnet overrides of the virtual network.",
          "items": {
            "$ref": "#/$defs/SubnetOverride"
          },
          "type": "array"
        },
        "uniqueIdentifier": {
          "description": "The unique immutable identifier of a resource (Guid).",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}