/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.langchain4j.web.search;

import javax.annotation.processing.Generated;
import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.support.component.PropertyConfigurerSupport;

/**
 * Generated by camel build tools - do NOT edit this file!
 */
@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo")
@SuppressWarnings("unchecked")
public class LangChain4jWebSearchEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        LangChain4jWebSearchEndpoint target = (LangChain4jWebSearchEndpoint) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "additionalparams":
        case "additionalParams": target.getConfiguration().setAdditionalParams(property(camelContext, java.util.Map.class, value)); return true;
        case "geolocation":
        case "geoLocation": target.getConfiguration().setGeoLocation(property(camelContext, java.lang.String.class, value)); return true;
        case "language": target.getConfiguration().setLanguage(property(camelContext, java.lang.String.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "maxresults":
        case "maxResults": target.getConfiguration().setMaxResults(property(camelContext, java.lang.Integer.class, value)); return true;
        case "resulttype":
        case "resultType": target.getConfiguration().setResultType(property(camelContext, org.apache.camel.component.langchain4j.web.search.LangChain4jWebSearchResultType.class, value)); return true;
        case "safesearch":
        case "safeSearch": target.getConfiguration().setSafeSearch(property(camelContext, java.lang.Boolean.class, value)); return true;
        case "startindex":
        case "startIndex": target.getConfiguration().setStartIndex(property(camelContext, java.lang.Integer.class, value)); return true;
        case "startpage":
        case "startPage": target.getConfiguration().setStartPage(property(camelContext, java.lang.Integer.class, value)); return true;
        case "websearchengine":
        case "webSearchEngine": target.getConfiguration().setWebSearchEngine(property(camelContext, dev.langchain4j.web.search.WebSearchEngine.class, value)); return true;
        case "websearchrequest":
        case "webSearchRequest": target.getConfiguration().setWebSearchRequest(property(camelContext, dev.langchain4j.web.search.WebSearchRequest.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public String[] getAutowiredNames() {
        return new String[]{"additionalParams", "webSearchEngine", "webSearchRequest"};
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "additionalparams":
        case "additionalParams": return java.util.Map.class;
        case "geolocation":
        case "geoLocation": return java.lang.String.class;
        case "language": return java.lang.String.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "maxresults":
        case "maxResults": return java.lang.Integer.class;
        case "resulttype":
        case "resultType": return org.apache.camel.component.langchain4j.web.search.LangChain4jWebSearchResultType.class;
        case "safesearch":
        case "safeSearch": return java.lang.Boolean.class;
        case "startindex":
        case "startIndex": return java.lang.Integer.class;
        case "startpage":
        case "startPage": return java.lang.Integer.class;
        case "websearchengine":
        case "webSearchEngine": return dev.langchain4j.web.search.WebSearchEngine.class;
        case "websearchrequest":
        case "webSearchRequest": return dev.langchain4j.web.search.WebSearchRequest.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        LangChain4jWebSearchEndpoint target = (LangChain4jWebSearchEndpoint) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "additionalparams":
        case "additionalParams": return target.getConfiguration().getAdditionalParams();
        case "geolocation":
        case "geoLocation": return target.getConfiguration().getGeoLocation();
        case "language": return target.getConfiguration().getLanguage();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "maxresults":
        case "maxResults": return target.getConfiguration().getMaxResults();
        case "resulttype":
        case "resultType": return target.getConfiguration().getResultType();
        case "safesearch":
        case "safeSearch": return target.getConfiguration().getSafeSearch();
        case "startindex":
        case "startIndex": return target.getConfiguration().getStartIndex();
        case "startpage":
        case "startPage": return target.getConfiguration().getStartPage();
        case "websearchengine":
        case "webSearchEngine": return target.getConfiguration().getWebSearchEngine();
        case "websearchrequest":
        case "webSearchRequest": return target.getConfiguration().getWebSearchRequest();
        default: return null;
        }
    }

    @Override
    public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "additionalparams":
        case "additionalParams": return java.lang.Object.class;
        default: return null;
        }
    }
}

