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

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!
 */
@SuppressWarnings("unchecked")
public class EventHubsComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    private org.apache.camel.component.azure.eventhubs.EventHubsConfiguration getOrCreateConfiguration(EventHubsComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.azure.eventhubs.EventHubsConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        EventHubsComponent target = (EventHubsComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "amqpretryoptions":
        case "amqpRetryOptions": getOrCreateConfiguration(target).setAmqpRetryOptions(property(camelContext, com.azure.core.amqp.AmqpRetryOptions.class, value)); return true;
        case "amqptransporttype":
        case "amqpTransportType": getOrCreateConfiguration(target).setAmqpTransportType(property(camelContext, com.azure.core.amqp.AmqpTransportType.class, value)); return true;
        case "autodiscoverclient":
        case "autoDiscoverClient": getOrCreateConfiguration(target).setAutoDiscoverClient(property(camelContext, boolean.class, value)); return true;
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "blobaccesskey":
        case "blobAccessKey": getOrCreateConfiguration(target).setBlobAccessKey(property(camelContext, java.lang.String.class, value)); return true;
        case "blobaccountname":
        case "blobAccountName": getOrCreateConfiguration(target).setBlobAccountName(property(camelContext, java.lang.String.class, value)); return true;
        case "blobcontainername":
        case "blobContainerName": getOrCreateConfiguration(target).setBlobContainerName(property(camelContext, java.lang.String.class, value)); return true;
        case "blobstoragesharedkeycredential":
        case "blobStorageSharedKeyCredential": getOrCreateConfiguration(target).setBlobStorageSharedKeyCredential(property(camelContext, com.azure.storage.common.StorageSharedKeyCredential.class, value)); return true;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
        case "checkpointstore":
        case "checkpointStore": getOrCreateConfiguration(target).setCheckpointStore(property(camelContext, com.azure.messaging.eventhubs.CheckpointStore.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.azure.eventhubs.EventHubsConfiguration.class, value)); return true;
        case "connectionstring":
        case "connectionString": getOrCreateConfiguration(target).setConnectionString(property(camelContext, java.lang.String.class, value)); return true;
        case "consumergroupname":
        case "consumerGroupName": getOrCreateConfiguration(target).setConsumerGroupName(property(camelContext, java.lang.String.class, value)); return true;
        case "eventposition":
        case "eventPosition": getOrCreateConfiguration(target).setEventPosition(property(camelContext, java.util.Map.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "partitionid":
        case "partitionId": getOrCreateConfiguration(target).setPartitionId(property(camelContext, java.lang.String.class, value)); return true;
        case "partitionkey":
        case "partitionKey": getOrCreateConfiguration(target).setPartitionKey(property(camelContext, java.lang.String.class, value)); return true;
        case "prefetchcount":
        case "prefetchCount": getOrCreateConfiguration(target).setPrefetchCount(property(camelContext, int.class, value)); return true;
        case "producerasyncclient":
        case "producerAsyncClient": getOrCreateConfiguration(target).setProducerAsyncClient(property(camelContext, com.azure.messaging.eventhubs.EventHubProducerAsyncClient.class, value)); return true;
        case "sharedaccesskey":
        case "sharedAccessKey": getOrCreateConfiguration(target).setSharedAccessKey(property(camelContext, java.lang.String.class, value)); return true;
        case "sharedaccessname":
        case "sharedAccessName": getOrCreateConfiguration(target).setSharedAccessName(property(camelContext, java.lang.String.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "amqpretryoptions":
        case "amqpRetryOptions": return com.azure.core.amqp.AmqpRetryOptions.class;
        case "amqptransporttype":
        case "amqpTransportType": return com.azure.core.amqp.AmqpTransportType.class;
        case "autodiscoverclient":
        case "autoDiscoverClient": return boolean.class;
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "blobaccesskey":
        case "blobAccessKey": return java.lang.String.class;
        case "blobaccountname":
        case "blobAccountName": return java.lang.String.class;
        case "blobcontainername":
        case "blobContainerName": return java.lang.String.class;
        case "blobstoragesharedkeycredential":
        case "blobStorageSharedKeyCredential": return com.azure.storage.common.StorageSharedKeyCredential.class;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return boolean.class;
        case "checkpointstore":
        case "checkpointStore": return com.azure.messaging.eventhubs.CheckpointStore.class;
        case "configuration": return org.apache.camel.component.azure.eventhubs.EventHubsConfiguration.class;
        case "connectionstring":
        case "connectionString": return java.lang.String.class;
        case "consumergroupname":
        case "consumerGroupName": return java.lang.String.class;
        case "eventposition":
        case "eventPosition": return java.util.Map.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "partitionid":
        case "partitionId": return java.lang.String.class;
        case "partitionkey":
        case "partitionKey": return java.lang.String.class;
        case "prefetchcount":
        case "prefetchCount": return int.class;
        case "producerasyncclient":
        case "producerAsyncClient": return com.azure.messaging.eventhubs.EventHubProducerAsyncClient.class;
        case "sharedaccesskey":
        case "sharedAccessKey": return java.lang.String.class;
        case "sharedaccessname":
        case "sharedAccessName": return java.lang.String.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        EventHubsComponent target = (EventHubsComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "amqpretryoptions":
        case "amqpRetryOptions": return getOrCreateConfiguration(target).getAmqpRetryOptions();
        case "amqptransporttype":
        case "amqpTransportType": return getOrCreateConfiguration(target).getAmqpTransportType();
        case "autodiscoverclient":
        case "autoDiscoverClient": return getOrCreateConfiguration(target).isAutoDiscoverClient();
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "blobaccesskey":
        case "blobAccessKey": return getOrCreateConfiguration(target).getBlobAccessKey();
        case "blobaccountname":
        case "blobAccountName": return getOrCreateConfiguration(target).getBlobAccountName();
        case "blobcontainername":
        case "blobContainerName": return getOrCreateConfiguration(target).getBlobContainerName();
        case "blobstoragesharedkeycredential":
        case "blobStorageSharedKeyCredential": return getOrCreateConfiguration(target).getBlobStorageSharedKeyCredential();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "checkpointstore":
        case "checkpointStore": return getOrCreateConfiguration(target).getCheckpointStore();
        case "configuration": return target.getConfiguration();
        case "connectionstring":
        case "connectionString": return getOrCreateConfiguration(target).getConnectionString();
        case "consumergroupname":
        case "consumerGroupName": return getOrCreateConfiguration(target).getConsumerGroupName();
        case "eventposition":
        case "eventPosition": return getOrCreateConfiguration(target).getEventPosition();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "partitionid":
        case "partitionId": return getOrCreateConfiguration(target).getPartitionId();
        case "partitionkey":
        case "partitionKey": return getOrCreateConfiguration(target).getPartitionKey();
        case "prefetchcount":
        case "prefetchCount": return getOrCreateConfiguration(target).getPrefetchCount();
        case "producerasyncclient":
        case "producerAsyncClient": return getOrCreateConfiguration(target).getProducerAsyncClient();
        case "sharedaccesskey":
        case "sharedAccessKey": return getOrCreateConfiguration(target).getSharedAccessKey();
        case "sharedaccessname":
        case "sharedAccessName": return getOrCreateConfiguration(target).getSharedAccessName();
        default: return null;
        }
    }

    @Override
    public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "eventposition":
        case "eventPosition": return com.azure.messaging.eventhubs.models.EventPosition.class;
        default: return null;
        }
    }
}

