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

/* compile this file with `valac --pkg posix repo.vala -C -H repo.h`*/

#include "seafile-object.h"
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>

#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  {
	SEAFILE_BRANCH_0_PROPERTY,
	SEAFILE_BRANCH_NAME_PROPERTY,
	SEAFILE_BRANCH_COMMIT_ID_PROPERTY,
	SEAFILE_BRANCH_REPO_ID_PROPERTY,
	SEAFILE_BRANCH_NUM_PROPERTIES
};
static GParamSpec* seafile_branch_properties[SEAFILE_BRANCH_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))

static gpointer seafile_branch_parent_class = NULL;

static void seafile_branch_finalize (GObject * obj);
static GType seafile_branch_get_type_once (void);
static void _vala_seafile_branch_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_seafile_branch_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);

SeafileBranch*
seafile_branch_construct (GType object_type)
{
	SeafileBranch * self = NULL;
	self = (SeafileBranch*) g_object_new (object_type, NULL);
	return self;
}

SeafileBranch*
seafile_branch_new (void)
{
	return seafile_branch_construct (SEAFILE_TYPE_BRANCH);
}

const gchar*
seafile_branch_get_name (SeafileBranch* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_name;
	result = _tmp0_;
	return result;
}

void
seafile_branch_set_name (SeafileBranch* self,
                         const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_name);
	self->_name = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, seafile_branch_properties[SEAFILE_BRANCH_NAME_PROPERTY]);
}

const gchar*
seafile_branch_get_commit_id (SeafileBranch* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_commit_id;
	result = _tmp0_;
	return result;
}

void
seafile_branch_set_commit_id (SeafileBranch* self,
                              const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_commit_id);
	self->_commit_id = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, seafile_branch_properties[SEAFILE_BRANCH_COMMIT_ID_PROPERTY]);
}

const gchar*
seafile_branch_get_repo_id (SeafileBranch* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->_repo_id;
	result = _tmp0_;
	return result;
}

void
seafile_branch_set_repo_id (SeafileBranch* self,
                            const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_repo_id);
	self->_repo_id = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, seafile_branch_properties[SEAFILE_BRANCH_REPO_ID_PROPERTY]);
}

static void
seafile_branch_class_init (SeafileBranchClass * klass,
                           gpointer klass_data)
{
	seafile_branch_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_seafile_branch_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_seafile_branch_set_property;
	G_OBJECT_CLASS (klass)->finalize = seafile_branch_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_BRANCH_NAME_PROPERTY, seafile_branch_properties[SEAFILE_BRANCH_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_BRANCH_COMMIT_ID_PROPERTY, seafile_branch_properties[SEAFILE_BRANCH_COMMIT_ID_PROPERTY] = g_param_spec_string ("commit-id", "commit-id", "commit-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), SEAFILE_BRANCH_REPO_ID_PROPERTY, seafile_branch_properties[SEAFILE_BRANCH_REPO_ID_PROPERTY] = g_param_spec_string ("repo-id", "repo-id", "repo-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
seafile_branch_instance_init (SeafileBranch * self,
                              gpointer klass)
{
}

static void
seafile_branch_finalize (GObject * obj)
{
	SeafileBranch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SEAFILE_TYPE_BRANCH, SeafileBranch);
	_g_free0 (self->_name);
	_g_free0 (self->_commit_id);
	_g_free0 (self->_repo_id);
	G_OBJECT_CLASS (seafile_branch_parent_class)->finalize (obj);
}

static GType
seafile_branch_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SeafileBranchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) seafile_branch_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SeafileBranch), 0, (GInstanceInitFunc) seafile_branch_instance_init, NULL };
	GType seafile_branch_type_id;
	seafile_branch_type_id = g_type_register_static (G_TYPE_OBJECT, "SeafileBranch", &g_define_type_info, 0);
	return seafile_branch_type_id;
}

GType
seafile_branch_get_type (void)
{
	static volatile gsize seafile_branch_type_id__once = 0;
	if (g_once_init_enter (&seafile_branch_type_id__once)) {
		GType seafile_branch_type_id;
		seafile_branch_type_id = seafile_branch_get_type_once ();
		g_once_init_leave (&seafile_branch_type_id__once, seafile_branch_type_id);
	}
	return seafile_branch_type_id__once;
}

static void
_vala_seafile_branch_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	SeafileBranch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAFILE_TYPE_BRANCH, SeafileBranch);
	switch (property_id) {
		case SEAFILE_BRANCH_NAME_PROPERTY:
		g_value_set_string (value, seafile_branch_get_name (self));
		break;
		case SEAFILE_BRANCH_COMMIT_ID_PROPERTY:
		g_value_set_string (value, seafile_branch_get_commit_id (self));
		break;
		case SEAFILE_BRANCH_REPO_ID_PROPERTY:
		g_value_set_string (value, seafile_branch_get_repo_id (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_seafile_branch_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	SeafileBranch * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SEAFILE_TYPE_BRANCH, SeafileBranch);
	switch (property_id) {
		case SEAFILE_BRANCH_NAME_PROPERTY:
		seafile_branch_set_name (self, g_value_get_string (value));
		break;
		case SEAFILE_BRANCH_COMMIT_ID_PROPERTY:
		seafile_branch_set_commit_id (self, g_value_get_string (value));
		break;
		case SEAFILE_BRANCH_REPO_ID_PROPERTY:
		seafile_branch_set_repo_id (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

