ConnectionMonitor IOperationSource <ConnectionMonitor> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = ConnectionMonitorData.DeserializeConnectionMonitorData(document.RootElement);

            return(new ConnectionMonitor(_armClient, data));
        }
        internal static ConnectionMonitorListResult DeserializeConnectionMonitorListResult(JsonElement element)
        {
            Optional <IReadOnlyList <ConnectionMonitorData> > value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ConnectionMonitorData> array = new List <ConnectionMonitorData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ConnectionMonitorData.DeserializeConnectionMonitorData(item));
                    }
                    value = array;
                    continue;
                }
            }
            return(new ConnectionMonitorListResult(Optional.ToList(value)));
        }