There's been a lot of talk about contractual obligations for these keyboards but I'd be surprised if Apple's contracts work like that.
If Apple was contracting with a keyboard manufacturer, e.g., Logitech, to make these switches and keycaps and so forth, then sure, the contract might stipulate that Apple has to purchase X keyboard parts in Y amount of time.
But Apple designs their own keyboard parts, top-to-bottom. Presumably they tooled up some machinery at "their" factories (Foxconn's factories or whatever) to make all this stuff, and they can tell the factory to just shut off the machines whenever they feel like it. I just don't know who they would have a contractual obligation to, with regard to these keyboards.