internal static ExpressRouteCircuitConnectionListResult DeserializeExpressRouteCircuitConnectionListResult(JsonElement element)
        {
            Optional <IReadOnlyList <ExpressRouteCircuitConnection> > value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <ExpressRouteCircuitConnection> array = new List <ExpressRouteCircuitConnection>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ExpressRouteCircuitConnection.DeserializeExpressRouteCircuitConnection(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ExpressRouteCircuitConnectionListResult(Optional.ToList(value), nextLink.Value));
        }
示例#2
0
        internal static ExpressRouteCircuitConnectionListResult DeserializeExpressRouteCircuitConnectionListResult(JsonElement element)
        {
            IReadOnlyList <ExpressRouteCircuitConnection> value = default;
            string nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <ExpressRouteCircuitConnection> array = new List <ExpressRouteCircuitConnection>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(ExpressRouteCircuitConnection.DeserializeExpressRouteCircuitConnection(item));
                        }
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new ExpressRouteCircuitConnectionListResult(value, nextLink));
        }
示例#3
0
        internal static ExpressRouteCircuitPeering DeserializeExpressRouteCircuitPeering(JsonElement element)
        {
            Optional <string> name = default;
            Optional <string> etag = default;
            Optional <string> type = default;
            Optional <string> id   = default;
            Optional <ExpressRoutePeeringType>  peeringType = default;
            Optional <ExpressRoutePeeringState> state       = default;
            Optional <int>    azureASN = default;
            Optional <long>   peerASN  = default;
            Optional <string> primaryPeerAddressPrefix   = default;
            Optional <string> secondaryPeerAddressPrefix = default;
            Optional <string> primaryAzurePort           = default;
            Optional <string> secondaryAzurePort         = default;
            Optional <string> sharedKey = default;
            Optional <int>    vlanId    = default;
            Optional <ExpressRouteCircuitPeeringConfig> microsoftPeeringConfig = default;
            Optional <ExpressRouteCircuitStats>         stats = default;
            Optional <ProvisioningState> provisioningState    = default;
            Optional <string>            gatewayManagerEtag   = default;
            Optional <string>            lastModifiedBy       = default;
            Optional <SubResource>       routeFilter          = default;
            Optional <Ipv6ExpressRouteCircuitPeeringConfig>               ipv6PeeringConfig      = default;
            Optional <ExpressRouteConnectionId>                           expressRouteConnection = default;
            Optional <IList <ExpressRouteCircuitConnection> >             connections            = default;
            Optional <IReadOnlyList <PeerExpressRouteCircuitConnection> > peeredConnections      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("peeringType"))
                        {
                            peeringType = new ExpressRoutePeeringType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("state"))
                        {
                            state = new ExpressRoutePeeringState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("azureASN"))
                        {
                            azureASN = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("peerASN"))
                        {
                            peerASN = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("primaryPeerAddressPrefix"))
                        {
                            primaryPeerAddressPrefix = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("secondaryPeerAddressPrefix"))
                        {
                            secondaryPeerAddressPrefix = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("primaryAzurePort"))
                        {
                            primaryAzurePort = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("secondaryAzurePort"))
                        {
                            secondaryAzurePort = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("sharedKey"))
                        {
                            sharedKey = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("vlanId"))
                        {
                            vlanId = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("microsoftPeeringConfig"))
                        {
                            microsoftPeeringConfig = ExpressRouteCircuitPeeringConfig.DeserializeExpressRouteCircuitPeeringConfig(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("stats"))
                        {
                            stats = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("gatewayManagerEtag"))
                        {
                            gatewayManagerEtag = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("lastModifiedBy"))
                        {
                            lastModifiedBy = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("routeFilter"))
                        {
                            routeFilter = DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("ipv6PeeringConfig"))
                        {
                            ipv6PeeringConfig = Ipv6ExpressRouteCircuitPeeringConfig.DeserializeIpv6ExpressRouteCircuitPeeringConfig(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("expressRouteConnection"))
                        {
                            expressRouteConnection = ExpressRouteConnectionId.DeserializeExpressRouteConnectionId(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("connections"))
                        {
                            List <ExpressRouteCircuitConnection> array = new List <ExpressRouteCircuitConnection>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ExpressRouteCircuitConnection.DeserializeExpressRouteCircuitConnection(item));
                            }
                            connections = array;
                            continue;
                        }
                        if (property0.NameEquals("peeredConnections"))
                        {
                            List <PeerExpressRouteCircuitConnection> array = new List <PeerExpressRouteCircuitConnection>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(PeerExpressRouteCircuitConnection.DeserializePeerExpressRouteCircuitConnection(item));
                            }
                            peeredConnections = array;
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ExpressRouteCircuitPeering(id.Value, name.Value, etag.Value, type.Value, Optional.ToNullable(peeringType), Optional.ToNullable(state), Optional.ToNullable(azureASN), Optional.ToNullable(peerASN), primaryPeerAddressPrefix.Value, secondaryPeerAddressPrefix.Value, primaryAzurePort.Value, secondaryAzurePort.Value, sharedKey.Value, Optional.ToNullable(vlanId), microsoftPeeringConfig.Value, stats.Value, Optional.ToNullable(provisioningState), gatewayManagerEtag.Value, lastModifiedBy.Value, routeFilter.Value, ipv6PeeringConfig.Value, expressRouteConnection.Value, Optional.ToList(connections), Optional.ToList(peeredConnections)));
        }
        internal static ExpressRouteCircuitPeering DeserializeExpressRouteCircuitPeering(JsonElement element)
        {
            string name = default;
            string etag = default;
            string type = default;
            string id   = default;
            ExpressRoutePeeringType? peeringType = default;
            ExpressRoutePeeringState?state       = default;
            int?   azureASN = default;
            long?  peerASN  = default;
            string primaryPeerAddressPrefix   = default;
            string secondaryPeerAddressPrefix = default;
            string primaryAzurePort           = default;
            string secondaryAzurePort         = default;
            string sharedKey = default;
            int?   vlanId    = default;
            ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default;
            ExpressRouteCircuitStats         stats = default;
            ProvisioningState?provisioningState    = default;
            string            gatewayManagerEtag   = default;
            string            lastModifiedBy       = default;
            SubResource       routeFilter          = default;
            Ipv6ExpressRouteCircuitPeeringConfig      ipv6PeeringConfig      = default;
            ExpressRouteConnectionId                  expressRouteConnection = default;
            IList <ExpressRouteCircuitConnection>     connections            = default;
            IList <PeerExpressRouteCircuitConnection> peeredConnections      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("peeringType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            peeringType = new ExpressRoutePeeringType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("state"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            state = new ExpressRoutePeeringState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("azureASN"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            azureASN = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("peerASN"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            peerASN = property0.Value.GetInt64();
                            continue;
                        }
                        if (property0.NameEquals("primaryPeerAddressPrefix"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            primaryPeerAddressPrefix = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("secondaryPeerAddressPrefix"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            secondaryPeerAddressPrefix = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("primaryAzurePort"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            primaryAzurePort = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("secondaryAzurePort"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            secondaryAzurePort = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("sharedKey"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            sharedKey = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("vlanId"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            vlanId = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("microsoftPeeringConfig"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            microsoftPeeringConfig = ExpressRouteCircuitPeeringConfig.DeserializeExpressRouteCircuitPeeringConfig(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("stats"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            stats = ExpressRouteCircuitStats.DeserializeExpressRouteCircuitStats(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("gatewayManagerEtag"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            gatewayManagerEtag = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("lastModifiedBy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            lastModifiedBy = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("routeFilter"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            routeFilter = DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("ipv6PeeringConfig"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            ipv6PeeringConfig = Ipv6ExpressRouteCircuitPeeringConfig.DeserializeIpv6ExpressRouteCircuitPeeringConfig(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("expressRouteConnection"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            expressRouteConnection = ExpressRouteConnectionId.DeserializeExpressRouteConnectionId(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("connections"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ExpressRouteCircuitConnection> array = new List <ExpressRouteCircuitConnection>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ExpressRouteCircuitConnection.DeserializeExpressRouteCircuitConnection(item));
                                }
                            }
                            connections = array;
                            continue;
                        }
                        if (property0.NameEquals("peeredConnections"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <PeerExpressRouteCircuitConnection> array = new List <PeerExpressRouteCircuitConnection>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(PeerExpressRouteCircuitConnection.DeserializePeerExpressRouteCircuitConnection(item));
                                }
                            }
                            peeredConnections = array;
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ExpressRouteCircuitPeering(id, name, etag, type, peeringType, state, azureASN, peerASN, primaryPeerAddressPrefix, secondaryPeerAddressPrefix, primaryAzurePort, secondaryAzurePort, sharedKey, vlanId, microsoftPeeringConfig, stats, provisioningState, gatewayManagerEtag, lastModifiedBy, routeFilter, ipv6PeeringConfig, expressRouteConnection, connections, peeredConnections));
        }