"""Whether something must be supplied or may be omitted.A two-member modality that five surfaces had each declared for themselves: profile keysbefore declaration export, manual casilla entry, diagnostic findings, the CLI's repairfindings, and a diagnostics helper's parameter. The subject differs at every one ofthem; the question does not.Deliberately generic and deliberately not a ``bool``. A boolean field named``required`` reads the same in a payload whether it was set or defaulted, and it cannotgrow a third member. The vocabularies that DO need a third member -- an unknown, anot-applicable, a zero-by-law -- are separate types and must stay separate; this one isfor the surfaces where the answer is genuinely one of two."""from__future__importannotationsfromenumimportStrEnumfromtypingimportLiteral__all__=["Requirement","RequirementValue"]
[docs]classRequirement(StrEnum):"""Whether a value must be supplied."""REQUIRED="required""""Must be supplied; its absence is a defect the surface reports."""OPTIONAL="optional""""May be omitted, and its absence is not by itself a finding."""
RequirementValue=Literal[Requirement.REQUIRED,Requirement.OPTIONAL]"""The same vocabulary for a strict model field or payload surface.A bare enum under strict validation refuses the plain token a serialised findingcarries, so those fields take this literal over the members above rather than restatingthe pair."""