class AuthenticationCustomizer implements ComponentProxyCustomizer {

    @Override
    public void customize(final ComponentProxyComponent proxyComponent, final Map<String, Object> options) {
        consumeOption(options, "authenticationType", authenticationTypeObject -> {
            final String authenticationTypeAsString = String.valueOf(authenticationTypeObject);
            final AuthenticationType authenticationType = AuthenticationType.fromString(authenticationTypeAsString);
            if (authenticationType == AuthenticationType.none) {
                return;
            }

            final SwaggerProxyComponent component = (SwaggerProxyComponent) proxyComponent;

            final CamelContext context = component.getCamelContext();
            final Configuration configuration = new Configuration(this, context, options);

            switch (authenticationType) {
            case oauth2:
                OAuth.setup(component, configuration);
                break;
            case basic:
                Basic.setup(component, configuration);
                break;
            case apiKey:
                ApiKey.setup(component, configuration);
                break;
            default:
                throw new IllegalStateException("Unsupported authentication type: " + authenticationType);
            }
        });
    }

}