internal static PoolSpecification DeserializePoolSpecification(JsonElement element) { string displayName = default; string vmSize = default; CloudServiceConfiguration cloudServiceConfiguration = default; VirtualMachineConfiguration virtualMachineConfiguration = default; int?maxTasksPerNode = default; TaskSchedulingPolicy taskSchedulingPolicy = default; TimeSpan? resizeTimeout = default; int? targetDedicatedNodes = default; int? targetLowPriorityNodes = default; bool? enableAutoScale = default; string autoScaleFormula = default; TimeSpan? autoScaleEvaluationInterval = default; bool? enableInterNodeCommunication = default; NetworkConfiguration networkConfiguration = default; StartTask startTask = default; IList <CertificateReference> certificateReferences = default; IList <ApplicationPackageReference> applicationPackageReferences = default; IList <string> applicationLicenses = default; IList <UserAccount> userAccounts = default; IList <MetadataItem> metadata = default; IList <MountConfiguration> mountConfiguration = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("displayName")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } displayName = property.Value.GetString(); continue; } if (property.NameEquals("vmSize")) { vmSize = property.Value.GetString(); continue; } if (property.NameEquals("cloudServiceConfiguration")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } cloudServiceConfiguration = CloudServiceConfiguration.DeserializeCloudServiceConfiguration(property.Value); continue; } if (property.NameEquals("virtualMachineConfiguration")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value); continue; } if (property.NameEquals("maxTasksPerNode")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } maxTasksPerNode = property.Value.GetInt32(); continue; } if (property.NameEquals("taskSchedulingPolicy")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } taskSchedulingPolicy = TaskSchedulingPolicy.DeserializeTaskSchedulingPolicy(property.Value); continue; } if (property.NameEquals("resizeTimeout")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } resizeTimeout = property.Value.GetTimeSpan("P"); continue; } if (property.NameEquals("targetDedicatedNodes")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } targetDedicatedNodes = property.Value.GetInt32(); continue; } if (property.NameEquals("targetLowPriorityNodes")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } targetLowPriorityNodes = property.Value.GetInt32(); continue; } if (property.NameEquals("enableAutoScale")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } enableAutoScale = property.Value.GetBoolean(); continue; } if (property.NameEquals("autoScaleFormula")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } autoScaleFormula = property.Value.GetString(); continue; } if (property.NameEquals("autoScaleEvaluationInterval")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } autoScaleEvaluationInterval = property.Value.GetTimeSpan("P"); continue; } if (property.NameEquals("enableInterNodeCommunication")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } enableInterNodeCommunication = property.Value.GetBoolean(); continue; } if (property.NameEquals("networkConfiguration")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value); continue; } if (property.NameEquals("startTask")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } startTask = StartTask.DeserializeStartTask(property.Value); continue; } if (property.NameEquals("certificateReferences")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <CertificateReference> array = new List <CertificateReference>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(CertificateReference.DeserializeCertificateReference(item)); } certificateReferences = array; continue; } if (property.NameEquals("applicationPackageReferences")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <ApplicationPackageReference> array = new List <ApplicationPackageReference>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(ApplicationPackageReference.DeserializeApplicationPackageReference(item)); } applicationPackageReferences = array; continue; } if (property.NameEquals("applicationLicenses")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <string> array = new List <string>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(item.GetString()); } applicationLicenses = array; continue; } if (property.NameEquals("userAccounts")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <UserAccount> array = new List <UserAccount>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(UserAccount.DeserializeUserAccount(item)); } userAccounts = array; continue; } if (property.NameEquals("metadata")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <MetadataItem> array = new List <MetadataItem>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(MetadataItem.DeserializeMetadataItem(item)); } metadata = array; continue; } if (property.NameEquals("mountConfiguration")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <MountConfiguration> array = new List <MountConfiguration>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(Models.MountConfiguration.DeserializeMountConfiguration(item)); } mountConfiguration = array; continue; } } return(new PoolSpecification(displayName, vmSize, cloudServiceConfiguration, virtualMachineConfiguration, maxTasksPerNode, taskSchedulingPolicy, resizeTimeout, targetDedicatedNodes, targetLowPriorityNodes, enableAutoScale, autoScaleFormula, autoScaleEvaluationInterval, enableInterNodeCommunication, networkConfiguration, startTask, certificateReferences, applicationPackageReferences, applicationLicenses, userAccounts, metadata, mountConfiguration)); }