def _entity_with_credentials(credentials, cli_entity_cls):
    """Create entity class using credentials. If credentials is None will
    return cli_entity_cls itself

    :param credentials: tuple (login, password)
    :param cli_entity_cls: Cli Entity Class
    :return: Cli Entity Class
    """
    if credentials is not None:
        cli_entity_cls = cli_entity_cls.with_user(*credentials)
    return cli_entity_cls
