Module netapp_ontap.validations
Copyright © 2021 NetApp Inc. All rights reserved.
This module holds validation functions that can be used for field level validation
Functions
def enum_validation (choices: List[~T]) -> Callable[[~T], NoneType]
-
Verifies that the provided value is one of the possible choices
Args
choices
- The list of choices
Returns
A callable function which validates its input value as being part of the set of choices.
def integer_validation (minimum: int = None, maximum: int = None) -> Callable[[int], NoneType]
-
Verify that the given value is within the acceptable range
Args
minimum
- The minimum value the integer can be
maximum
- The maximum value the integer can be
Returns
A callable function which validates its inputs as being between minimum and maximum.
def len_validation (minimum: int = 0, maximum: int = None) -> Callable[[str], NoneType]
-
Verify the given string is within the acceptable length limits
Args
minimum
- The minimum length the string can be
maximum
- The maximum length the string can be. If unset, maximum is not checked.
Returns
A callable function which validates its input as being between minimum and maximum.