code: func AsVersionedObject(infos []*Info, forceList bool, version string, encoder runtime.Encoder) (runtime.Object, error) {
  	objects, err := AsVersionedObjects(infos, version, encoder)
  	if err != nil {
  		return nil, err
  	}
  
  	var object runtime.Object
  	if len(objects) == 1 && !forceList {
  		object = objects[0]
  	} else {
  		object = &api.List{Items: objects}
  		converted, err := tryConvert(api.Scheme, object, version, registered.GroupOrDie(api.GroupName).GroupVersion.Version)
  		if err != nil {
  			return nil, err
  		}
  		object = converted
  	}
  	return object, nil
  }
docs: // AsVersionedObject converts a list of infos into a single object - either a List containing
  // the objects as children, or if only a single Object is present, as that object. The provided
  // version will be preferred as the conversion target, but the Object's mapping version will be
  // used if that version is not present.