code: func (e *Encoder) Encode(event *watch.Event) error {
  	data, err := runtime.Encode(e.embeddedEncoder, event.Object)
  	if err != nil {
  		return err
  	}
  	// FIXME: get rid of json.RawMessage.
  	return e.encoder.Encode(&metav1.WatchEvent{
  		Type:   string(event.Type),
  		Object: runtime.RawExtension{Raw: json.RawMessage(data)},
  	})
  }
docs: // Encode writes an event to the writer. Returns an error
  // if the writer is closed or an object can't be encoded.