internal static RoutingConfiguration DeserializeRoutingConfiguration(JsonElement element)
        {
            Optional <SubResource>          associatedRouteTable  = default;
            Optional <PropagatedRouteTable> propagatedRouteTables = default;
            Optional <VnetRoute>            vnetRoutes            = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("associatedRouteTable"))
                {
                    associatedRouteTable = SubResource.DeserializeSubResource(property.Value);
                    continue;
                }
                if (property.NameEquals("propagatedRouteTables"))
                {
                    propagatedRouteTables = PropagatedRouteTable.DeserializePropagatedRouteTable(property.Value);
                    continue;
                }
                if (property.NameEquals("vnetRoutes"))
                {
                    vnetRoutes = VnetRoute.DeserializeVnetRoute(property.Value);
                    continue;
                }
            }
            return(new RoutingConfiguration(associatedRouteTable.Value, propagatedRouteTables.Value, vnetRoutes.Value));
        }
示例#2
0
        internal static RoutingConfiguration DeserializeRoutingConfiguration(JsonElement element)
        {
            SubResource          associatedRouteTable  = default;
            PropagatedRouteTable propagatedRouteTables = default;
            VnetRoute            vnetRoutes            = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("associatedRouteTable"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    associatedRouteTable = SubResource.DeserializeSubResource(property.Value);
                    continue;
                }
                if (property.NameEquals("propagatedRouteTables"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    propagatedRouteTables = PropagatedRouteTable.DeserializePropagatedRouteTable(property.Value);
                    continue;
                }
                if (property.NameEquals("vnetRoutes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    vnetRoutes = VnetRoute.DeserializeVnetRoute(property.Value);
                    continue;
                }
            }
            return(new RoutingConfiguration(associatedRouteTable, propagatedRouteTables, vnetRoutes));
        }