/* auto-generated, do not modify */
#include "config.h"

#include "fu-coswid-struct.h"
#include "fu-byte-array.h"
#include "fu-mem-private.h"
#include "fu-string.h"

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

const gchar *
fu_coswid_tag_to_string(FuCoswidTag val)
{
    if (val == FU_COSWID_TAG_TAG_ID)
        return "tag-id";
    if (val == FU_COSWID_TAG_SOFTWARE_NAME)
        return "software-name";
    if (val == FU_COSWID_TAG_ENTITY)
        return "entity";
    if (val == FU_COSWID_TAG_EVIDENCE)
        return "evidence";
    if (val == FU_COSWID_TAG_LINK)
        return "link";
    if (val == FU_COSWID_TAG_SOFTWARE_META)
        return "software-meta";
    if (val == FU_COSWID_TAG_PAYLOAD)
        return "payload";
    if (val == FU_COSWID_TAG_HASH)
        return "hash";
    if (val == FU_COSWID_TAG_CORPUS)
        return "corpus";
    if (val == FU_COSWID_TAG_PATCH)
        return "patch";
    if (val == FU_COSWID_TAG_MEDIA)
        return "media";
    if (val == FU_COSWID_TAG_SUPPLEMENTAL)
        return "supplemental";
    if (val == FU_COSWID_TAG_TAG_VERSION)
        return "tag-version";
    if (val == FU_COSWID_TAG_SOFTWARE_VERSION)
        return "software-version";
    if (val == FU_COSWID_TAG_VERSION_SCHEME)
        return "version-scheme";
    if (val == FU_COSWID_TAG_LANG)
        return "lang";
    if (val == FU_COSWID_TAG_DIRECTORY)
        return "directory";
    if (val == FU_COSWID_TAG_FILE)
        return "file";
    if (val == FU_COSWID_TAG_PROCESS)
        return "process";
    if (val == FU_COSWID_TAG_RESOURCE)
        return "resource";
    if (val == FU_COSWID_TAG_SIZE)
        return "size";
    if (val == FU_COSWID_TAG_FILE_VERSION)
        return "file-version";
    if (val == FU_COSWID_TAG_KEY)
        return "key";
    if (val == FU_COSWID_TAG_LOCATION)
        return "location";
    if (val == FU_COSWID_TAG_FS_NAME)
        return "fs-name";
    if (val == FU_COSWID_TAG_ROOT)
        return "root";
    if (val == FU_COSWID_TAG_PATH_ELEMENTS)
        return "path-elements";
    if (val == FU_COSWID_TAG_PROCESS_NAME)
        return "process-name";
    if (val == FU_COSWID_TAG_PID)
        return "pid";
    if (val == FU_COSWID_TAG_TYPE)
        return "type";
    if (val == FU_COSWID_TAG_MISSING30)
        return "missing30";
    if (val == FU_COSWID_TAG_ENTITY_NAME)
        return "entity-name";
    if (val == FU_COSWID_TAG_REG_ID)
        return "reg-id";
    if (val == FU_COSWID_TAG_ROLE)
        return "role";
    if (val == FU_COSWID_TAG_THUMBPRINT)
        return "thumbprint";
    if (val == FU_COSWID_TAG_DATE)
        return "date";
    if (val == FU_COSWID_TAG_DEVICE_ID)
        return "device-id";
    if (val == FU_COSWID_TAG_ARTIFACT)
        return "artifact";
    if (val == FU_COSWID_TAG_HREF)
        return "href";
    if (val == FU_COSWID_TAG_OWNERSHIP)
        return "ownership";
    if (val == FU_COSWID_TAG_REL)
        return "rel";
    if (val == FU_COSWID_TAG_MEDIA_TYPE)
        return "media-type";
    if (val == FU_COSWID_TAG_USE)
        return "use";
    if (val == FU_COSWID_TAG_ACTIVATION_STATUS)
        return "activation-status";
    if (val == FU_COSWID_TAG_CHANNEL_TYPE)
        return "channel-type";
    if (val == FU_COSWID_TAG_COLLOQUIAL_VERSION)
        return "colloquial-version";
    if (val == FU_COSWID_TAG_DESCRIPTION)
        return "description";
    if (val == FU_COSWID_TAG_EDITION)
        return "edition";
    if (val == FU_COSWID_TAG_ENTITLEMENT_DATA_REQUIRED)
        return "entitlement-data-required";
    if (val == FU_COSWID_TAG_ENTITLEMENT_KEY)
        return "entitlement-key";
    if (val == FU_COSWID_TAG_GENERATOR)
        return "generator";
    if (val == FU_COSWID_TAG_PERSISTENT_ID)
        return "persistent-id";
    if (val == FU_COSWID_TAG_PRODUCT)
        return "product";
    if (val == FU_COSWID_TAG_PRODUCT_FAMILY)
        return "product-family";
    if (val == FU_COSWID_TAG_REVISION)
        return "revision";
    if (val == FU_COSWID_TAG_SUMMARY)
        return "summary";
    if (val == FU_COSWID_TAG_UNSPSC_CODE)
        return "unspsc-code";
    if (val == FU_COSWID_TAG_UNSPSC_VERSION)
        return "unspsc-version";
    return NULL;
}
FuCoswidTag
fu_coswid_tag_from_string(const gchar *val)
{
    if (g_strcmp0(val, "tag-id") == 0)
        return FU_COSWID_TAG_TAG_ID;
    if (g_strcmp0(val, "software-name") == 0)
        return FU_COSWID_TAG_SOFTWARE_NAME;
    if (g_strcmp0(val, "entity") == 0)
        return FU_COSWID_TAG_ENTITY;
    if (g_strcmp0(val, "evidence") == 0)
        return FU_COSWID_TAG_EVIDENCE;
    if (g_strcmp0(val, "link") == 0)
        return FU_COSWID_TAG_LINK;
    if (g_strcmp0(val, "software-meta") == 0)
        return FU_COSWID_TAG_SOFTWARE_META;
    if (g_strcmp0(val, "payload") == 0)
        return FU_COSWID_TAG_PAYLOAD;
    if (g_strcmp0(val, "hash") == 0)
        return FU_COSWID_TAG_HASH;
    if (g_strcmp0(val, "corpus") == 0)
        return FU_COSWID_TAG_CORPUS;
    if (g_strcmp0(val, "patch") == 0)
        return FU_COSWID_TAG_PATCH;
    if (g_strcmp0(val, "media") == 0)
        return FU_COSWID_TAG_MEDIA;
    if (g_strcmp0(val, "supplemental") == 0)
        return FU_COSWID_TAG_SUPPLEMENTAL;
    if (g_strcmp0(val, "tag-version") == 0)
        return FU_COSWID_TAG_TAG_VERSION;
    if (g_strcmp0(val, "software-version") == 0)
        return FU_COSWID_TAG_SOFTWARE_VERSION;
    if (g_strcmp0(val, "version-scheme") == 0)
        return FU_COSWID_TAG_VERSION_SCHEME;
    if (g_strcmp0(val, "lang") == 0)
        return FU_COSWID_TAG_LANG;
    if (g_strcmp0(val, "directory") == 0)
        return FU_COSWID_TAG_DIRECTORY;
    if (g_strcmp0(val, "file") == 0)
        return FU_COSWID_TAG_FILE;
    if (g_strcmp0(val, "process") == 0)
        return FU_COSWID_TAG_PROCESS;
    if (g_strcmp0(val, "resource") == 0)
        return FU_COSWID_TAG_RESOURCE;
    if (g_strcmp0(val, "size") == 0)
        return FU_COSWID_TAG_SIZE;
    if (g_strcmp0(val, "file-version") == 0)
        return FU_COSWID_TAG_FILE_VERSION;
    if (g_strcmp0(val, "key") == 0)
        return FU_COSWID_TAG_KEY;
    if (g_strcmp0(val, "location") == 0)
        return FU_COSWID_TAG_LOCATION;
    if (g_strcmp0(val, "fs-name") == 0)
        return FU_COSWID_TAG_FS_NAME;
    if (g_strcmp0(val, "root") == 0)
        return FU_COSWID_TAG_ROOT;
    if (g_strcmp0(val, "path-elements") == 0)
        return FU_COSWID_TAG_PATH_ELEMENTS;
    if (g_strcmp0(val, "process-name") == 0)
        return FU_COSWID_TAG_PROCESS_NAME;
    if (g_strcmp0(val, "pid") == 0)
        return FU_COSWID_TAG_PID;
    if (g_strcmp0(val, "type") == 0)
        return FU_COSWID_TAG_TYPE;
    if (g_strcmp0(val, "missing30") == 0)
        return FU_COSWID_TAG_MISSING30;
    if (g_strcmp0(val, "entity-name") == 0)
        return FU_COSWID_TAG_ENTITY_NAME;
    if (g_strcmp0(val, "reg-id") == 0)
        return FU_COSWID_TAG_REG_ID;
    if (g_strcmp0(val, "role") == 0)
        return FU_COSWID_TAG_ROLE;
    if (g_strcmp0(val, "thumbprint") == 0)
        return FU_COSWID_TAG_THUMBPRINT;
    if (g_strcmp0(val, "date") == 0)
        return FU_COSWID_TAG_DATE;
    if (g_strcmp0(val, "device-id") == 0)
        return FU_COSWID_TAG_DEVICE_ID;
    if (g_strcmp0(val, "artifact") == 0)
        return FU_COSWID_TAG_ARTIFACT;
    if (g_strcmp0(val, "href") == 0)
        return FU_COSWID_TAG_HREF;
    if (g_strcmp0(val, "ownership") == 0)
        return FU_COSWID_TAG_OWNERSHIP;
    if (g_strcmp0(val, "rel") == 0)
        return FU_COSWID_TAG_REL;
    if (g_strcmp0(val, "media-type") == 0)
        return FU_COSWID_TAG_MEDIA_TYPE;
    if (g_strcmp0(val, "use") == 0)
        return FU_COSWID_TAG_USE;
    if (g_strcmp0(val, "activation-status") == 0)
        return FU_COSWID_TAG_ACTIVATION_STATUS;
    if (g_strcmp0(val, "channel-type") == 0)
        return FU_COSWID_TAG_CHANNEL_TYPE;
    if (g_strcmp0(val, "colloquial-version") == 0)
        return FU_COSWID_TAG_COLLOQUIAL_VERSION;
    if (g_strcmp0(val, "description") == 0)
        return FU_COSWID_TAG_DESCRIPTION;
    if (g_strcmp0(val, "edition") == 0)
        return FU_COSWID_TAG_EDITION;
    if (g_strcmp0(val, "entitlement-data-required") == 0)
        return FU_COSWID_TAG_ENTITLEMENT_DATA_REQUIRED;
    if (g_strcmp0(val, "entitlement-key") == 0)
        return FU_COSWID_TAG_ENTITLEMENT_KEY;
    if (g_strcmp0(val, "generator") == 0)
        return FU_COSWID_TAG_GENERATOR;
    if (g_strcmp0(val, "persistent-id") == 0)
        return FU_COSWID_TAG_PERSISTENT_ID;
    if (g_strcmp0(val, "product") == 0)
        return FU_COSWID_TAG_PRODUCT;
    if (g_strcmp0(val, "product-family") == 0)
        return FU_COSWID_TAG_PRODUCT_FAMILY;
    if (g_strcmp0(val, "revision") == 0)
        return FU_COSWID_TAG_REVISION;
    if (g_strcmp0(val, "summary") == 0)
        return FU_COSWID_TAG_SUMMARY;
    if (g_strcmp0(val, "unspsc-code") == 0)
        return FU_COSWID_TAG_UNSPSC_CODE;
    if (g_strcmp0(val, "unspsc-version") == 0)
        return FU_COSWID_TAG_UNSPSC_VERSION;
    return FU_COSWID_TAG_TAG_ID;
}

