code: func updateProvisionWatcherFields(from models.ProvisionWatcher, to *models.ProvisionWatcher, w http.ResponseWriter) error {
  	if from.Identifiers != nil {
  		to.Identifiers = from.Identifiers
  	}
  	if from.Origin != 0 {
  		to.Origin = from.Origin
  	}
  	if from.Name != "" {
  		// Check that the name is unique
  		checkPW, err := dbClient.GetProvisionWatcherByName(from.Name)
  		if err != nil {
  			if err != db.ErrNotFound {
  				http.Error(w, err.Error(), http.StatusServiceUnavailable)
  				return err
  			}
  		}
  		// Found one, compare the IDs to see if its another provision watcher
  		if err != db.ErrNotFound {
  			if checkPW.Id != to.Id {
  				err = errors.New("Duplicate name for the provision watcher")
  				http.Error(w, err.Error(), http.StatusConflict)
  				return err
  			}
  		}
  		to.Name = from.Name
  	}
  
  	return nil
  }
docs: // Update the relevant fields of the provision watcher