CassandraTable IOperationSource <CassandraTable> .CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); var data = CassandraTableData.DeserializeCassandraTableData(document.RootElement); return(new CassandraTable(_armClient, data)); }
internal static CassandraTableList DeserializeCassandraTableList(JsonElement element) { Optional <IReadOnlyList <CassandraTableData> > value = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <CassandraTableData> array = new List <CassandraTableData>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(CassandraTableData.DeserializeCassandraTableData(item)); } value = array; continue; } } return(new CassandraTableList(Optional.ToList(value))); }