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

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 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 "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 "checkpointbatchsize":
        case "checkpointBatchSize": getOrCreateConfiguration(target).setCheckpointBatchSize(property(camelContext, int.class, value)); return true;
        case "checkpointbatchtimeout":
        case "checkpointBatchTimeout": getOrCreateConfiguration(target).setCheckpointBatchTimeout(property(camelContext, int.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 "credentialtype":
        case "credentialType": getOrCreateConfiguration(target).setCredentialType(property(camelContext, org.apache.camel.component.azure.eventhubs.CredentialType.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;
        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[]{"producerAsyncClient"};
    }

    @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 "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 "checkpointbatchsize":
        case "checkpointBatchSize": return int.class;
        case "checkpointbatchtimeout":
        case "checkpointBatchTimeout": return int.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 "credentialtype":
        case "credentialType": return org.apache.camel.component.azure.eventhubs.CredentialType.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;
        case "tokencredential":
        case "tokenCredential": return com.azure.core.credential.TokenCredential.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 "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 "checkpointbatchsize":
        case "checkpointBatchSize": return getOrCreateConfiguration(target).getCheckpointBatchSize();
        case "checkpointbatchtimeout":
        case "checkpointBatchTimeout": return getOrCreateConfiguration(target).getCheckpointBatchTimeout();
        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 "credentialtype":
        case "credentialType": return getOrCreateConfiguration(target).getCredentialType();
        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();
        case "tokencredential":
        case "tokenCredential": return getOrCreateConfiguration(target).getTokenCredential();
        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;
        }
    }
}

