internal static AutocompleteResults DeserializeAutocompleteResults(JsonElement element)
        {
            Optional <double> searchCoverage       = default;
            IReadOnlyList <AutocompleteItem> value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("@search.coverage"))
                {
                    searchCoverage = property.Value.GetDouble();
                    continue;
                }
                if (property.NameEquals("value"))
                {
                    List <AutocompleteItem> array = new List <AutocompleteItem>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(AutocompleteItem.DeserializeAutocompleteItem(item));
                    }
                    value = array;
                    continue;
                }
            }
            return(new AutocompleteResults(Optional.ToNullable(searchCoverage), value));
        }
        internal static AutocompleteResults DeserializeAutocompleteResults(JsonElement element)
        {
            double?searchCoverage = default;
            IReadOnlyList <AutocompleteItem> value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("@search.coverage"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    searchCoverage = property.Value.GetDouble();
                    continue;
                }
                if (property.NameEquals("value"))
                {
                    List <AutocompleteItem> array = new List <AutocompleteItem>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(AutocompleteItem.DeserializeAutocompleteItem(item));
                        }
                    }
                    value = array;
                    continue;
                }
            }
            return(new AutocompleteResults(searchCoverage, value));
        }