code: func TypeAccessor(obj interface{}) (Type, error) {
  	if typed, ok := obj.(runtime.Object); ok {
  		return objectAccessor{typed}, nil
  	}
  	v, err := conversion.EnforcePtr(obj)
  	if err != nil {
  		return nil, err
  	}
  	t := v.Type()
  	if v.Kind() != reflect.Struct {
  		return nil, fmt.Errorf("expected struct, but got %v: %v (%#v)", v.Kind(), t, v.Interface())
  	}
  
  	typeMeta := v.FieldByName("TypeMeta")
  	if !typeMeta.IsValid() {
  		return nil, fmt.Errorf("struct %v lacks embedded TypeMeta type", t)
  	}
  	a := &genericAccessor{}
  	if err := extractFromTypeMeta(typeMeta, a); err != nil {
  		return nil, fmt.Errorf("unable to find type fields on %#v: %v", typeMeta, err)
  	}
  	return a, nil
  }
docs: // TypeAccessor returns an interface that allows retrieving and modifying the APIVersion
  // and Kind of an in-memory internal object.
  // TODO: this interface is used to test code that does not have ObjectMeta or ListMeta
  // in round tripping (objects which can use apiVersion/kind, but do not fit the Kube
  // api conventions).