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