/*
 * This file is auto-generated, do not modify!
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#include "config.h"

#include <glib.h>

#include "fwupd-report-struct.h"

#ifdef G_LOG_DOMAIN
  #undef G_LOG_DOMAIN
#endif
#define G_LOG_DOMAIN "FuStruct"

/**
 * fwupd_report_flag_to_string:
 * @val: value, e.g. %FWUPD_REPORT_FLAG_FROM_OEM
 *
 * Converts an enumerated value to a string.
 *
 * Returns: identifier string
 *
 * Since: 1.9.1
 **/
const gchar *
fwupd_report_flag_to_string(FwupdReportFlags val)
{
    if (val == FWUPD_REPORT_FLAG_NONE)
        return "none";
    if (val == FWUPD_REPORT_FLAG_FROM_OEM)
        return "from-oem";
    if (val == FWUPD_REPORT_FLAG_IS_UPGRADE)
        return "is-upgrade";
    return NULL;
}
/**
 * fwupd_report_flag_from_string:
 * @val: (nullable): a string, e.g. `from-oem`
 *
 * Converts a string to an enumerated value.
 *
 * Returns: enumerated value
 *
 * Since: 1.9.1
 **/
FwupdReportFlags
fwupd_report_flag_from_string(const gchar *val)
{
    if (g_strcmp0(val, "none") == 0)
        return FWUPD_REPORT_FLAG_NONE;
    if (g_strcmp0(val, "from-oem") == 0)
        return FWUPD_REPORT_FLAG_FROM_OEM;
    if (g_strcmp0(val, "is-upgrade") == 0)
        return FWUPD_REPORT_FLAG_IS_UPGRADE;
    return FWUPD_REPORT_FLAG_UNKNOWN;
}
