def set_bool_param(params, name, value):
    """
    Set a boolean parameter if applicable.

    :param dict params: A dict containing API call parameters.

    :param str name: The name of the parameter to set.

    :param bool value:
        The value of the parameter. If ``None``, the field will not be set. If
        ``True`` or ``False``, the relevant field in ``params`` will be set to
        ``'true'`` or ``'false'``. Any other value will raise a `ValueError`.

    :returns: ``None``
    """
    if value is None:
        return

    if value is True:
        params[name] = 'true'
    elif value is False:
        params[name] = 'false'
    else:
        raise ValueError("Parameter '%s' must be boolean or None, got %r." % (
            name, value))