internal VirtualMachineConfiguration(ImageReference imageReference, string nodeAgentSKUId, WindowsConfiguration windowsConfiguration, IList <DataDisk> dataDisks, string licenseType, ContainerConfiguration containerConfiguration, DiskEncryptionConfiguration diskEncryptionConfiguration)
 {
     ImageReference              = imageReference;
     NodeAgentSKUId              = nodeAgentSKUId;
     WindowsConfiguration        = windowsConfiguration;
     DataDisks                   = dataDisks;
     LicenseType                 = licenseType;
     ContainerConfiguration      = containerConfiguration;
     DiskEncryptionConfiguration = diskEncryptionConfiguration;
 }
        internal static VirtualMachineConfiguration DeserializeVirtualMachineConfiguration(JsonElement element)
        {
            ImageReference              imageReference              = default;
            string                      nodeAgentSKUId              = default;
            WindowsConfiguration        windowsConfiguration        = default;
            IList <DataDisk>            dataDisks                   = default;
            string                      licenseType                 = default;
            ContainerConfiguration      containerConfiguration      = default;
            DiskEncryptionConfiguration diskEncryptionConfiguration = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("imageReference"))
                {
                    imageReference = ImageReference.DeserializeImageReference(property.Value);
                    continue;
                }
                if (property.NameEquals("nodeAgentSKUId"))
                {
                    nodeAgentSKUId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("windowsConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    windowsConfiguration = WindowsConfiguration.DeserializeWindowsConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("dataDisks"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <DataDisk> array = new List <DataDisk>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DataDisk.DeserializeDataDisk(item));
                    }
                    dataDisks = array;
                    continue;
                }
                if (property.NameEquals("licenseType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    licenseType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("containerConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    containerConfiguration = ContainerConfiguration.DeserializeContainerConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("diskEncryptionConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    diskEncryptionConfiguration = DiskEncryptionConfiguration.DeserializeDiskEncryptionConfiguration(property.Value);
                    continue;
                }
            }
            return(new VirtualMachineConfiguration(imageReference, nodeAgentSKUId, windowsConfiguration, dataDisks, licenseType, containerConfiguration, diskEncryptionConfiguration));
        }