def validate_depth(self, depth: DepthDefinitionType) -> Optional[int]:
if depth is not None:<EOL><INDENT>try:<EOL><INDENT>depth = int(depth)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError(f"<STR_LIT>")<EOL><DEDENT>if depth < <NUM_LIT:1>:<EOL><INDENT>raise ValueError(f"<STR_LIT>")<EOL><DEDENT>return depth<EOL><DEDENT>return None<EOL>
Converts the depth to int and validates that the value can be used.

        :raise ValueError: If the provided depth is not valid