const gchar *
fu_coswid_version_scheme_to_string(FuCoswidVersionScheme val)
{
    if (val == FU_COSWID_VERSION_SCHEME_UNKNOWN)
        return "unknown";
    if (val == FU_COSWID_VERSION_SCHEME_MULTIPARTNUMERIC)
        return "multipartnumeric";
    if (val == FU_COSWID_VERSION_SCHEME_MULTIPARTNUMERIC_SUFFIX)
        return "multipartnumeric-suffix";
    if (val == FU_COSWID_VERSION_SCHEME_ALPHANUMERIC)
        return "alphanumeric";
    if (val == FU_COSWID_VERSION_SCHEME_DECIMAL)
        return "decimal";
    if (val == FU_COSWID_VERSION_SCHEME_SEMVER)
        return "semver";
    return NULL;
}
FuCoswidVersionScheme
fu_coswid_version_scheme_from_string(const gchar *val)
{
    if (g_strcmp0(val, "unknown") == 0)
        return FU_COSWID_VERSION_SCHEME_UNKNOWN;
    if (g_strcmp0(val, "multipartnumeric") == 0)
        return FU_COSWID_VERSION_SCHEME_MULTIPARTNUMERIC;
    if (g_strcmp0(val, "multipartnumeric-suffix") == 0)
        return FU_COSWID_VERSION_SCHEME_MULTIPARTNUMERIC_SUFFIX;
    if (g_strcmp0(val, "alphanumeric") == 0)
        return FU_COSWID_VERSION_SCHEME_ALPHANUMERIC;
    if (g_strcmp0(val, "decimal") == 0)
        return FU_COSWID_VERSION_SCHEME_DECIMAL;
    if (g_strcmp0(val, "semver") == 0)
        return FU_COSWID_VERSION_SCHEME_SEMVER;
    return FU_COSWID_VERSION_SCHEME_UNKNOWN;
}

