/* metadata.c generated by valac 0.56.19, the Vala compiler
 * generated from metadata.vala, do not modify */

#include "protonplus_core.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <json-glib/json-glib.h>
#include <glib-object.h>

#define PROTON_PLUS_UTILS_METADATA_FILENAME ".protonplus"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	PROTON_PLUS_UTILS_METADATA_0_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_RUNNER_ENDPOINT_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_RUNNER_TITLE_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_TAG_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_PROVIDER_ID_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_TOOL_ID_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_LAUNCHER_ID_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_VARIANT_ID_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_RELEASE_ID_PROPERTY,
	PROTON_PLUS_UTILS_METADATA_NUM_PROPERTIES
};
static GParamSpec* proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

struct _ProtonPlusUtilsMetadataPrivate {
	gchar* _runner_endpoint;
	gchar* _runner_title;
	gchar* _tag;
	gchar* _provider_id;
	gchar* _tool_id;
	gchar* _launcher_id;
	gchar* _variant_id;
	gchar* _release_id;
};

static gint ProtonPlusUtilsMetadata_private_offset;
static gpointer proton_plus_utils_metadata_parent_class = NULL;

static void _vala_JsonNode_free (JsonNode* self);
static void proton_plus_utils_metadata_finalize (GObject * obj);
static GType proton_plus_utils_metadata_get_type_once (void);
static void _vala_proton_plus_utils_metadata_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_proton_plus_utils_metadata_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_utils_metadata_get_instance_private (ProtonPlusUtilsMetadata* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusUtilsMetadata_private_offset);
}

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

