internal static PublicIPPrefixSku DeserializePublicIPPrefixSku(JsonElement element)
        {
            Optional <PublicIPPrefixSkuName> name = default;
            Optional <PublicIPPrefixSkuTier> tier = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    name = new PublicIPPrefixSkuName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("tier"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    tier = new PublicIPPrefixSkuTier(property.Value.GetString());
                    continue;
                }
            }
            return(new PublicIPPrefixSku(Optional.ToNullable(name), Optional.ToNullable(tier)));
        }
Example #2
0
        internal static PublicIPPrefixSku DeserializePublicIPPrefixSku(JsonElement element)
        {
            Optional <PublicIPPrefixSkuName> name = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = new PublicIPPrefixSkuName(property.Value.GetString());
                    continue;
                }
            }
            return(new PublicIPPrefixSku(Optional.ToNullable(name)));
        }