const gchar *
fu_coswid_link_rel_to_string(FuCoswidLinkRel val)
{
    if (val == FU_COSWID_LINK_REL_LICENSE)
        return "license";
    if (val == FU_COSWID_LINK_REL_COMPILER)
        return "compiler";
    if (val == FU_COSWID_LINK_REL_UNKNOWN)
        return "unknown";
    if (val == FU_COSWID_LINK_REL_ANCESTOR)
        return "ancestor";
    if (val == FU_COSWID_LINK_REL_COMPONENT)
        return "component";
    if (val == FU_COSWID_LINK_REL_FEATURE)
        return "feature";
    if (val == FU_COSWID_LINK_REL_INSTALLATIONMEDIA)
        return "installationmedia";
    if (val == FU_COSWID_LINK_REL_PACKAGEINSTALLER)
        return "packageinstaller";
    if (val == FU_COSWID_LINK_REL_PARENT)
        return "parent";
    if (val == FU_COSWID_LINK_REL_PATCHES)
        return "patches";
    if (val == FU_COSWID_LINK_REL_REQUIRES)
        return "requires";
    if (val == FU_COSWID_LINK_REL_SEE_ALSO)
        return "see-also";
    if (val == FU_COSWID_LINK_REL_SUPERSEDES)
        return "supersedes";
    if (val == FU_COSWID_LINK_REL_SUPPLEMENTAL)
        return "supplemental";
    return NULL;
}
FuCoswidLinkRel
fu_coswid_link_rel_from_string(const gchar *val)
{
    if (g_strcmp0(val, "license") == 0)
        return FU_COSWID_LINK_REL_LICENSE;
    if (g_strcmp0(val, "compiler") == 0)
        return FU_COSWID_LINK_REL_COMPILER;
    if (g_strcmp0(val, "unknown") == 0)
        return FU_COSWID_LINK_REL_UNKNOWN;
    if (g_strcmp0(val, "ancestor") == 0)
        return FU_COSWID_LINK_REL_ANCESTOR;
    if (g_strcmp0(val, "component") == 0)
        return FU_COSWID_LINK_REL_COMPONENT;
    if (g_strcmp0(val, "feature") == 0)
        return FU_COSWID_LINK_REL_FEATURE;
    if (g_strcmp0(val, "installationmedia") == 0)
        return FU_COSWID_LINK_REL_INSTALLATIONMEDIA;
    if (g_strcmp0(val, "packageinstaller") == 0)
        return FU_COSWID_LINK_REL_PACKAGEINSTALLER;
    if (g_strcmp0(val, "parent") == 0)
        return FU_COSWID_LINK_REL_PARENT;
    if (g_strcmp0(val, "patches") == 0)
        return FU_COSWID_LINK_REL_PATCHES;
    if (g_strcmp0(val, "requires") == 0)
        return FU_COSWID_LINK_REL_REQUIRES;
    if (g_strcmp0(val, "see-also") == 0)
        return FU_COSWID_LINK_REL_SEE_ALSO;
    if (g_strcmp0(val, "supersedes") == 0)
        return FU_COSWID_LINK_REL_SUPERSEDES;
    if (g_strcmp0(val, "supplemental") == 0)
        return FU_COSWID_LINK_REL_SUPPLEMENTAL;
    return FU_COSWID_LINK_REL_LICENSE;
}

