If a pilot has been officially diagnosed with sleep apnea, I would prefer/hope/pray they have that machine tethered to them and be ready to perform.
If you don’t officially have it, don’t claim it.
If you don’t have it but it helps you gain meaningful rest, by all means buy one. I fly with several folks who carry/use them and haven’t been tested. That is between them and their AME. None of my business.