def _refresh_token(api_key):
    '\n    Gets a new token and sets the needed fields.\n    '
    refresh_token_key = _get_token_info_by_api_key(api_key, REFRESH_TOKEN)
    response = _request_refresh_token_with_retries(refresh_token_key)
    authentications_response_info = response.json()
    if (not response.ok):
        return _handle_authentications_error(f'Could not refresh token: {response.text}')
    API_KEYS_TO_TOKEN_DATA[api_key] = authentications_response_info
    _set_api_key_authentication_status(api_key, True)
    _calculate_and_set_time_to_refresh(api_key)
    get_logger().info(f'Refreshed access token, the new token info: {API_KEYS_TO_TOKEN_DATA[api_key]}')
    return True
Gets a new token and sets the needed fields.
def _refresh_token(api_key):
    '\n    \n    '
    refresh_token_key = _get_token_info_by_api_key(api_key, REFRESH_TOKEN)
    response = _request_refresh_token_with_retries(refresh_token_key)
    authentications_response_info = response.json()
    if (not response.ok):
        return _handle_authentications_error(f'Could not refresh token: {response.text}')
    API_KEYS_TO_TOKEN_DATA[api_key] = authentications_response_info
    _set_api_key_authentication_status(api_key, True)
    _calculate_and_set_time_to_refresh(api_key)
    get_logger().info(f'Refreshed access token, the new token info: {API_KEYS_TO_TOKEN_DATA[api_key]}')
    return True