internal static ListIndexesResult DeserializeListIndexesResult(JsonElement element)
        {
            IReadOnlyList <SearchIndex> value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <SearchIndex> array = new List <SearchIndex>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(SearchIndex.DeserializeSearchIndex(item));
                        }
                    }
                    value = array;
                    continue;
                }
            }
            return(new ListIndexesResult(value));
        }
        internal static ListIndexesResult DeserializeListIndexesResult(JsonElement element)
        {
            ListIndexesResult result = new ListIndexesResult();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.Indexes.Add(SearchIndex.DeserializeSearchIndex(item));
                    }
                    continue;
                }
            }
            return(result);
        }
        internal static SearchIndex DeserializeSearchIndex(JsonElement element)
        {
            SearchIndex result = new SearchIndex();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    result.Name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("fields"))
                {
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.Fields.Add(SearchField.DeserializeSearchField(item));
                    }
                    continue;
                }
                if (property.NameEquals("scoringProfiles"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.ScoringProfiles = new List <ScoringProfile>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.ScoringProfiles.Add(ScoringProfile.DeserializeScoringProfile(item));
                    }
                    continue;
                }
                if (property.NameEquals("defaultScoringProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.DefaultScoringProfile = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("corsOptions"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.CorsOptions = CorsOptions.DeserializeCorsOptions(property.Value);
                    continue;
                }
                if (property.NameEquals("suggesters"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.Suggesters = new List <Suggester>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.Suggesters.Add(Suggester.DeserializeSuggester(item));
                    }
                    continue;
                }
                if (property.NameEquals("analyzers"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.Analyzers = new List <Analyzer>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.Analyzers.Add(Analyzer.DeserializeAnalyzer(item));
                    }
                    continue;
                }
                if (property.NameEquals("tokenizers"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.Tokenizers = new List <Tokenizer>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.Tokenizers.Add(Tokenizer.DeserializeTokenizer(item));
                    }
                    continue;
                }
                if (property.NameEquals("tokenFilters"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.TokenFilters = new List <TokenFilter>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.TokenFilters.Add(TokenFilter.DeserializeTokenFilter(item));
                    }
                    continue;
                }
                if (property.NameEquals("charFilters"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.CharFilters = new List <CharFilter>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        result.CharFilters.Add(CharFilter.DeserializeCharFilter(item));
                    }
                    continue;
                }
                if (property.NameEquals("encryptionKey"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.EncryptionKey = EncryptionKey.DeserializeEncryptionKey(property.Value);
                    continue;
                }
                if (property.NameEquals("@odata.etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    result.ETag = property.Value.GetString();
                    continue;
                }
            }
            return(result);
        }