code: func (s *Scheme) EncodeToVersion(obj Object, destVersion string) (data []byte, err error) {
  	return s.raw.EncodeToVersion(obj, destVersion)
  }
docs: // EncodeToVersion turns the given api object into an appropriate JSON string.
  // Will return an error if the object doesn't have an embedded TypeMeta.
  // Obj may be a pointer to a struct, or a struct. If a struct, a copy
  // must be made. If a pointer, the object may be modified before encoding,
  // but will be put back into its original state before returning.
  //
  // Memory/wire format differences:
  //  * Having to keep track of the Kind and APIVersion fields makes tests
  //    very annoying, so the rule is that they are set only in wire format
  //    (json), not when in native (memory) format. This is possible because
  //    both pieces of information are implicit in the go typed object.
  //     * An exception: note that, if there are embedded API objects of known
  //       type, for example, PodList{... Items []Pod ...}, these embedded
  //       objects must be of the same version of the object they are embedded
  //       within, and their APIVersion and Kind must both be empty.
  //     * Note that the exception does not apply to the APIObject type, which
  //       recursively does Encode()/Decode(), and is capable of expressing any
  //       API object.
  //  * Only versioned objects should be encoded. This means that, if you pass
  //    a native object, Encode will convert it to a versioned object. For
  //    example, an api.Pod will get converted to a v1.Pod. However, if
  //    you pass in an object that's already versioned (v1.Pod), Encode
  //    will not modify it.
  //
  // The purpose of the above complex conversion behavior is to allow us to
  // change the memory format yet not break compatibility with any stored
  // objects, whether they be in our storage layer (e.g., etcd), or in user's
  // config files.