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

#include "config.h"

#include <glib.h>

#include "fwupd-plugin-struct.h"

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

/**
 * fwupd_plugin_flag_to_string:
 * @val: value, e.g. %FWUPD_PLUGIN_FLAG_DISABLED
 *
 * Converts an enumerated value to a string.
 *
 * Returns: identifier string
 *
 * Since: 1.5.0
 **/
const gchar *
fwupd_plugin_flag_to_string(FwupdPluginFlags val)
{
    if (val == FWUPD_PLUGIN_FLAG_NONE)
        return "none";
    if (val == FWUPD_PLUGIN_FLAG_DISABLED)
        return "disabled";
    if (val == FWUPD_PLUGIN_FLAG_USER_WARNING)
        return "user-warning";
    if (val == FWUPD_PLUGIN_FLAG_CLEAR_UPDATABLE)
        return "clear-updatable";
    if (val == FWUPD_PLUGIN_FLAG_NO_HARDWARE)
        return "no-hardware";
    if (val == FWUPD_PLUGIN_FLAG_CAPSULES_UNSUPPORTED)
        return "capsules-unsupported";
    if (val == FWUPD_PLUGIN_FLAG_UNLOCK_REQUIRED)
        return "unlock-required";
    if (val == FWUPD_PLUGIN_FLAG_EFIVAR_NOT_MOUNTED)
        return "efivar-not-mounted";
    if (val == FWUPD_PLUGIN_FLAG_ESP_NOT_FOUND)
        return "esp-not-found";
    if (val == FWUPD_PLUGIN_FLAG_LEGACY_BIOS)
        return "legacy-bios";
    if (val == FWUPD_PLUGIN_FLAG_FAILED_OPEN)
        return "failed-open";
    if (val == FWUPD_PLUGIN_FLAG_REQUIRE_HWID)
        return "require-hwid";
    if (val == FWUPD_PLUGIN_FLAG_KERNEL_TOO_OLD)
        return "kernel-too-old";
    if (val == FWUPD_PLUGIN_FLAG_AUTH_REQUIRED)
        return "auth-required";
    if (val == FWUPD_PLUGIN_FLAG_SECURE_CONFIG)
        return "secure-config";
    if (val == FWUPD_PLUGIN_FLAG_MODULAR)
        return "modular";
    if (val == FWUPD_PLUGIN_FLAG_MEASURE_SYSTEM_INTEGRITY)
        return "measure-system-integrity";
    if (val == FWUPD_PLUGIN_FLAG_ESP_NOT_VALID)
        return "esp-not-valid";
    if (val == FWUPD_PLUGIN_FLAG_READY)
        return "ready";
    if (val == FWUPD_PLUGIN_FLAG_TEST_ONLY)
        return "test-only";
    if (val == FWUPD_PLUGIN_FLAG_MUTABLE_ENUMERATION)
        return "mutable-enumeration";
    return NULL;
}
/**
 * fwupd_plugin_flag_from_string:
 * @val: (nullable): a string, e.g. `disabled`
 *
 * Converts a string to an enumerated value.
 *
 * Returns: enumerated value
 *
 * Since: 1.5.0
 **/
FwupdPluginFlags
fwupd_plugin_flag_from_string(const gchar *val)
{
    if (g_strcmp0(val, "none") == 0)
        return FWUPD_PLUGIN_FLAG_NONE;
    if (g_strcmp0(val, "disabled") == 0)
        return FWUPD_PLUGIN_FLAG_DISABLED;
    if (g_strcmp0(val, "user-warning") == 0)
        return FWUPD_PLUGIN_FLAG_USER_WARNING;
    if (g_strcmp0(val, "clear-updatable") == 0)
        return FWUPD_PLUGIN_FLAG_CLEAR_UPDATABLE;
    if (g_strcmp0(val, "no-hardware") == 0)
        return FWUPD_PLUGIN_FLAG_NO_HARDWARE;
    if (g_strcmp0(val, "capsules-unsupported") == 0)
        return FWUPD_PLUGIN_FLAG_CAPSULES_UNSUPPORTED;
    if (g_strcmp0(val, "unlock-required") == 0)
        return FWUPD_PLUGIN_FLAG_UNLOCK_REQUIRED;
    if (g_strcmp0(val, "efivar-not-mounted") == 0)
        return FWUPD_PLUGIN_FLAG_EFIVAR_NOT_MOUNTED;
    if (g_strcmp0(val, "esp-not-found") == 0)
        return FWUPD_PLUGIN_FLAG_ESP_NOT_FOUND;
    if (g_strcmp0(val, "legacy-bios") == 0)
        return FWUPD_PLUGIN_FLAG_LEGACY_BIOS;
    if (g_strcmp0(val, "failed-open") == 0)
        return FWUPD_PLUGIN_FLAG_FAILED_OPEN;
    if (g_strcmp0(val, "require-hwid") == 0)
        return FWUPD_PLUGIN_FLAG_REQUIRE_HWID;
    if (g_strcmp0(val, "kernel-too-old") == 0)
        return FWUPD_PLUGIN_FLAG_KERNEL_TOO_OLD;
    if (g_strcmp0(val, "auth-required") == 0)
        return FWUPD_PLUGIN_FLAG_AUTH_REQUIRED;
    if (g_strcmp0(val, "secure-config") == 0)
        return FWUPD_PLUGIN_FLAG_SECURE_CONFIG;
    if (g_strcmp0(val, "modular") == 0)
        return FWUPD_PLUGIN_FLAG_MODULAR;
    if (g_strcmp0(val, "measure-system-integrity") == 0)
        return FWUPD_PLUGIN_FLAG_MEASURE_SYSTEM_INTEGRITY;
    if (g_strcmp0(val, "esp-not-valid") == 0)
        return FWUPD_PLUGIN_FLAG_ESP_NOT_VALID;
    if (g_strcmp0(val, "ready") == 0)
        return FWUPD_PLUGIN_FLAG_READY;
    if (g_strcmp0(val, "test-only") == 0)
        return FWUPD_PLUGIN_FLAG_TEST_ONLY;
    if (g_strcmp0(val, "mutable-enumeration") == 0)
        return FWUPD_PLUGIN_FLAG_MUTABLE_ENUMERATION;
    return FWUPD_PLUGIN_FLAG_UNKNOWN;
}
