Enforcing multiple parameters in a Module

I’m developing a Module and am trying to work out how to ensure my module gets the parameters it needs.

There are two separate parameters, lets call them A and B. My Module requires that either just A is supplied, or just B, or both A and B - the only scenario that is not supported is no parameters so I want the module to error out at this stage. I can make a single parameter required by using the “required=True” flag in the argument_spec but I can’t see how to achieve my desired result short of writing an “if” statement and throwing my own error message.

Any ideas?

ansible-devel is a better forum for this kind of question (both
mailing list and IRC channel).