// Path: src/main/java/org/codelibs/fess/suggest/converter/ReadingConverter.java
// public interface ReadingConverter {
//     default int getMaxReadingNum() {
//         return 10;
//     }
// 
//     void init() throws IOException;
// 
//     List<String> convert(String text, final String field, String... langs) throws IOException;
// }
// 
// Path: src/main/java/org/codelibs/fess/suggest/normalizer/Normalizer.java
// public interface Normalizer {
//     String normalize(String text, String field, String... langs);
// }
// 
// Path: src/main/java/org/codelibs/fess/suggest/request/RequestBuilder.java
// public abstract class RequestBuilder<Req extends Request<Res>, Res extends Response> {
//     protected Client client;
//     protected Req request;
// 
//     public RequestBuilder(final Client client, final Req request) {
//         this.client = client;
//         this.request = request;
//     }
// 
//     public Deferred<Res>.Promise execute() {
//         return request.execute(client);
//     }
// }


import org.codelibs.fess.suggest.converter.ReadingConverter;
import org.codelibs.fess.suggest.normalizer.Normalizer;
import org.codelibs.fess.suggest.request.RequestBuilder;
import org.opensearch.client.Client;
/*
 * Copyright 2012-2022 CodeLibs Project and the Others.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package org.codelibs.fess.suggest.request.suggest;


public class SuggestRequestBuilder extends RequestBuilder<SuggestRequest, SuggestResponse> {
    public SuggestRequestBuilder(final Client client, final ReadingConverter readingConverter, final Normalizer normalizer) {
        super(client, new SuggestRequest());
        request.setReadingConverter(readingConverter);
        request.setNormalizer(normalizer);
    }

    public SuggestRequestBuilder setIndex(final String index) {
        request.setIndex(index);
        return this;
    }

    public SuggestRequestBuilder setType(final String type) {
        request.setType(type);
        return this;
    }

    public SuggestRequestBuilder setSize(final int size) {
        request.setSize(size);
        return this;
    }

    public SuggestRequestBuilder setQuery(final String query) {
        request.setQuery(query);
        return this;
    }

    public SuggestRequestBuilder addTag(final String tag) {
        request.addTag(tag);
        return this;
    }

    public SuggestRequestBuilder addRole(final String role) {
// Path: src/main/java/org/codelibs/fess/suggest/converter/ReadingConverter.java
// public interface ReadingConverter {
//     default int getMaxReadingNum() {
//         return 10;
//     }
// 
//     void init() throws IOException;
// 
//     List<String> convert(String text, final String field, String... langs) throws IOException;
// }
// 
// Path: src/main/java/org/codelibs/fess/suggest/normalizer/Normalizer.java
// public interface Normalizer {
//     String normalize(String text, String field, String... langs);
// }
// 
// Path: src/main/java/org/codelibs/fess/suggest/request/RequestBuilder.java
// public abstract class RequestBuilder<Req extends Request<Res>, Res extends Response> {
//     protected Client client;
//     protected Req request;
// 
//     public RequestBuilder(final Client client, final Req request) {
//         this.client = client;
//         this.request = request;
//     }
// 
//     public Deferred<Res>.Promise execute() {
//         return request.execute(client);
//     }
// }


// Path: src/main/java/org/codelibs/fess/suggest/request/suggest/SuggestRequestBuilder.java
import org.codelibs.fess.suggest.converter.ReadingConverter;
import org.codelibs.fess.suggest.normalizer.Normalizer;
import org.codelibs.fess.suggest.request.RequestBuilder;
import org.opensearch.client.Client;

/*
 * Copyright 2012-2022 CodeLibs Project and the Others.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package org.codelibs.fess.suggest.request.suggest;


public class SuggestRequestBuilder extends RequestBuilder<SuggestRequest, SuggestResponse> {
    public SuggestRequestBuilder(final Client client, final ReadingConverter readingConverter, final Normalizer normalizer) {
        super(client, new SuggestRequest());
        request.setReadingConverter(readingConverter);
        request.setNormalizer(normalizer);
    }

    public SuggestRequestBuilder setIndex(final String index) {
        request.setIndex(index);
        return this;
    }

    public SuggestRequestBuilder setType(final String type) {
        request.setType(type);
        return this;
    }

    public SuggestRequestBuilder setSize(final int size) {
        request.setSize(size);
        return this;
    }

    public SuggestRequestBuilder setQuery(final String query) {
        request.setQuery(query);
        return this;
    }

    public SuggestRequestBuilder addTag(final String tag) {
        request.addTag(tag);
        return this;
    }

    public SuggestRequestBuilder addRole(final String role) {
        request.addRole(role);