code: func (r *CdromSubresource) ValidateDiff() error {
  	log.Printf("[DEBUG] %s: Beginning CDROM configuration validation", r)
  	dsID := r.Get("datastore_id").(string)
  	path := r.Get("path").(string)
  	clientDevice := r.Get("client_device").(bool)
  	switch {
  	case clientDevice && (dsID != "" || path != ""):
  		return fmt.Errorf("Cannot have both client_device parameter and ISO file parameters (datastore_id, path) set")
  	case !clientDevice && (dsID == "" || path == ""):
  		return fmt.Errorf("Either client_device or datastore_id and path must be set")
  	}
  	log.Printf("[DEBUG] %s: Config validation complete", r)
  	return nil
  }
docs: // ValidateDiff performs any complex validation of an individual
  // cdrom sub-resource that can't be done in schema alone.