Even though the 2e sha'ir was a wizard, they basically had to rewrite the entire class and come up with completely new rules for spellcasting. I think warlock makes the most thematic sense in 5e, and it's actually going to require the least mechanical rewriting of any candidate class.
I would not force a sha'ir to be chain pact, but if he is not, I'd say the gen is too strong-willed to follow any command besides fetching spells. (In other words, no scouting and no combat.) If the sha'ir does take the pact of the chain, the gen is its familiar (use mephit stats or something?), it cannot be summoned in any other form, and it is unavailable while it is seeking a spell. All chain pact rules apply in terms of combat and scouting, etc.
Other than that, just replace all of the patron-specific stuff with the spell-fetching power and a fluffy genie-diplomacy feature.
One of the warlock's existing spell slots is dedicated to this feature; the gen can be sent to find spells to fill it. That slot cannot be used to cast any of the warlock's "normal" spells known, but it could be filled by the gen with a spell that duplicates one on that list.
The gen-supplied spell can be of a level no higher than the sha'ir's warlock spell-slot level. Search time is 1 minute for spells that could already be known, a short rest for other arcane spells (wizard, bard, sorcerer), and a long rest for divine spells (cleric, druid, paladin, ranger). Divine spells require a Persuasion (Charisma) check with a DC of 15 plus the spell's level; on a failure, the spell is not obtained and the slot recharges with the spell it held most recently.
Once it has been used to cast a spell, the gen slot does not refresh until the end of a short rest; however, the gen can be sent to swap out the spell as often as desired. (It just won't be usable again until the slot recharges.)
At level 11, the gen's dedicated spell slot is freed up and once again acts like a normal warlock spell slot. At this point, the gen takes over the highest arcanum slot: At each level where the warlock would learn a new arcanum, the gen is tasked instead with providing a spell of that level. Arcana of lower levels are learned and become "fixed" as normal. Again, once the gen-supplied spell has been used, the slot will not recharge until the end of a long rest, but the gen can be sent to swap out the spell as often as desired.