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

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 GoogleFirestoreComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    private org.apache.camel.component.google.firestore.GoogleFirestoreConfiguration getOrCreateConfiguration(GoogleFirestoreComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.google.firestore.GoogleFirestoreConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        GoogleFirestoreComponent target = (GoogleFirestoreComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.google.firestore.GoogleFirestoreConfiguration.class, value)); return true;
        case "databaseid":
        case "databaseId": getOrCreateConfiguration(target).setDatabaseId(property(camelContext, java.lang.String.class, value)); return true;
        case "documentid":
        case "documentId": getOrCreateConfiguration(target).setDocumentId(property(camelContext, java.lang.String.class, value)); return true;
        case "firestoreclient":
        case "firestoreClient": getOrCreateConfiguration(target).setFirestoreClient(property(camelContext, com.google.cloud.firestore.Firestore.class, value)); return true;
        case "healthcheckconsumerenabled":
        case "healthCheckConsumerEnabled": target.setHealthCheckConsumerEnabled(property(camelContext, boolean.class, value)); return true;
        case "healthcheckproducerenabled":
        case "healthCheckProducerEnabled": target.setHealthCheckProducerEnabled(property(camelContext, boolean.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.google.firestore.GoogleFirestoreOperations.class, value)); return true;
        case "projectid":
        case "projectId": getOrCreateConfiguration(target).setProjectId(property(camelContext, java.lang.String.class, value)); return true;
        case "realtimeupdates":
        case "realtimeUpdates": getOrCreateConfiguration(target).setRealtimeUpdates(property(camelContext, boolean.class, value)); return true;
        case "serviceaccountkey":
        case "serviceAccountKey": getOrCreateConfiguration(target).setServiceAccountKey(property(camelContext, java.lang.String.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public String[] getAutowiredNames() {
        return new String[]{"firestoreClient"};
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return boolean.class;
        case "configuration": return org.apache.camel.component.google.firestore.GoogleFirestoreConfiguration.class;
        case "databaseid":
        case "databaseId": return java.lang.String.class;
        case "documentid":
        case "documentId": return java.lang.String.class;
        case "firestoreclient":
        case "firestoreClient": return com.google.cloud.firestore.Firestore.class;
        case "healthcheckconsumerenabled":
        case "healthCheckConsumerEnabled": return boolean.class;
        case "healthcheckproducerenabled":
        case "healthCheckProducerEnabled": return boolean.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "operation": return org.apache.camel.component.google.firestore.GoogleFirestoreOperations.class;
        case "projectid":
        case "projectId": return java.lang.String.class;
        case "realtimeupdates":
        case "realtimeUpdates": return boolean.class;
        case "serviceaccountkey":
        case "serviceAccountKey": return java.lang.String.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        GoogleFirestoreComponent target = (GoogleFirestoreComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "configuration": return target.getConfiguration();
        case "databaseid":
        case "databaseId": return getOrCreateConfiguration(target).getDatabaseId();
        case "documentid":
        case "documentId": return getOrCreateConfiguration(target).getDocumentId();
        case "firestoreclient":
        case "firestoreClient": return getOrCreateConfiguration(target).getFirestoreClient();
        case "healthcheckconsumerenabled":
        case "healthCheckConsumerEnabled": return target.isHealthCheckConsumerEnabled();
        case "healthcheckproducerenabled":
        case "healthCheckProducerEnabled": return target.isHealthCheckProducerEnabled();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "operation": return getOrCreateConfiguration(target).getOperation();
        case "projectid":
        case "projectId": return getOrCreateConfiguration(target).getProjectId();
        case "realtimeupdates":
        case "realtimeUpdates": return getOrCreateConfiguration(target).isRealtimeUpdates();
        case "serviceaccountkey":
        case "serviceAccountKey": return getOrCreateConfiguration(target).getServiceAccountKey();
        default: return null;
        }
    }
}

