internal static ApplicationGatewayBackendHealthOnDemand DeserializeApplicationGatewayBackendHealthOnDemand(JsonElement element)
        {
            ApplicationGatewayBackendAddressPool        backendAddressPool        = default;
            ApplicationGatewayBackendHealthHttpSettings backendHealthHttpSettings = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("backendAddressPool"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    backendAddressPool = ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendAddressPool(property.Value);
                    continue;
                }
                if (property.NameEquals("backendHealthHttpSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    backendHealthHttpSettings = ApplicationGatewayBackendHealthHttpSettings.DeserializeApplicationGatewayBackendHealthHttpSettings(property.Value);
                    continue;
                }
            }
            return(new ApplicationGatewayBackendHealthOnDemand(backendAddressPool, backendHealthHttpSettings));
        }
Exemple #2
0
        internal static ApplicationGatewayBackendHealthPool DeserializeApplicationGatewayBackendHealthPool(JsonElement element)
        {
            Optional <ApplicationGatewayBackendAddressPool> backendAddressPool = default;
            Optional <IReadOnlyList <ApplicationGatewayBackendHealthHttpSettings> > backendHttpSettingsCollection = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("backendAddressPool"))
                {
                    backendAddressPool = ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendAddressPool(property.Value);
                    continue;
                }
                if (property.NameEquals("backendHttpSettingsCollection"))
                {
                    List <ApplicationGatewayBackendHealthHttpSettings> array = new List <ApplicationGatewayBackendHealthHttpSettings>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ApplicationGatewayBackendHealthHttpSettings.DeserializeApplicationGatewayBackendHealthHttpSettings(item));
                    }
                    backendHttpSettingsCollection = array;
                    continue;
                }
            }
            return(new ApplicationGatewayBackendHealthPool(backendAddressPool.Value, Optional.ToList(backendHttpSettingsCollection)));
        }
        internal static ApplicationGatewayBackendHealthPool DeserializeApplicationGatewayBackendHealthPool(JsonElement element)
        {
            ApplicationGatewayBackendAddressPool backendAddressPool = default;
            IReadOnlyList <ApplicationGatewayBackendHealthHttpSettings> backendHttpSettingsCollection = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("backendAddressPool"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    backendAddressPool = ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendAddressPool(property.Value);
                    continue;
                }
                if (property.NameEquals("backendHttpSettingsCollection"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <ApplicationGatewayBackendHealthHttpSettings> array = new List <ApplicationGatewayBackendHealthHttpSettings>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(ApplicationGatewayBackendHealthHttpSettings.DeserializeApplicationGatewayBackendHealthHttpSettings(item));
                        }
                    }
                    backendHttpSettingsCollection = array;
                    continue;
                }
            }
            return(new ApplicationGatewayBackendHealthPool(backendAddressPool, backendHttpSettingsCollection));
        }