code: func New(c *Config) (*Client, error) {
  	config := *c
  	if err := SetKubernetesDefaults(&config); err != nil {
  		return nil, err
  	}
  	client, err := RESTClientFor(&config)
  	if err != nil {
  		return nil, err
  	}
  
  	discoveryConfig := *c
  	discoveryClient, err := NewDiscoveryClientForConfig(&discoveryConfig)
  	if err != nil {
  		return nil, err
  	}
  
  	var autoscalingClient *AutoscalingClient
  	if registered.IsRegistered(autoscaling.GroupName) {
  		autoscalingConfig := *c
  		autoscalingClient, err = NewAutoscaling(&autoscalingConfig)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	var batchClient *BatchClient
  	if registered.IsRegistered(batch.GroupName) {
  		batchConfig := *c
  		batchClient, err = NewBatch(&batchConfig)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	var extensionsClient *ExtensionsClient
  	if registered.IsRegistered(extensions.GroupName) {
  		extensionsConfig := *c
  		extensionsClient, err = NewExtensions(&extensionsConfig)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	return &Client{RESTClient: client, AutoscalingClient: autoscalingClient, BatchClient: batchClient, ExtensionsClient: extensionsClient, DiscoveryClient: discoveryClient}, nil
  }
docs: // New creates a Kubernetes client for the given config. This client works with pods,
  // replication controllers, daemons, and services. It allows operations such as list, get, update
  // and delete on these objects. An error is returned if the provided configuration
  // is not valid.