ProtonPlusUtilsMetadata*
proton_plus_utils_metadata_load (const gchar* directory_path)
{
	ProtonPlusUtilsMetadata* metadata = NULL;
	ProtonPlusUtilsMetadata* _tmp0_;
	gchar* metadata_path = NULL;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	ProtonPlusUtilsMetadata* result;
	g_return_val_if_fail (directory_path != NULL, NULL);
	_tmp0_ = proton_plus_utils_metadata_new ();
	metadata = _tmp0_;
	_tmp1_ = g_build_filename (directory_path, PROTON_PLUS_UTILS_METADATA_FILENAME, NULL);
	metadata_path = _tmp1_;
	_tmp2_ = metadata_path;
	if (g_file_test (_tmp2_, G_FILE_TEST_IS_REGULAR)) {
		JsonNode* root_node = NULL;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		JsonNode* _tmp6_;
		JsonNode* _tmp7_;
		gboolean _tmp8_ = FALSE;
		JsonNode* _tmp9_;
		_tmp3_ = metadata_path;
		_tmp4_ = proton_plus_utils_filesystem_get_file_content (_tmp3_, FALSE);
		_tmp5_ = _tmp4_;
		_tmp6_ = proton_plus_utils_parser_get_node_from_json (_tmp5_);
		_tmp7_ = _tmp6_;
		_g_free0 (_tmp5_);
		root_node = _tmp7_;
		_tmp9_ = root_node;
		if (_tmp9_ != NULL) {
			JsonNode* _tmp10_;
			_tmp10_ = root_node;
			_tmp8_ = json_node_get_node_type (_tmp10_) == JSON_NODE_OBJECT;
		} else {
			_tmp8_ = FALSE;
		}
		if (_tmp8_) {
			JsonObject* root_object = NULL;
			JsonNode* _tmp11_;
			JsonObject* _tmp12_;
			JsonObject* _tmp13_;
			ProtonPlusUtilsMetadata* _tmp14_;
			JsonObject* _tmp15_;
			const gchar* _tmp16_;
			ProtonPlusUtilsMetadata* _tmp17_;
			JsonObject* _tmp18_;
			const gchar* _tmp19_;
			ProtonPlusUtilsMetadata* _tmp20_;
			JsonObject* _tmp21_;
			const gchar* _tmp22_;
			ProtonPlusUtilsMetadata* _tmp23_;
			JsonObject* _tmp24_;
			const gchar* _tmp25_;
			ProtonPlusUtilsMetadata* _tmp26_;
			JsonObject* _tmp27_;
			const gchar* _tmp28_;
			ProtonPlusUtilsMetadata* _tmp29_;
			JsonObject* _tmp30_;
			const gchar* _tmp31_;
			ProtonPlusUtilsMetadata* _tmp32_;
			JsonObject* _tmp33_;
			const gchar* _tmp34_;
			ProtonPlusUtilsMetadata* _tmp35_;
			JsonObject* _tmp36_;
			const gchar* _tmp37_;
			_tmp11_ = root_node;
			_tmp12_ = json_node_get_object (_tmp11_);
			_tmp13_ = _json_object_ref0 (_tmp12_);
			root_object = _tmp13_;
			_tmp14_ = metadata;
			_tmp15_ = root_object;
			_tmp16_ = json_object_get_string_member_with_default (_tmp15_, "runner_endpoint", "");
			proton_plus_utils_metadata_set_runner_endpoint (_tmp14_, _tmp16_);
			_tmp17_ = metadata;
			_tmp18_ = root_object;
			_tmp19_ = json_object_get_string_member_with_default (_tmp18_, "runner_title", "");
			proton_plus_utils_metadata_set_runner_title (_tmp17_, _tmp19_);
			_tmp20_ = metadata;
			_tmp21_ = root_object;
			_tmp22_ = json_object_get_string_member_with_default (_tmp21_, "tag", "");
			proton_plus_utils_metadata_set_tag (_tmp20_, _tmp22_);
			_tmp23_ = metadata;
			_tmp24_ = root_object;
			_tmp25_ = json_object_get_string_member_with_default (_tmp24_, "provider_id", "");
			proton_plus_utils_metadata_set_provider_id (_tmp23_, _tmp25_);
			_tmp26_ = metadata;
			_tmp27_ = root_object;
			_tmp28_ = json_object_get_string_member_with_default (_tmp27_, "tool_id", "");
			proton_plus_utils_metadata_set_tool_id (_tmp26_, _tmp28_);
			_tmp29_ = metadata;
			_tmp30_ = root_object;
			_tmp31_ = json_object_get_string_member_with_default (_tmp30_, "launcher_id", "");
			proton_plus_utils_metadata_set_launcher_id (_tmp29_, _tmp31_);
			_tmp32_ = metadata;
			_tmp33_ = root_object;
			_tmp34_ = json_object_get_string_member_with_default (_tmp33_, "variant_id", "");
			proton_plus_utils_metadata_set_variant_id (_tmp32_, _tmp34_);
			_tmp35_ = metadata;
			_tmp36_ = root_object;
			_tmp37_ = json_object_get_string_member_with_default (_tmp36_, "release_id", "");
			proton_plus_utils_metadata_set_release_id (_tmp35_, _tmp37_);
			result = metadata;
			_json_object_unref0 (root_object);
			__vala_JsonNode_free0 (root_node);
			_g_free0 (metadata_path);
			return result;
		}
		__vala_JsonNode_free0 (root_node);
	}
	result = metadata;
	_g_free0 (metadata_path);
	return result;
}

