internal static SecurityGroupViewResult DeserializeSecurityGroupViewResult(JsonElement element)
        {
            IReadOnlyList <SecurityGroupNetworkInterface> networkInterfaces = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("networkInterfaces"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <SecurityGroupNetworkInterface> array = new List <SecurityGroupNetworkInterface>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(SecurityGroupNetworkInterface.DeserializeSecurityGroupNetworkInterface(item));
                        }
                    }
                    networkInterfaces = array;
                    continue;
                }
            }
            return(new SecurityGroupViewResult(networkInterfaces));
        }
Esempio n. 2
0
        internal static SecurityGroupViewResult DeserializeSecurityGroupViewResult(JsonElement element)
        {
            Optional <IReadOnlyList <SecurityGroupNetworkInterface> > networkInterfaces = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("networkInterfaces"))
                {
                    List <SecurityGroupNetworkInterface> array = new List <SecurityGroupNetworkInterface>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(SecurityGroupNetworkInterface.DeserializeSecurityGroupNetworkInterface(item));
                    }
                    networkInterfaces = array;
                    continue;
                }
            }
            return(new SecurityGroupViewResult(Optional.ToList(networkInterfaces)));
        }