{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/azure-test-labs/json-schema/azure-test-labs-virtual-network-fragment-schema.json",
  "title": "VirtualNetworkFragment",
  "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/VirtualNetworkFragment",
  "allOf": [
    {
      "$ref": "#/$defs/UpdateResource"
    }
  ],
  "properties": {
    "properties": {
      "$ref": "#/$defs/VirtualNetworkPropertiesFragment",
      "description": "The properties of the resource.",
      "x-ms-client-flatten": true
    }
  },
  "type": "object",
  "$defs": {
    "PortFragment": {
      "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"
    },
    "SubnetFragment": {
      "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"
    },
    "SubnetOverrideFragment": {
      "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/SubnetSharedPublicIpAddressConfigurationFragment",
          "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"
    },
    "SubnetSharedPublicIpAddressConfigurationFragment": {
      "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/PortFragment"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "UpdateResource": {
      "description": "Represents an update resource",
      "properties": {
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "The tags of the resource.",
          "type": "object"
        }
      },
      "type": "object"
    },
    "VirtualNetworkPropertiesFragment": {
      "description": "Properties of a virtual network.",
      "properties": {
        "allowedSubnets": {
          "description": "The allowed subnets of the virtual network.",
          "items": {
            "$ref": "#/$defs/SubnetFragment"
          },
          "type": "array"
        },
        "description": {
          "description": "The description of the virtual network.",
          "type": "string"
        },
        "externalProviderResourceId": {
          "description": "The Microsoft.Network resource identifier of the virtual network.",
          "type": "string"
        },
        "subnetOverrides": {
          "description": "The subnet overrides of the virtual network.",
          "items": {
            "$ref": "#/$defs/SubnetOverrideFragment"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  }
}