code: func transformObject(ctx context.Context, obj runtime.Object, opts interface{}, mediaType negotiation.MediaTypeOptions, scope *RequestScope, req *http.Request) (runtime.Object, error) {
  	if _, ok := obj.(*metav1.Status); ok {
  		return obj, nil
  	}
  	if err := setObjectSelfLink(ctx, obj, req, scope.Namer); err != nil {
  		return nil, err
  	}
  
  	switch target := mediaType.Convert; {
  	case target == nil:
  		return obj, nil
  
  	case target.Kind == "PartialObjectMetadata" && target.GroupVersion() == metav1beta1.SchemeGroupVersion:
  		return asV1Beta1PartialObjectMetadata(obj)
  
  	case target.Kind == "PartialObjectMetadataList" && target.GroupVersion() == metav1beta1.SchemeGroupVersion:
  		return asV1Beta1PartialObjectMetadataList(obj)
  
  	case target.Kind == "Table" && target.GroupVersion() == metav1beta1.SchemeGroupVersion:
  		options, ok := opts.(*metav1beta1.TableOptions)
  		if !ok {
  			return nil, fmt.Errorf("unexpected TableOptions, got %T", opts)
  		}
  		return asV1Beta1Table(ctx, obj, options, scope)
  
  	default:
  		accepted, _ := negotiation.MediaTypesForSerializer(metainternalversion.Codecs)
  		err := negotiation.NewNotAcceptableError(accepted)
  		return nil, err
  	}
  }
docs: // transformObject takes the object as returned by storage and ensures it is in
  // the client's desired form, as well as ensuring any API level fields like self-link
  // are properly set.