ValidationStatus¶
ValidationStatus is an enumeration that defines the validation state of a flag. Its purpose is to provide standard constants for displaying the validation result. ValidationStatus is used in the status attribute of the InputFlag class.
ValidationStatus contains three values: VALID (valid flag), INVALID (invalid), and UNDEFINED (unregistered).
Note
The validation status is set automatically when creating an InputFlag instance based on the rules defined in the corresponding Flag.
See also
Documentation for InputFlag — entered flag class using ValidationStatus.
Documentation for Flag — flag class with validation rules.
Documentation for PossibleValues — types of allowed values.
VALID¶
1ValidationStatus.VALID = 'VALID'
Indicates that the flag and its value passed validation.
Flags with this status comply with the rules defined in the possible_values of the corresponding Flag. They can be safely used in application logic without additional checks.
Conditions for receiving VALID status:
Flag with
PossibleValues.NEITHERpassed without a value.Flag with
PossibleValues.ALLpassed with any value or without one.Flag value is in the list of allowed values.
Flag value matches the regular expression.
INVALID¶
1ValidationStatus.INVALID = 'INVALID'
Indicates that the flag or its value did not pass validation.
Flags with this status violate the rules defined in the possible_values of the corresponding Flag. They should be treated as erroneous.
Conditions for receiving INVALID status:
Flag with
PossibleValues.NEITHERpassed with a value.Flag value is not in the list of allowed values.
Flag value does not match the regular expression.
Flag requires a value but was passed without one.
UNDEFINED¶
1ValidationStatus.UNDEFINED = 'UNDEFINED'
Indicates that the entered flag was not registered in the command.
Conditions for receiving UNDEFINED status:
The entered flag is not found among those registered for this command.