internal static ApplicationGatewayRewriteRuleActionSet DeserializeApplicationGatewayRewriteRuleActionSet(JsonElement element)
        {
            Optional <IList <ApplicationGatewayHeaderConfiguration> > requestHeaderConfigurations  = default;
            Optional <IList <ApplicationGatewayHeaderConfiguration> > responseHeaderConfigurations = default;
            Optional <ApplicationGatewayUrlConfiguration>             urlConfiguration             = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("requestHeaderConfigurations"))
                {
                    List <ApplicationGatewayHeaderConfiguration> array = new List <ApplicationGatewayHeaderConfiguration>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ApplicationGatewayHeaderConfiguration.DeserializeApplicationGatewayHeaderConfiguration(item));
                    }
                    requestHeaderConfigurations = array;
                    continue;
                }
                if (property.NameEquals("responseHeaderConfigurations"))
                {
                    List <ApplicationGatewayHeaderConfiguration> array = new List <ApplicationGatewayHeaderConfiguration>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ApplicationGatewayHeaderConfiguration.DeserializeApplicationGatewayHeaderConfiguration(item));
                    }
                    responseHeaderConfigurations = array;
                    continue;
                }
                if (property.NameEquals("urlConfiguration"))
                {
                    urlConfiguration = ApplicationGatewayUrlConfiguration.DeserializeApplicationGatewayUrlConfiguration(property.Value);
                    continue;
                }
            }
            return(new ApplicationGatewayRewriteRuleActionSet(Optional.ToList(requestHeaderConfigurations), Optional.ToList(responseHeaderConfigurations), urlConfiguration.Value));
        }
Ejemplo n.º 2
0
        internal static ApplicationGatewayRewriteRuleActionSet DeserializeApplicationGatewayRewriteRuleActionSet(JsonElement element)
        {
            IList <ApplicationGatewayHeaderConfiguration> requestHeaderConfigurations  = default;
            IList <ApplicationGatewayHeaderConfiguration> responseHeaderConfigurations = default;
            ApplicationGatewayUrlConfiguration            urlConfiguration             = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("requestHeaderConfigurations"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <ApplicationGatewayHeaderConfiguration> array = new List <ApplicationGatewayHeaderConfiguration>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(ApplicationGatewayHeaderConfiguration.DeserializeApplicationGatewayHeaderConfiguration(item));
                        }
                    }
                    requestHeaderConfigurations = array;
                    continue;
                }
                if (property.NameEquals("responseHeaderConfigurations"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <ApplicationGatewayHeaderConfiguration> array = new List <ApplicationGatewayHeaderConfiguration>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(ApplicationGatewayHeaderConfiguration.DeserializeApplicationGatewayHeaderConfiguration(item));
                        }
                    }
                    responseHeaderConfigurations = array;
                    continue;
                }
                if (property.NameEquals("urlConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    urlConfiguration = ApplicationGatewayUrlConfiguration.DeserializeApplicationGatewayUrlConfiguration(property.Value);
                    continue;
                }
            }
            return(new ApplicationGatewayRewriteRuleActionSet(requestHeaderConfigurations, responseHeaderConfigurations, urlConfiguration));
        }