Ejemplo n.º 1
0
        internal static LoadBalancerSku DeserializeLoadBalancerSku(JsonElement element)
        {
            Optional <LoadBalancerSkuName> name = default;
            Optional <LoadBalancerSkuTier> tier = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    name = new LoadBalancerSkuName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("tier"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    tier = new LoadBalancerSkuTier(property.Value.GetString());
                    continue;
                }
            }
            return(new LoadBalancerSku(Optional.ToNullable(name), Optional.ToNullable(tier)));
        }
Ejemplo n.º 2
0
        internal static LoadBalancerSku DeserializeLoadBalancerSku(JsonElement element)
        {
            Optional <LoadBalancerSkuName> name = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = new LoadBalancerSkuName(property.Value.GetString());
                    continue;
                }
            }
            return(new LoadBalancerSku(Optional.ToNullable(name)));
        }
Ejemplo n.º 3
0
        internal static LoadBalancerSku DeserializeLoadBalancerSku(JsonElement element)
        {
            LoadBalancerSkuName?name = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = new LoadBalancerSkuName(property.Value.GetString());
                    continue;
                }
            }
            return(new LoadBalancerSku(name));
        }