internal static ConnectionMonitorHttpConfiguration DeserializeConnectionMonitorHttpConfiguration(JsonElement element)
        {
            int?port = default;
            HttpConfigurationMethod?method           = default;
            string             path                  = default;
            IList <HttpHeader> requestHeaders        = default;
            IList <string>     validStatusCodeRanges = default;
            bool?preferHTTPS = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("port"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    port = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("method"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    method = new HttpConfigurationMethod(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("path"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    path = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("requestHeaders"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <HttpHeader> array = new List <HttpHeader>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(HttpHeader.DeserializeHttpHeader(item));
                        }
                    }
                    requestHeaders = array;
                    continue;
                }
                if (property.NameEquals("validStatusCodeRanges"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(item.GetString());
                        }
                    }
                    validStatusCodeRanges = array;
                    continue;
                }
                if (property.NameEquals("preferHTTPS"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    preferHTTPS = property.Value.GetBoolean();
                    continue;
                }
            }
            return(new ConnectionMonitorHttpConfiguration(port, method, path, requestHeaders, validStatusCodeRanges, preferHTTPS));
        }