const gchar *
fu_coswid_entity_role_to_string(FuCoswidEntityRole val)
{
    if (val == FU_COSWID_ENTITY_ROLE_UNKNOWN)
        return "unknown";
    if (val == FU_COSWID_ENTITY_ROLE_TAG_CREATOR)
        return "tag-creator";
    if (val == FU_COSWID_ENTITY_ROLE_SOFTWARE_CREATOR)
        return "software-creator";
    if (val == FU_COSWID_ENTITY_ROLE_AGGREGATOR)
        return "aggregator";
    if (val == FU_COSWID_ENTITY_ROLE_DISTRIBUTOR)
        return "distributor";
    if (val == FU_COSWID_ENTITY_ROLE_LICENSOR)
        return "licensor";
    if (val == FU_COSWID_ENTITY_ROLE_MAINTAINER)
        return "maintainer";
    return NULL;
}
FuCoswidEntityRole
fu_coswid_entity_role_from_string(const gchar *val)
{
    if (g_strcmp0(val, "unknown") == 0)
        return FU_COSWID_ENTITY_ROLE_UNKNOWN;
    if (g_strcmp0(val, "tag-creator") == 0)
        return FU_COSWID_ENTITY_ROLE_TAG_CREATOR;
    if (g_strcmp0(val, "software-creator") == 0)
        return FU_COSWID_ENTITY_ROLE_SOFTWARE_CREATOR;
    if (g_strcmp0(val, "aggregator") == 0)
        return FU_COSWID_ENTITY_ROLE_AGGREGATOR;
    if (g_strcmp0(val, "distributor") == 0)
        return FU_COSWID_ENTITY_ROLE_DISTRIBUTOR;
    if (g_strcmp0(val, "licensor") == 0)
        return FU_COSWID_ENTITY_ROLE_LICENSOR;
    if (g_strcmp0(val, "maintainer") == 0)
        return FU_COSWID_ENTITY_ROLE_MAINTAINER;
    return FU_COSWID_ENTITY_ROLE_UNKNOWN;
}

const gchar *
fu_coswid_hash_alg_to_string(FuCoswidHashAlg val)
{
    if (val == FU_COSWID_HASH_ALG_UNKNOWN)
        return "unknown";
    if (val == FU_COSWID_HASH_ALG_SHA256)
        return "sha256";
    if (val == FU_COSWID_HASH_ALG_SHA384)
        return "sha384";
    if (val == FU_COSWID_HASH_ALG_SHA512)
        return "sha512";
    return NULL;
}
FuCoswidHashAlg
fu_coswid_hash_alg_from_string(const gchar *val)
{
    if (g_strcmp0(val, "unknown") == 0)
        return FU_COSWID_HASH_ALG_UNKNOWN;
    if (g_strcmp0(val, "sha256") == 0)
        return FU_COSWID_HASH_ALG_SHA256;
    if (g_strcmp0(val, "sha384") == 0)
        return FU_COSWID_HASH_ALG_SHA384;
    if (g_strcmp0(val, "sha512") == 0)
        return FU_COSWID_HASH_ALG_SHA512;
    return FU_COSWID_HASH_ALG_UNKNOWN;
}
