def _get_txt_records(domain):
    """
    Retrieve TXT records for a given domain and return list of Record Objects

    :param domain: FQDN
    :return: list of Record objects
    """
    server_id = current_app.config.get("ACME_POWERDNS_SERVERID", "localhost")

    path = f"/api/v1/servers/{server_id}/search-data?q={domain}&max=100&object_type=record"
    function = sys._getframe().f_code.co_name
    log_data = {
        "function": function
    }
    try:
        records = _get(path)
        log_data["message"] = "Retrieved TXT Records Successfully"
        current_app.logger.debug(log_data)

    except Exception as e:
        capture_exception()
        log_data["Exception"] = e
        log_data["message"] = "Failed to Retrieve TXT Records"
        current_app.logger.debug(log_data)
        return []

    txt_records = []
    for record in records:
        cur_record = Record(record)
        txt_records.append(cur_record)
    return txt_records

    Retrieve TXT records for a given domain and return list of Record Objects

    :param domain: FQDN
    :return: list of Record objects
    
lemur/plugins/lemur_acme/powerdns.py