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));
        }
Exemplo n.º 2
0
        internal static RoutingConfiguration DeserializeRoutingConfiguration(JsonElement element)
        {
            Optional <WritableSubResource>  associatedRouteTable  = default;
            Optional <PropagatedRouteTable> propagatedRouteTables = default;
            Optional <VnetRoute>            vnetRoutes            = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("associatedRouteTable"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    associatedRouteTable = JsonSerializer.Deserialize <WritableSubResource>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("propagatedRouteTables"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    propagatedRouteTables = PropagatedRouteTable.DeserializePropagatedRouteTable(property.Value);
                    continue;
                }
                if (property.NameEquals("vnetRoutes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    vnetRoutes = VnetRoute.DeserializeVnetRoute(property.Value);
                    continue;
                }
            }
            return(new RoutingConfiguration(associatedRouteTable, propagatedRouteTables.Value, vnetRoutes.Value));
        }
Exemplo n.º 3
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));
        }
 internal RoutingConfiguration(WritableSubResource associatedRouteTable, PropagatedRouteTable propagatedRouteTables, VnetRoute vnetRoutes)
 {
     AssociatedRouteTable  = associatedRouteTable;
     PropagatedRouteTables = propagatedRouteTables;
     VnetRoutes            = vnetRoutes;
 }