def validate_depth(self, depth: DepthDefinitionType) -> Optional[int]:
        """ Converts the depth to int and validates that the value can be used.

        :raise ValueError: If the provided depth is not valid
        """
        if depth is not None:
            try:
                depth = int(depth)
            except ValueError:
                raise ValueError(f"Depth '{depth}' can't be converted to int.")

            if depth < 1:
                raise ValueError(f"Depth '{depth}' isn't a positive number")

            return depth
        return None