ManagedInstanceKey IOperationSource <ManagedInstanceKey> .CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); var data = ManagedInstanceKeyData.DeserializeManagedInstanceKeyData(document.RootElement); return(new ManagedInstanceKey(_armClient, data)); }
internal static ManagedInstanceKeyListResult DeserializeManagedInstanceKeyListResult(JsonElement element) { Optional <IReadOnlyList <ManagedInstanceKeyData> > 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 <ManagedInstanceKeyData> array = new List <ManagedInstanceKeyData>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(ManagedInstanceKeyData.DeserializeManagedInstanceKeyData(item)); } value = array; continue; } if (property.NameEquals("nextLink")) { nextLink = property.Value.GetString(); continue; } } return(new ManagedInstanceKeyListResult(Optional.ToList(value), nextLink.Value)); }