def _validate_int(value, content):
    """Return parameter value as an integer.
    :param str value: The raw parameter value.
    :param dict content: The template parameter definition.
    :returns: int
    """
    try:
        original = str(value)
        value = int(value)
    except (ValueError, UnicodeEncodeError):
        raise TypeError("'{}' is not a valid integer.".format(value))
    if str(value) != original:
        raise TypeError("'{}' is not a valid integer.".format(value))
    try:
        if value < int(content['minValue']):
            raise ValueError('Minimum value: {}'.format(content['minValue']))
    except KeyError:
        pass
    try:
        if value > int(content['maxValue']):
            raise ValueError('Maximum value: {}'.format(content['maxValue']))
    except KeyError:
        pass
    return value
