class KubernetesInformerAutoConfiguration {

	private static final LogAccessor LOG = new LogAccessor(
			LogFactory.getLog(KubernetesInformerAutoConfiguration.class));

	@Bean
	@ConditionalOnMissingBean
	public SharedInformerFactory sharedInformerFactory(ApiClient client) {
		return new SharedInformerFactory(client);
	}

	@Bean
	@ConditionalOnMissingBean(value = V1Service.class, parameterizedContainer = SharedIndexInformer.class)
	public SharedIndexInformer<V1Service> servicesSharedIndexInformer(SharedInformerFactory sharedInformerFactory,
			ApiClient apiClient, KubernetesNamespaceProvider kubernetesNamespaceProvider,
			KubernetesDiscoveryProperties discoveryProperties) {

		GenericKubernetesApi<V1Service, V1ServiceList> servicesApi = new GenericKubernetesApi<>(V1Service.class,
				V1ServiceList.class, "", "v1", "services", apiClient);

		return sharedInformerFactory.sharedIndexInformerFor(servicesApi, V1Service.class, 0L,
				namespace(discoveryProperties, kubernetesNamespaceProvider));
	}

	@Bean
	@ConditionalOnMissingBean(value = V1Endpoints.class, parameterizedContainer = SharedIndexInformer.class)
	public SharedIndexInformer<V1Endpoints> endpointsSharedIndexInformer(SharedInformerFactory sharedInformerFactory,
			ApiClient apiClient, KubernetesNamespaceProvider kubernetesNamespaceProvider,
			KubernetesDiscoveryProperties discoveryProperties) {

		GenericKubernetesApi<V1Endpoints, V1EndpointsList> servicesApi = new GenericKubernetesApi<>(V1Endpoints.class,
				V1EndpointsList.class, "", "v1", "endpoints", apiClient);

		return sharedInformerFactory.sharedIndexInformerFor(servicesApi, V1Endpoints.class, 0L,
				namespace(discoveryProperties, kubernetesNamespaceProvider));
	}

	@Bean
	@ConditionalOnMissingBean(value = V1Service.class, parameterizedContainer = Lister.class)
	public Lister<V1Service> servicesLister(SharedIndexInformer<V1Service> servicesSharedIndexInformer) {
		return new Lister<>(servicesSharedIndexInformer.getIndexer());
	}

	@Bean
	@ConditionalOnMissingBean(value = V1Endpoints.class, parameterizedContainer = Lister.class)
	public Lister<V1Endpoints> endpointsLister(SharedIndexInformer<V1Endpoints> endpointsSharedIndexInformer) {
		return new Lister<>(endpointsSharedIndexInformer.getIndexer());
	}

	private String namespace(KubernetesDiscoveryProperties discoveryProperties,
			KubernetesNamespaceProvider kubernetesNamespaceProvider) {<FILL_FUNCTION_BODY>}

}

		String namespace;
		if (discoveryProperties.allNamespaces()) {
			namespace = NAMESPACE_ALL;
		}
		else if (kubernetesNamespaceProvider.getNamespace() == null) {
			namespace = NAMESPACE_DEFAULT;
		}
		else {
			namespace = kubernetesNamespaceProvider.getNamespace();
		}

		LOG.debug(() -> "serviceSharedInformer will use namespace : " + namespace);
		return namespace;
	
<no_super_class>