internal static ExpressRouteCircuitSku DeserializeExpressRouteCircuitSku(JsonElement element)
        {
            Optional <string> name = default;
            Optional <ExpressRouteCircuitSkuTier>   tier   = default;
            Optional <ExpressRouteCircuitSkuFamily> family = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tier"))
                {
                    tier = new ExpressRouteCircuitSkuTier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("family"))
                {
                    family = new ExpressRouteCircuitSkuFamily(property.Value.GetString());
                    continue;
                }
            }
            return(new ExpressRouteCircuitSku(name.Value, Optional.ToNullable(tier), Optional.ToNullable(family)));
        }
Exemple #2
0
        internal static ExpressRouteCircuitSku DeserializeExpressRouteCircuitSku(JsonElement element)
        {
            string name = default;
            ExpressRouteCircuitSkuTier?  tier   = default;
            ExpressRouteCircuitSkuFamily?family = 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("tier"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    tier = new ExpressRouteCircuitSkuTier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("family"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    family = new ExpressRouteCircuitSkuFamily(property.Value.GetString());
                    continue;
                }
            }
            return(new ExpressRouteCircuitSku(name, tier, family));
        }