Skip to main content

require_exactly_one

def require_exactly_one(*param_names: str,
Decorator to ensure that exactly one of the given keyword arguments is provided (not None).

Raises

ValidationError: If neither or both parameters are provided. Examples @require_exactly_one(“project_id”, “project_name”) def list(*, project_id=None, project_name=None): …