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

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

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        KeyVaultEndpoint target = (KeyVaultEndpoint) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "clientid":
        case "clientId": target.getConfiguration().setClientId(property(camelContext, java.lang.String.class, value)); return true;
        case "clientsecret":
        case "clientSecret": target.getConfiguration().setClientSecret(property(camelContext, java.lang.String.class, value)); return true;
        case "credentialtype":
        case "credentialType": target.getConfiguration().setCredentialType(property(camelContext, org.apache.camel.component.azure.key.vault.CredentialType.class, value)); return true;
        case "lazystartproducer":
        case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "operation": target.getConfiguration().setOperation(property(camelContext, org.apache.camel.component.azure.key.vault.KeyVaultOperation.class, value)); return true;
        case "secretclient":
        case "secretClient": target.getConfiguration().setSecretClient(property(camelContext, com.azure.security.keyvault.secrets.SecretClient.class, value)); return true;
        case "tenantid":
        case "tenantId": target.getConfiguration().setTenantId(property(camelContext, java.lang.String.class, value)); return true;
        default: return false;
        }
    }

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

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "clientid":
        case "clientId": return java.lang.String.class;
        case "clientsecret":
        case "clientSecret": return java.lang.String.class;
        case "credentialtype":
        case "credentialType": return org.apache.camel.component.azure.key.vault.CredentialType.class;
        case "lazystartproducer":
        case "lazyStartProducer": return boolean.class;
        case "operation": return org.apache.camel.component.azure.key.vault.KeyVaultOperation.class;
        case "secretclient":
        case "secretClient": return com.azure.security.keyvault.secrets.SecretClient.class;
        case "tenantid":
        case "tenantId": return java.lang.String.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        KeyVaultEndpoint target = (KeyVaultEndpoint) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "clientid":
        case "clientId": return target.getConfiguration().getClientId();
        case "clientsecret":
        case "clientSecret": return target.getConfiguration().getClientSecret();
        case "credentialtype":
        case "credentialType": return target.getConfiguration().getCredentialType();
        case "lazystartproducer":
        case "lazyStartProducer": return target.isLazyStartProducer();
        case "operation": return target.getConfiguration().getOperation();
        case "secretclient":
        case "secretClient": return target.getConfiguration().getSecretClient();
        case "tenantid":
        case "tenantId": return target.getConfiguration().getTenantId();
        default: return null;
        }
    }
}

