func (self *Scheme) rawExtensionToEmbeddedObject(in *RawExtension, out *EmbeddedObject, s conversion.Scope) error {
	if len(in.RawJSON) == 0 || (len(in.RawJSON) == 4 && string(in.RawJSON) == "null") {
		out.Object = nil
		return nil
	}
	inVersion, outVersion, scheme := self.fromScope(s)
	_, kind, err := scheme.raw.DataVersionAndKind(in.RawJSON)
	if err != nil {
		return err
	}
	inObj, err := scheme.New(inVersion, kind)
	if err != nil {
		return err
	}
	err = scheme.DecodeInto(in.RawJSON, inObj)
	if err != nil {
		return err
	}
	outObj, err := scheme.New(outVersion, kind)
	if err != nil {
		return err
	}
	err = scheme.Convert(inObj, outObj)
	if err != nil {
		return err
	}
	err = s.Convert(
		&emptyPlugin{PluginBase: PluginBase{Kind: ""}},
		outObj,
		conversion.SourceToDest|conversion.IgnoreMissingFields|conversion.AllowDifferentFieldTypeNames,
	)
	if err != nil {
		return err
	}
	out.Object = outObj
	return nil
}
rawExtensionToEmbeddedObject does the conversion you would expect from the name, using the information
given in conversion.Scope. It's placed in all schemes as a ConversionFunc to enable plugins;
see the comment for RawExtension.
package runtime
import (
	"fmt"
	"reflect"
	"github.com/GoogleCloudPlatform/kubernetes/pkg/conversion"
)
type Scheme struct {
	raw *conversion.Scheme
}
func (self *Scheme) fromScope(s conversion.Scope) (inVersion, outVersion string, scheme *Scheme) {
	scheme = self
	inVersion = s.Meta().SrcVersion
	outVersion = s.Meta().DestVersion
	return inVersion, outVersion, scheme
}
type emptyPlugin struct {
	PluginBase `json:",inline"`
}
func (self *Scheme) embeddedObjectToRawExtension(in *EmbeddedObject, out *RawExtension, s conversion.Scope) error {
	if in.Object == nil {
		out.RawJSON = []byte("null")
		return nil
	}
	_, outVersion, scheme := self.fromScope(s)
	_, kind, err := scheme.raw.ObjectVersionAndKind(in.Object)
	if err != nil {
		return err
	}
	outObj, err := scheme.New(outVersion, kind)
	if err != nil {
		return err
	}
	err = s.Convert(in.Object, outObj, 0)
	if err != nil {
		return err
	}
	err = s.Convert(
		&emptyPlugin{PluginBase: PluginBase{Kind: kind}},
		outObj,
		conversion.SourceToDest|conversion.IgnoreMissingFields|conversion.AllowDifferentFieldTypeNames,
	)
	if err != nil {
		return err
	}
	raw, err := scheme.EncodeToVersion(outObj, outVersion)
	if err != nil {
		return err
	}
	out.RawJSON = raw
	return nil
}