internal static VirtualNetworkGatewaySku DeserializeVirtualNetworkGatewaySku(JsonElement element)
        {
            Optional <VirtualNetworkGatewaySkuName> name = default;
            Optional <VirtualNetworkGatewaySkuTier> tier = default;
            Optional <int> capacity = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = new VirtualNetworkGatewaySkuName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("tier"))
                {
                    tier = new VirtualNetworkGatewaySkuTier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("capacity"))
                {
                    capacity = property.Value.GetInt32();
                    continue;
                }
            }
            return(new VirtualNetworkGatewaySku(Optional.ToNullable(name), Optional.ToNullable(tier), Optional.ToNullable(capacity)));
        }
        internal static VirtualNetworkGatewaySku DeserializeVirtualNetworkGatewaySku(JsonElement element)
        {
            VirtualNetworkGatewaySkuName?name = default;
            VirtualNetworkGatewaySkuTier?tier = default;
            int?capacity = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = new VirtualNetworkGatewaySkuName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("tier"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    tier = new VirtualNetworkGatewaySkuTier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("capacity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    capacity = property.Value.GetInt32();
                    continue;
                }
            }
            return(new VirtualNetworkGatewaySku(name, tier, capacity));
        }