gboolean
proton_plus_utils_metadata_save (ProtonPlusUtilsMetadata* self,
                                 const gchar* directory_path)
{
	JsonObject* root_object = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	const gchar* _tmp2_;
	JsonObject* _tmp3_;
	const gchar* _tmp4_;
	JsonObject* _tmp5_;
	const gchar* _tmp6_;
	JsonObject* _tmp7_;
	const gchar* _tmp8_;
	JsonObject* _tmp9_;
	const gchar* _tmp10_;
	JsonObject* _tmp11_;
	const gchar* _tmp12_;
	JsonObject* _tmp13_;
	const gchar* _tmp14_;
	JsonObject* _tmp15_;
	const gchar* _tmp16_;
	JsonNode* root_node = NULL;
	JsonNode* _tmp17_;
	JsonNode* _tmp18_;
	JsonObject* _tmp19_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp20_;
	JsonGenerator* _tmp21_;
	JsonNode* _tmp22_;
	gchar* metadata_path = NULL;
	gchar* _tmp23_;
	const gchar* _tmp24_;
	JsonGenerator* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gboolean _tmp28_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (directory_path != NULL, FALSE);
	_tmp0_ = json_object_new ();
	root_object = _tmp0_;
	_tmp1_ = root_object;
	_tmp2_ = self->priv->_runner_endpoint;
	json_object_set_string_member (_tmp1_, "runner_endpoint", _tmp2_);
	_tmp3_ = root_object;
	_tmp4_ = self->priv->_runner_title;
	json_object_set_string_member (_tmp3_, "runner_title", _tmp4_);
	_tmp5_ = root_object;
	_tmp6_ = self->priv->_tag;
	json_object_set_string_member (_tmp5_, "tag", _tmp6_);
	_tmp7_ = root_object;
	_tmp8_ = self->priv->_provider_id;
	json_object_set_string_member (_tmp7_, "provider_id", _tmp8_);
	_tmp9_ = root_object;
	_tmp10_ = self->priv->_tool_id;
	json_object_set_string_member (_tmp9_, "tool_id", _tmp10_);
	_tmp11_ = root_object;
	_tmp12_ = self->priv->_launcher_id;
	json_object_set_string_member (_tmp11_, "launcher_id", _tmp12_);
	_tmp13_ = root_object;
	_tmp14_ = self->priv->_variant_id;
	json_object_set_string_member (_tmp13_, "variant_id", _tmp14_);
	_tmp15_ = root_object;
	_tmp16_ = self->priv->_release_id;
	json_object_set_string_member (_tmp15_, "release_id", _tmp16_);
	_tmp17_ = json_node_new (JSON_NODE_OBJECT);
	root_node = _tmp17_;
	_tmp18_ = root_node;
	_tmp19_ = root_object;
	json_node_set_object (_tmp18_, _tmp19_);
	_tmp20_ = json_generator_new ();
	generator = _tmp20_;
	_tmp21_ = generator;
	_tmp22_ = root_node;
	json_generator_set_root (_tmp21_, _tmp22_);
	_tmp23_ = g_build_filename (directory_path, PROTON_PLUS_UTILS_METADATA_FILENAME, NULL);
	metadata_path = _tmp23_;
	_tmp24_ = metadata_path;
	_tmp25_ = generator;
	_tmp26_ = json_generator_to_data (_tmp25_, NULL);
	_tmp27_ = _tmp26_;
	_tmp28_ = !proton_plus_utils_filesystem_modify_file (_tmp24_, _tmp27_);
	_g_free0 (_tmp27_);
	if (_tmp28_) {
		result = FALSE;
		_g_free0 (metadata_path);
		_g_object_unref0 (generator);
		__vala_JsonNode_free0 (root_node);
		_json_object_unref0 (root_object);
		return result;
	}
	result = TRUE;
	_g_free0 (metadata_path);
	_g_object_unref0 (generator);
	__vala_JsonNode_free0 (root_node);
	_json_object_unref0 (root_object);
	return result;
}

ProtonPlusUtilsMetadata*
proton_plus_utils_metadata_construct (GType object_type)
{
	ProtonPlusUtilsMetadata * self = NULL;
	self = (ProtonPlusUtilsMetadata*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusUtilsMetadata*
proton_plus_utils_metadata_new (void)
{
	return proton_plus_utils_metadata_construct (PROTON_PLUS_UTILS_TYPE_METADATA);
}

const gchar*
proton_plus_utils_metadata_get_runner_endpoint (ProtonPlusUtilsMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_runner_endpoint;
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_metadata_set_runner_endpoint (ProtonPlusUtilsMetadata* self,
                                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_metadata_get_runner_endpoint (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_runner_endpoint);
		self->priv->_runner_endpoint = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_RUNNER_ENDPOINT_PROPERTY]);
	}
}

const gchar*
proton_plus_utils_metadata_get_runner_title (ProtonPlusUtilsMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_runner_title;
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_metadata_set_runner_title (ProtonPlusUtilsMetadata* self,
                                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_metadata_get_runner_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_runner_title);
		self->priv->_runner_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_RUNNER_TITLE_PROPERTY]);
	}
}

const gchar*
proton_plus_utils_metadata_get_tag (ProtonPlusUtilsMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tag;
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_metadata_set_tag (ProtonPlusUtilsMetadata* self,
                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_metadata_get_tag (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_tag);
		self->priv->_tag = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_TAG_PROPERTY]);
	}
}

