internal static WinRMConfiguration DeserializeWinRMConfiguration(JsonElement element)
        {
            IList <WinRMListener> listeners = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("listeners"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <WinRMListener> array = new List <WinRMListener>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(WinRMListener.DeserializeWinRMListener(item));
                        }
                    }
                    listeners = array;
                    continue;
                }
            }
            return(new WinRMConfiguration(listeners));
        }
Exemple #2
0
        internal static WinRMConfiguration DeserializeWinRMConfiguration(JsonElement element)
        {
            Optional <IList <WinRMListener> > listeners = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("listeners"))
                {
                    List <WinRMListener> array = new List <WinRMListener>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(WinRMListener.DeserializeWinRMListener(item));
                    }
                    listeners = array;
                    continue;
                }
            }
            return(new WinRMConfiguration(Optional.ToList(listeners)));
        }