code: func validateConfig(config *ProviderConfig) error {
  	// Validate the inputs
  	if config == nil {
  		return fmt.Errorf("missing config")
  	}
  	if config.Service == nil {
  		return fmt.Errorf("missing service")
  	}
  	if config.Service.Service == "" {
  		return fmt.Errorf("missing service name")
  	}
  	if config.Service.ServiceVersion == "" {
  		return fmt.Errorf("missing service version")
  	}
  	if config.Service.ResourceType == "" {
  		return fmt.Errorf("missing service resource type")
  	}
  	if config.Handlers == nil && len(config.Service.Capabilities) != 0 {
  		return fmt.Errorf("missing handlers")
  	}
  	for c := range config.Service.Capabilities {
  		if _, ok := config.Handlers[c]; !ok {
  			return fmt.Errorf("missing handler for '%s' capability", c)
  		}
  	}
  	if config.ResourceGroup == "" {
  		return fmt.Errorf("missing resource group")
  	}
  	if config.Token == "" {
  		config.Token = os.Getenv("ATLAS_TOKEN")
  	}
  	if config.Token == "" {
  		return fmt.Errorf("missing token")
  	}
  
  	// Default the endpoint
  	if config.Endpoint == "" {
  		config.Endpoint = DefaultEndpoint
  		if end := os.Getenv("SCADA_ENDPOINT"); end != "" {
  			config.Endpoint = end
  		}
  	}
  	return nil
  }
docs: // validateConfig is used to sanity check the configuration