internal static ClusterReportedProperties DeserializeClusterReportedProperties(JsonElement element) { Optional <string> clusterName = default; Optional <string> clusterId = default; Optional <string> clusterVersion = default; Optional <IReadOnlyList <ClusterNode> > nodes = default; Optional <DateTimeOffset> lastUpdated = default; Optional <ImdsAttestation> imdsAttestation = default; Optional <DiagnosticLevel> diagnosticLevel = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("clusterName")) { clusterName = property.Value.GetString(); continue; } if (property.NameEquals("clusterId")) { clusterId = property.Value.GetString(); continue; } if (property.NameEquals("clusterVersion")) { clusterVersion = property.Value.GetString(); continue; } if (property.NameEquals("nodes")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <ClusterNode> array = new List <ClusterNode>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(ClusterNode.DeserializeClusterNode(item)); } nodes = array; continue; } if (property.NameEquals("lastUpdated")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } lastUpdated = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("imdsAttestation")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } imdsAttestation = new ImdsAttestation(property.Value.GetString()); continue; } if (property.NameEquals("diagnosticLevel")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } diagnosticLevel = new DiagnosticLevel(property.Value.GetString()); continue; } } return(new ClusterReportedProperties(clusterName.Value, clusterId.Value, clusterVersion.Value, Optional.ToList(nodes), Optional.ToNullable(lastUpdated), Optional.ToNullable(imdsAttestation), Optional.ToNullable(diagnosticLevel))); }