code: func (r *Registry) Put(item mo.Reference) mo.Reference {
  	r.m.Lock()
  
  	ref := item.Reference()
  	if ref.Type == "" || ref.Value == "" {
  		ref = r.newReference(item)
  		r.setReference(item, ref)
  	}
  
  	if me, ok := item.(mo.Entity); ok {
  		me.Entity().ConfigStatus = types.ManagedEntityStatusGreen
  		me.Entity().OverallStatus = types.ManagedEntityStatusGreen
  		me.Entity().EffectiveRole = []int32{-1} // Admin
  	}
  
  	r.objects[ref] = item
  
  	r.m.Unlock()
  
  	r.applyHandlers(func(o RegisterObject) {
  		o.PutObject(item)
  	})
  
  	return item
  }
docs: // Put adds a new object to Registry, generating a ManagedObjectReference if not already set.