const gchar*
proton_plus_utils_metadata_get_provider_id (ProtonPlusUtilsMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_provider_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_metadata_set_provider_id (ProtonPlusUtilsMetadata* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_metadata_get_provider_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_provider_id);
		self->priv->_provider_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_PROVIDER_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_utils_metadata_get_tool_id (ProtonPlusUtilsMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_tool_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_metadata_set_tool_id (ProtonPlusUtilsMetadata* self,
                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_metadata_get_tool_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_tool_id);
		self->priv->_tool_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_TOOL_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_utils_metadata_get_launcher_id (ProtonPlusUtilsMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_launcher_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_metadata_set_launcher_id (ProtonPlusUtilsMetadata* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_metadata_get_launcher_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_launcher_id);
		self->priv->_launcher_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_LAUNCHER_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_utils_metadata_get_variant_id (ProtonPlusUtilsMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_variant_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_metadata_set_variant_id (ProtonPlusUtilsMetadata* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_metadata_get_variant_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_variant_id);
		self->priv->_variant_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_VARIANT_ID_PROPERTY]);
	}
}

const gchar*
proton_plus_utils_metadata_get_release_id (ProtonPlusUtilsMetadata* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_release_id;
	result = _tmp0_;
	return result;
}

void
proton_plus_utils_metadata_set_release_id (ProtonPlusUtilsMetadata* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_utils_metadata_get_release_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_release_id);
		self->priv->_release_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_RELEASE_ID_PROPERTY]);
	}
}

static void
proton_plus_utils_metadata_class_init (ProtonPlusUtilsMetadataClass * klass,
                                       gpointer klass_data)
{
	proton_plus_utils_metadata_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusUtilsMetadata_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_utils_metadata_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_utils_metadata_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_utils_metadata_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_METADATA_RUNNER_ENDPOINT_PROPERTY, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_RUNNER_ENDPOINT_PROPERTY] = g_param_spec_string ("runner-endpoint", "runner-endpoint", "runner-endpoint", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_METADATA_RUNNER_TITLE_PROPERTY, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_RUNNER_TITLE_PROPERTY] = g_param_spec_string ("runner-title", "runner-title", "runner-title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_METADATA_TAG_PROPERTY, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_TAG_PROPERTY] = g_param_spec_string ("tag", "tag", "tag", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_METADATA_PROVIDER_ID_PROPERTY, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_PROVIDER_ID_PROPERTY] = g_param_spec_string ("provider-id", "provider-id", "provider-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_METADATA_TOOL_ID_PROPERTY, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_TOOL_ID_PROPERTY] = g_param_spec_string ("tool-id", "tool-id", "tool-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_METADATA_LAUNCHER_ID_PROPERTY, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_LAUNCHER_ID_PROPERTY] = g_param_spec_string ("launcher-id", "launcher-id", "launcher-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_METADATA_VARIANT_ID_PROPERTY, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_VARIANT_ID_PROPERTY] = g_param_spec_string ("variant-id", "variant-id", "variant-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_UTILS_METADATA_RELEASE_ID_PROPERTY, proton_plus_utils_metadata_properties[PROTON_PLUS_UTILS_METADATA_RELEASE_ID_PROPERTY] = g_param_spec_string ("release-id", "release-id", "release-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_utils_metadata_instance_init (ProtonPlusUtilsMetadata * self,
                                          gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	self->priv = proton_plus_utils_metadata_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_runner_endpoint = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_runner_title = _tmp1_;
	_tmp2_ = g_strdup ("");
	self->priv->_tag = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_provider_id = _tmp3_;
	_tmp4_ = g_strdup ("");
	self->priv->_tool_id = _tmp4_;
	_tmp5_ = g_strdup ("");
	self->priv->_launcher_id = _tmp5_;
	_tmp6_ = g_strdup ("");
	self->priv->_variant_id = _tmp6_;
	_tmp7_ = g_strdup ("");
	self->priv->_release_id = _tmp7_;
}

static void
proton_plus_utils_metadata_finalize (GObject * obj)
{
	ProtonPlusUtilsMetadata * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_UTILS_TYPE_METADATA, ProtonPlusUtilsMetadata);
	_g_free0 (self->priv->_runner_endpoint);
	_g_free0 (self->priv->_runner_title);
	_g_free0 (self->priv->_tag);
	_g_free0 (self->priv->_provider_id);
	_g_free0 (self->priv->_tool_id);
	_g_free0 (self->priv->_launcher_id);
	_g_free0 (self->priv->_variant_id);
	_g_free0 (self->priv->_release_id);
	G_OBJECT_CLASS (proton_plus_utils_metadata_parent_class)->finalize (obj);
}

