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

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

    private org.apache.camel.component.azure.functions.FunctionsConfiguration getOrCreateConfiguration(FunctionsComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.azure.functions.FunctionsConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        FunctionsComponent target = (FunctionsComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "appservicemanager":
        case "appServiceManager": getOrCreateConfiguration(target).setAppServiceManager(property(camelContext, com.azure.resourcemanager.appservice.AppServiceManager.class, value)); return true;
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "clientid":
        case "clientId": getOrCreateConfiguration(target).setClientId(property(camelContext, java.lang.String.class, value)); return true;
        case "clientsecret":
        case "clientSecret": getOrCreateConfiguration(target).setClientSecret(property(camelContext, java.lang.String.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.azure.functions.FunctionsConfiguration.class, value)); return true;
        case "connectiontimeout":
        case "connectionTimeout": getOrCreateConfiguration(target).setConnectionTimeout(property(camelContext, int.class, value)); return true;
        case "credentialtype":
        case "credentialType": getOrCreateConfiguration(target).setCredentialType(property(camelContext, org.apache.camel.component.azure.functions.CredentialType.class, value)); return true;
        case "functionkey":
        case "functionKey": getOrCreateConfiguration(target).setFunctionKey(property(camelContext, java.lang.String.class, value)); return true;
        case "hostkey":
        case "hostKey": getOrCreateConfiguration(target).setHostKey(property(camelContext, java.lang.String.class, value)); return true;
        case "httpmethod":
        case "httpMethod": getOrCreateConfiguration(target).setHttpMethod(property(camelContext, java.lang.String.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "location": getOrCreateConfiguration(target).setLocation(property(camelContext, java.lang.String.class, value)); return true;
        case "operation": getOrCreateConfiguration(target).setOperation(property(camelContext, org.apache.camel.component.azure.functions.FunctionsOperations.class, value)); return true;
        case "readtimeout":
        case "readTimeout": getOrCreateConfiguration(target).setReadTimeout(property(camelContext, int.class, value)); return true;
        case "resourcegroup":
        case "resourceGroup": getOrCreateConfiguration(target).setResourceGroup(property(camelContext, java.lang.String.class, value)); return true;
        case "runtime": getOrCreateConfiguration(target).setRuntime(property(camelContext, java.lang.String.class, value)); return true;
        case "runtimeversion":
        case "runtimeVersion": getOrCreateConfiguration(target).setRuntimeVersion(property(camelContext, java.lang.String.class, value)); return true;
        case "storageaccountconnectionstring":
        case "storageAccountConnectionString": getOrCreateConfiguration(target).setStorageAccountConnectionString(property(camelContext, java.lang.String.class, value)); return true;
        case "subscriptionid":
        case "subscriptionId": getOrCreateConfiguration(target).setSubscriptionId(property(camelContext, java.lang.String.class, value)); return true;
        case "tenantid":
        case "tenantId": getOrCreateConfiguration(target).setTenantId(property(camelContext, java.lang.String.class, value)); return true;
        case "tokencredential":
        case "tokenCredential": getOrCreateConfiguration(target).setTokenCredential(property(camelContext, com.azure.core.credential.TokenCredential.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public String[] getAutowiredNames() {
        return new String[]{"appServiceManager", "tokenCredential"};
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "appservicemanager":
        case "appServiceManager": return com.azure.resourcemanager.appservice.AppServiceManager.class;
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "clientid":
        case "clientId": return java.lang.String.class;
        case "clientsecret":
        case "clientSecret": return java.lang.String.class;
        case "configuration": return org.apache.camel.component.azure.functions.FunctionsConfiguration.class;
        case "connectiontimeout":
        case "connectionTimeout": return int.class;
        case "credentialtype":
        case "credentialType": return org.apache.camel.component.azure.functions.CredentialType.class;
        case "functionkey":
        case "functionKey": return java.lang.String.class;
        case "hostkey":
        case "hostKey": return java.lang.String.class;
        case "httpmethod":
        case "httpMethod": return java.lang.String.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "location": return java.lang.String.class;
        case "operation": return org.apache.camel.component.azure.functions.FunctionsOperations.class;
        case "readtimeout":
        case "readTimeout": return int.class;
        case "resourcegroup":
        case "resourceGroup": return java.lang.String.class;
        case "runtime": return java.lang.String.class;
        case "runtimeversion":
        case "runtimeVersion": return java.lang.String.class;
        case "storageaccountconnectionstring":
        case "storageAccountConnectionString": return java.lang.String.class;
        case "subscriptionid":
        case "subscriptionId": return java.lang.String.class;
        case "tenantid":
        case "tenantId": return java.lang.String.class;
        case "tokencredential":
        case "tokenCredential": return com.azure.core.credential.TokenCredential.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        FunctionsComponent target = (FunctionsComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "appservicemanager":
        case "appServiceManager": return getOrCreateConfiguration(target).getAppServiceManager();
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "clientid":
        case "clientId": return getOrCreateConfiguration(target).getClientId();
        case "clientsecret":
        case "clientSecret": return getOrCreateConfiguration(target).getClientSecret();
        case "configuration": return target.getConfiguration();
        case "connectiontimeout":
        case "connectionTimeout": return getOrCreateConfiguration(target).getConnectionTimeout();
        case "credentialtype":
        case "credentialType": return getOrCreateConfiguration(target).getCredentialType();
        case "functionkey":
        case "functionKey": return getOrCreateConfiguration(target).getFunctionKey();
        case "hostkey":
        case "hostKey": return getOrCreateConfiguration(target).getHostKey();
        case "httpmethod":
        case "httpMethod": return getOrCreateConfiguration(target).getHttpMethod();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "location": return getOrCreateConfiguration(target).getLocation();
        case "operation": return getOrCreateConfiguration(target).getOperation();
        case "readtimeout":
        case "readTimeout": return getOrCreateConfiguration(target).getReadTimeout();
        case "resourcegroup":
        case "resourceGroup": return getOrCreateConfiguration(target).getResourceGroup();
        case "runtime": return getOrCreateConfiguration(target).getRuntime();
        case "runtimeversion":
        case "runtimeVersion": return getOrCreateConfiguration(target).getRuntimeVersion();
        case "storageaccountconnectionstring":
        case "storageAccountConnectionString": return getOrCreateConfiguration(target).getStorageAccountConnectionString();
        case "subscriptionid":
        case "subscriptionId": return getOrCreateConfiguration(target).getSubscriptionId();
        case "tenantid":
        case "tenantId": return getOrCreateConfiguration(target).getTenantId();
        case "tokencredential":
        case "tokenCredential": return getOrCreateConfiguration(target).getTokenCredential();
        default: return null;
        }
    }
}

