import warnings


def _fix_auth(auth, username=None, password=None, verify=None, cert=None):
    """Updates auth from deprecated parameters username, password, verify and cert."""
    if any(p is not None for p in (username, password, verify, cert)):
        message = 'The use of "username", "password", "verify", and "cert" is deprecated. ' + \
                  'Please use the "auth" keyword during class instantiation. ' + \
                  'These keywords will be removed in a future release.'
        warnings.warn(message, DeprecationWarning)
    if username is not None:
        auth.username = username
    if password is not None:
        auth.password = password
    if verify is not None:
        auth.verify = verify
    if cert is not None:
        auth.cert = cert
    return auth