static GType
proton_plus_utils_metadata_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusUtilsMetadataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_utils_metadata_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusUtilsMetadata), 0, (GInstanceInitFunc) proton_plus_utils_metadata_instance_init, NULL };
	GType proton_plus_utils_metadata_type_id;
	proton_plus_utils_metadata_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusUtilsMetadata", &g_define_type_info, 0);
	ProtonPlusUtilsMetadata_private_offset = g_type_add_instance_private (proton_plus_utils_metadata_type_id, sizeof (ProtonPlusUtilsMetadataPrivate));
	return proton_plus_utils_metadata_type_id;
}

GType
proton_plus_utils_metadata_get_type (void)
{
	static volatile gsize proton_plus_utils_metadata_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_utils_metadata_type_id__once)) {
		GType proton_plus_utils_metadata_type_id;
		proton_plus_utils_metadata_type_id = proton_plus_utils_metadata_get_type_once ();
		g_once_init_leave (&proton_plus_utils_metadata_type_id__once, proton_plus_utils_metadata_type_id);
	}
	return proton_plus_utils_metadata_type_id__once;
}

static void
_vala_proton_plus_utils_metadata_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	ProtonPlusUtilsMetadata * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_UTILS_TYPE_METADATA, ProtonPlusUtilsMetadata);
	switch (property_id) {
		case PROTON_PLUS_UTILS_METADATA_RUNNER_ENDPOINT_PROPERTY:
		g_value_set_string (value, proton_plus_utils_metadata_get_runner_endpoint (self));
		break;
		case PROTON_PLUS_UTILS_METADATA_RUNNER_TITLE_PROPERTY:
		g_value_set_string (value, proton_plus_utils_metadata_get_runner_title (self));
		break;
		case PROTON_PLUS_UTILS_METADATA_TAG_PROPERTY:
		g_value_set_string (value, proton_plus_utils_metadata_get_tag (self));
		break;
		case PROTON_PLUS_UTILS_METADATA_PROVIDER_ID_PROPERTY:
		g_value_set_string (value, proton_plus_utils_metadata_get_provider_id (self));
		break;
		case PROTON_PLUS_UTILS_METADATA_TOOL_ID_PROPERTY:
		g_value_set_string (value, proton_plus_utils_metadata_get_tool_id (self));
		break;
		case PROTON_PLUS_UTILS_METADATA_LAUNCHER_ID_PROPERTY:
		g_value_set_string (value, proton_plus_utils_metadata_get_launcher_id (self));
		break;
		case PROTON_PLUS_UTILS_METADATA_VARIANT_ID_PROPERTY:
		g_value_set_string (value, proton_plus_utils_metadata_get_variant_id (self));
		break;
		case PROTON_PLUS_UTILS_METADATA_RELEASE_ID_PROPERTY:
		g_value_set_string (value, proton_plus_utils_metadata_get_release_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_utils_metadata_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	ProtonPlusUtilsMetadata * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_UTILS_TYPE_METADATA, ProtonPlusUtilsMetadata);
	switch (property_id) {
		case PROTON_PLUS_UTILS_METADATA_RUNNER_ENDPOINT_PROPERTY:
		proton_plus_utils_metadata_set_runner_endpoint (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_UTILS_METADATA_RUNNER_TITLE_PROPERTY:
		proton_plus_utils_metadata_set_runner_title (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_UTILS_METADATA_TAG_PROPERTY:
		proton_plus_utils_metadata_set_tag (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_UTILS_METADATA_PROVIDER_ID_PROPERTY:
		proton_plus_utils_metadata_set_provider_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_UTILS_METADATA_TOOL_ID_PROPERTY:
		proton_plus_utils_metadata_set_tool_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_UTILS_METADATA_LAUNCHER_ID_PROPERTY:
		proton_plus_utils_metadata_set_launcher_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_UTILS_METADATA_VARIANT_ID_PROPERTY:
		proton_plus_utils_metadata_set_variant_id (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_UTILS_METADATA_RELEASE_ID_PROPERTY:
		proton_plus_utils_metadata_set_release_id (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

