code: function(apiVersion) {
      if (!apiVersion) {
        return undefined;
      }
      var parts = apiVersion.split("/");
      if (parts.length === 1) {
        if (parts[0] === "v1") {
          return {group: '', version: parts[0]};
        }
        return {group: parts[0], version: ''};
      }
      if (parts.length === 2) {
        return {group:parts[0], version: parts[1]};
      }
      Logger.warn('Invalid apiVersion "' + apiVersion + '"');
      return undefined;
    }
docs: port of group_version.go#ParseGroupVersion