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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <json-glib/json-glib.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;
typedef struct _TubaEntityPrivate TubaEntityPrivate;

#define TUBA_API_PLEROMA_TYPE_INSTANCE (tuba_api_pleroma_instance_get_type ())
#define TUBA_API_PLEROMA_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstance))
#define TUBA_API_PLEROMA_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstanceClass))
#define TUBA_API_PLEROMA_IS_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE))
#define TUBA_API_PLEROMA_IS_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_PLEROMA_TYPE_INSTANCE))
#define TUBA_API_PLEROMA_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstanceClass))

typedef struct _TubaAPIPleromaInstance TubaAPIPleromaInstance;
typedef struct _TubaAPIPleromaInstanceClass TubaAPIPleromaInstanceClass;
typedef struct _TubaAPIPleromaInstancePrivate TubaAPIPleromaInstancePrivate;

#define TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA (tuba_api_pleroma_instance_metadata_get_type ())
#define TUBA_API_PLEROMA_INSTANCE_METADATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA, TubaAPIPleromaInstanceMetadata))
#define TUBA_API_PLEROMA_INSTANCE_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA, TubaAPIPleromaInstanceMetadataClass))
#define TUBA_API_PLEROMA_INSTANCE_IS_METADATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA))
#define TUBA_API_PLEROMA_INSTANCE_IS_METADATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA))
#define TUBA_API_PLEROMA_INSTANCE_METADATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA, TubaAPIPleromaInstanceMetadataClass))

typedef struct _TubaAPIPleromaInstanceMetadata TubaAPIPleromaInstanceMetadata;
typedef struct _TubaAPIPleromaInstanceMetadataClass TubaAPIPleromaInstanceMetadataClass;
enum  {
	TUBA_API_PLEROMA_INSTANCE_0_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_NUM_PROPERTIES
};
static GParamSpec* tuba_api_pleroma_instance_properties[TUBA_API_PLEROMA_INSTANCE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _TubaAPIPleromaInstanceMetadataPrivate TubaAPIPleromaInstanceMetadataPrivate;

#define TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS (tuba_api_pleroma_instance_metadata_field_limits_get_type ())
#define TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS, TubaAPIPleromaInstanceMetadataFieldLimits))
#define TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS, TubaAPIPleromaInstanceMetadataFieldLimitsClass))
#define TUBA_API_PLEROMA_INSTANCE_METADATA_IS_FIELD_LIMITS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS))
#define TUBA_API_PLEROMA_INSTANCE_METADATA_IS_FIELD_LIMITS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS))
#define TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS, TubaAPIPleromaInstanceMetadataFieldLimitsClass))

typedef struct _TubaAPIPleromaInstanceMetadataFieldLimits TubaAPIPleromaInstanceMetadataFieldLimits;
typedef struct _TubaAPIPleromaInstanceMetadataFieldLimitsClass TubaAPIPleromaInstanceMetadataFieldLimitsClass;
enum  {
	TUBA_API_PLEROMA_INSTANCE_METADATA_0_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_FIELDS_LIMITS_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_POST_FORMATS_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_FEATURES_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_NUM_PROPERTIES
};
static GParamSpec* tuba_api_pleroma_instance_metadata_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_NUM_PROPERTIES];
typedef struct _TubaAPIPleromaInstanceMetadataFieldLimitsPrivate TubaAPIPleromaInstanceMetadataFieldLimitsPrivate;
enum  {
	TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_0_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_MAX_FIELDS_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_NAME_LENGTH_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_VALUE_LENGTH_PROPERTY,
	TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_NUM_PROPERTIES
};
static GParamSpec* tuba_api_pleroma_instance_metadata_field_limits_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_NUM_PROPERTIES];

struct _TubaWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TubaWidgetizable* self);
	void (*open) (TubaWidgetizable* self);
	void (*resolve_open) (TubaWidgetizable* self, TubaInstanceAccount* account);
};

struct _TubaEntity {
	GObject parent_instance;
	TubaEntityPrivate * priv;
};

struct _TubaEntityClass {
	GObjectClass parent_class;
	gboolean (*is_local) (TubaEntity* self, TubaInstanceAccount* account);
	GType (*deserialize_array_type) (TubaEntity* self, const gchar* prop);
};

struct _TubaAPIPleromaInstance {
	TubaEntity parent_instance;
	TubaAPIPleromaInstancePrivate * priv;
};

struct _TubaAPIPleromaInstanceClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIPleromaInstancePrivate {
	TubaAPIPleromaInstanceMetadata* _metadata;
};

struct _TubaAPIPleromaInstanceMetadata {
	TubaEntity parent_instance;
	TubaAPIPleromaInstanceMetadataPrivate * priv;
};

struct _TubaAPIPleromaInstanceMetadataClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIPleromaInstanceMetadataPrivate {
	TubaAPIPleromaInstanceMetadataFieldLimits* _fields_limits;
	gchar** _post_formats;
	gint _post_formats_length1;
	gint __post_formats_size_;
	gchar** _features;
	gint _features_length1;
	gint __features_size_;
};

struct _TubaAPIPleromaInstanceMetadataFieldLimits {
	TubaEntity parent_instance;
	TubaAPIPleromaInstanceMetadataFieldLimitsPrivate * priv;
};

struct _TubaAPIPleromaInstanceMetadataFieldLimitsClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIPleromaInstanceMetadataFieldLimitsPrivate {
	gint64 _max_fields;
	gint64 _name_length;
	gint64 _value_length;
};

static gint TubaAPIPleromaInstance_private_offset;
static gpointer tuba_api_pleroma_instance_parent_class = NULL;
static gint TubaAPIPleromaInstanceMetadata_private_offset;
static gpointer tuba_api_pleroma_instance_metadata_parent_class = NULL;
static gint TubaAPIPleromaInstanceMetadataFieldLimits_private_offset;
static gpointer tuba_api_pleroma_instance_metadata_field_limits_parent_class = NULL;

VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GType tuba_api_pleroma_instance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPleromaInstance, g_object_unref)
VALA_EXTERN GType tuba_api_pleroma_instance_metadata_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPleromaInstanceMetadata, g_object_unref)
VALA_EXTERN TubaAPIPleromaInstance* tuba_api_pleroma_instance_new (void);
VALA_EXTERN TubaAPIPleromaInstance* tuba_api_pleroma_instance_construct (GType object_type);
VALA_EXTERN TubaEntity* tuba_entity_new (void);
VALA_EXTERN TubaEntity* tuba_entity_construct (GType object_type);
VALA_EXTERN TubaAPIPleromaInstanceMetadata* tuba_api_pleroma_instance_get_metadata (TubaAPIPleromaInstance* self);
VALA_EXTERN void tuba_api_pleroma_instance_set_metadata (TubaAPIPleromaInstance* self,
                                             TubaAPIPleromaInstanceMetadata* value);
VALA_EXTERN GType tuba_api_pleroma_instance_metadata_field_limits_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPleromaInstanceMetadataFieldLimits, g_object_unref)
VALA_EXTERN TubaAPIPleromaInstanceMetadata* tuba_api_pleroma_instance_metadata_new (void);
VALA_EXTERN TubaAPIPleromaInstanceMetadata* tuba_api_pleroma_instance_metadata_construct (GType object_type);
VALA_EXTERN TubaAPIPleromaInstanceMetadataFieldLimits* tuba_api_pleroma_instance_metadata_get_fields_limits (TubaAPIPleromaInstanceMetadata* self);
VALA_EXTERN void tuba_api_pleroma_instance_metadata_set_fields_limits (TubaAPIPleromaInstanceMetadata* self,
                                                           TubaAPIPleromaInstanceMetadataFieldLimits* value);
VALA_EXTERN gchar** tuba_api_pleroma_instance_metadata_get_post_formats (TubaAPIPleromaInstanceMetadata* self,
                                                             gint* result_length1);
VALA_EXTERN void tuba_api_pleroma_instance_metadata_set_post_formats (TubaAPIPleromaInstanceMetadata* self,
                                                          gchar** value,
                                                          gint value_length1);
static gchar** _vala_array_dup8 (gchar** self,
                          gssize length);
VALA_EXTERN gchar** tuba_api_pleroma_instance_metadata_get_features (TubaAPIPleromaInstanceMetadata* self,
                                                         gint* result_length1);
VALA_EXTERN void tuba_api_pleroma_instance_metadata_set_features (TubaAPIPleromaInstanceMetadata* self,
                                                      gchar** value,
                                                      gint value_length1);
static gchar** _vala_array_dup9 (gchar** self,
                          gssize length);
VALA_EXTERN TubaAPIPleromaInstanceMetadataFieldLimits* tuba_api_pleroma_instance_metadata_field_limits_new (void);
VALA_EXTERN TubaAPIPleromaInstanceMetadataFieldLimits* tuba_api_pleroma_instance_metadata_field_limits_construct (GType object_type);
VALA_EXTERN gint64 tuba_api_pleroma_instance_metadata_field_limits_get_max_fields (TubaAPIPleromaInstanceMetadataFieldLimits* self);
VALA_EXTERN void tuba_api_pleroma_instance_metadata_field_limits_set_max_fields (TubaAPIPleromaInstanceMetadataFieldLimits* self,
                                                                     gint64 value);
VALA_EXTERN gint64 tuba_api_pleroma_instance_metadata_field_limits_get_name_length (TubaAPIPleromaInstanceMetadataFieldLimits* self);
VALA_EXTERN void tuba_api_pleroma_instance_metadata_field_limits_set_name_length (TubaAPIPleromaInstanceMetadataFieldLimits* self,
                                                                      gint64 value);
VALA_EXTERN gint64 tuba_api_pleroma_instance_metadata_field_limits_get_value_length (TubaAPIPleromaInstanceMetadataFieldLimits* self);
VALA_EXTERN void tuba_api_pleroma_instance_metadata_field_limits_set_value_length (TubaAPIPleromaInstanceMetadataFieldLimits* self,
                                                                       gint64 value);
static void tuba_api_pleroma_instance_metadata_field_limits_finalize (GObject * obj);
static GType tuba_api_pleroma_instance_metadata_field_limits_get_type_once (void);
static void _vala_tuba_api_pleroma_instance_metadata_field_limits_get_property (GObject * object,
                                                                         guint property_id,
                                                                         GValue * value,
                                                                         GParamSpec * pspec);
static void _vala_tuba_api_pleroma_instance_metadata_field_limits_set_property (GObject * object,
                                                                         guint property_id,
                                                                         const GValue * value,
                                                                         GParamSpec * pspec);
static void tuba_api_pleroma_instance_metadata_finalize (GObject * obj);
static GType tuba_api_pleroma_instance_metadata_get_type_once (void);
static void _vala_tuba_api_pleroma_instance_metadata_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_tuba_api_pleroma_instance_metadata_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);
static void tuba_api_pleroma_instance_finalize (GObject * obj);
static GType tuba_api_pleroma_instance_get_type_once (void);
static void _vala_tuba_api_pleroma_instance_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_tuba_api_pleroma_instance_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_api_pleroma_instance_get_instance_private (TubaAPIPleromaInstance* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIPleromaInstance_private_offset);
}

TubaAPIPleromaInstance*
tuba_api_pleroma_instance_construct (GType object_type)
{
	TubaAPIPleromaInstance * self = NULL;
	self = (TubaAPIPleromaInstance*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIPleromaInstance*
tuba_api_pleroma_instance_new (void)
{
	return tuba_api_pleroma_instance_construct (TUBA_API_PLEROMA_TYPE_INSTANCE);
}

TubaAPIPleromaInstanceMetadata*
tuba_api_pleroma_instance_get_metadata (TubaAPIPleromaInstance* self)
{
	TubaAPIPleromaInstanceMetadata* result;
	TubaAPIPleromaInstanceMetadata* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_metadata;
	result = _tmp0_;
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
tuba_api_pleroma_instance_set_metadata (TubaAPIPleromaInstance* self,
                                        TubaAPIPleromaInstanceMetadata* value)
{
	TubaAPIPleromaInstanceMetadata* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_pleroma_instance_get_metadata (self);
	if (old_value != value) {
		TubaAPIPleromaInstanceMetadata* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_metadata);
		self->priv->_metadata = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_pleroma_instance_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_PROPERTY]);
	}
}

static inline gpointer
tuba_api_pleroma_instance_metadata_get_instance_private (TubaAPIPleromaInstanceMetadata* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIPleromaInstanceMetadata_private_offset);
}

TubaAPIPleromaInstanceMetadata*
tuba_api_pleroma_instance_metadata_construct (GType object_type)
{
	TubaAPIPleromaInstanceMetadata * self = NULL;
	self = (TubaAPIPleromaInstanceMetadata*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIPleromaInstanceMetadata*
tuba_api_pleroma_instance_metadata_new (void)
{
	return tuba_api_pleroma_instance_metadata_construct (TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA);
}

TubaAPIPleromaInstanceMetadataFieldLimits*
tuba_api_pleroma_instance_metadata_get_fields_limits (TubaAPIPleromaInstanceMetadata* self)
{
	TubaAPIPleromaInstanceMetadataFieldLimits* result;
	TubaAPIPleromaInstanceMetadataFieldLimits* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_fields_limits;
	result = _tmp0_;
	return result;
}

void
tuba_api_pleroma_instance_metadata_set_fields_limits (TubaAPIPleromaInstanceMetadata* self,
                                                      TubaAPIPleromaInstanceMetadataFieldLimits* value)
{
	TubaAPIPleromaInstanceMetadataFieldLimits* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_pleroma_instance_metadata_get_fields_limits (self);
	if (old_value != value) {
		TubaAPIPleromaInstanceMetadataFieldLimits* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_fields_limits);
		self->priv->_fields_limits = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_pleroma_instance_metadata_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELDS_LIMITS_PROPERTY]);
	}
}

gchar**
tuba_api_pleroma_instance_metadata_get_post_formats (TubaAPIPleromaInstanceMetadata* self,
                                                     gint* result_length1)
{
	gchar** result;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_post_formats;
	_tmp0__length1 = self->priv->_post_formats_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static gchar**
_vala_array_dup8 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

void
tuba_api_pleroma_instance_metadata_set_post_formats (TubaAPIPleromaInstanceMetadata* self,
                                                     gchar** value,
                                                     gint value_length1)
{
	gchar** old_value;
	gint old_value_length;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_pleroma_instance_metadata_get_post_formats (self, &old_value_length);
	if (old_value != value) {
		gchar** _tmp0_;
		gint _tmp0__length1;
		_tmp0_ = (value != NULL) ? _vala_array_dup8 (value, value_length1) : value;
		_tmp0__length1 = value_length1;
		self->priv->_post_formats = (_vala_array_free (self->priv->_post_formats, self->priv->_post_formats_length1, (GDestroyNotify) g_free), NULL);
		self->priv->_post_formats = _tmp0_;
		self->priv->_post_formats_length1 = _tmp0__length1;
		self->priv->__post_formats_size_ = self->priv->_post_formats_length1;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_pleroma_instance_metadata_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_POST_FORMATS_PROPERTY]);
	}
}

gchar**
tuba_api_pleroma_instance_metadata_get_features (TubaAPIPleromaInstanceMetadata* self,
                                                 gint* result_length1)
{
	gchar** result;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_features;
	_tmp0__length1 = self->priv->_features_length1;
	_tmp1_ = _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	if (result_length1) {
		*result_length1 = _tmp1__length1;
	}
	result = _tmp1_;
	return result;
}

static gchar**
_vala_array_dup9 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

void
tuba_api_pleroma_instance_metadata_set_features (TubaAPIPleromaInstanceMetadata* self,
                                                 gchar** value,
                                                 gint value_length1)
{
	gchar** old_value;
	gint old_value_length;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_pleroma_instance_metadata_get_features (self, &old_value_length);
	if (old_value != value) {
		gchar** _tmp0_;
		gint _tmp0__length1;
		_tmp0_ = (value != NULL) ? _vala_array_dup9 (value, value_length1) : value;
		_tmp0__length1 = value_length1;
		self->priv->_features = (_vala_array_free (self->priv->_features, self->priv->_features_length1, (GDestroyNotify) g_free), NULL);
		self->priv->_features = _tmp0_;
		self->priv->_features_length1 = _tmp0__length1;
		self->priv->__features_size_ = self->priv->_features_length1;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_pleroma_instance_metadata_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FEATURES_PROPERTY]);
	}
}

static inline gpointer
tuba_api_pleroma_instance_metadata_field_limits_get_instance_private (TubaAPIPleromaInstanceMetadataFieldLimits* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIPleromaInstanceMetadataFieldLimits_private_offset);
}

TubaAPIPleromaInstanceMetadataFieldLimits*
tuba_api_pleroma_instance_metadata_field_limits_construct (GType object_type)
{
	TubaAPIPleromaInstanceMetadataFieldLimits * self = NULL;
	self = (TubaAPIPleromaInstanceMetadataFieldLimits*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIPleromaInstanceMetadataFieldLimits*
tuba_api_pleroma_instance_metadata_field_limits_new (void)
{
	return tuba_api_pleroma_instance_metadata_field_limits_construct (TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS);
}

gint64
tuba_api_pleroma_instance_metadata_field_limits_get_max_fields (TubaAPIPleromaInstanceMetadataFieldLimits* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_max_fields;
	return result;
}

void
tuba_api_pleroma_instance_metadata_field_limits_set_max_fields (TubaAPIPleromaInstanceMetadataFieldLimits* self,
                                                                gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_pleroma_instance_metadata_field_limits_get_max_fields (self);
	if (old_value != value) {
		self->priv->_max_fields = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_pleroma_instance_metadata_field_limits_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_MAX_FIELDS_PROPERTY]);
	}
}

gint64
tuba_api_pleroma_instance_metadata_field_limits_get_name_length (TubaAPIPleromaInstanceMetadataFieldLimits* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_name_length;
	return result;
}

void
tuba_api_pleroma_instance_metadata_field_limits_set_name_length (TubaAPIPleromaInstanceMetadataFieldLimits* self,
                                                                 gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_pleroma_instance_metadata_field_limits_get_name_length (self);
	if (old_value != value) {
		self->priv->_name_length = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_pleroma_instance_metadata_field_limits_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_NAME_LENGTH_PROPERTY]);
	}
}

gint64
tuba_api_pleroma_instance_metadata_field_limits_get_value_length (TubaAPIPleromaInstanceMetadataFieldLimits* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_value_length;
	return result;
}

void
tuba_api_pleroma_instance_metadata_field_limits_set_value_length (TubaAPIPleromaInstanceMetadataFieldLimits* self,
                                                                  gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_pleroma_instance_metadata_field_limits_get_value_length (self);
	if (old_value != value) {
		self->priv->_value_length = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_pleroma_instance_metadata_field_limits_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_VALUE_LENGTH_PROPERTY]);
	}
}

static void
tuba_api_pleroma_instance_metadata_field_limits_class_init (TubaAPIPleromaInstanceMetadataFieldLimitsClass * klass,
                                                            gpointer klass_data)
{
	tuba_api_pleroma_instance_metadata_field_limits_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIPleromaInstanceMetadataFieldLimits_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_pleroma_instance_metadata_field_limits_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_pleroma_instance_metadata_field_limits_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_pleroma_instance_metadata_field_limits_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_MAX_FIELDS_PROPERTY, tuba_api_pleroma_instance_metadata_field_limits_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_MAX_FIELDS_PROPERTY] = g_param_spec_int64 ("max-fields", "max-fields", "max-fields", G_MININT64, G_MAXINT64, (gint64) 10, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_NAME_LENGTH_PROPERTY, tuba_api_pleroma_instance_metadata_field_limits_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_NAME_LENGTH_PROPERTY] = g_param_spec_int64 ("name-length", "name-length", "name-length", G_MININT64, G_MAXINT64, (gint64) 512, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_VALUE_LENGTH_PROPERTY, tuba_api_pleroma_instance_metadata_field_limits_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_VALUE_LENGTH_PROPERTY] = g_param_spec_int64 ("value-length", "value-length", "value-length", G_MININT64, G_MAXINT64, (gint64) 2048, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_api_pleroma_instance_metadata_field_limits_instance_init (TubaAPIPleromaInstanceMetadataFieldLimits * self,
                                                               gpointer klass)
{
	self->priv = tuba_api_pleroma_instance_metadata_field_limits_get_instance_private (self);
	self->priv->_max_fields = (gint64) 10;
	self->priv->_name_length = (gint64) 512;
	self->priv->_value_length = (gint64) 2048;
}

static void
tuba_api_pleroma_instance_metadata_field_limits_finalize (GObject * obj)
{
	TubaAPIPleromaInstanceMetadataFieldLimits * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS, TubaAPIPleromaInstanceMetadataFieldLimits);
	G_OBJECT_CLASS (tuba_api_pleroma_instance_metadata_field_limits_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_pleroma_instance_metadata_field_limits_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIPleromaInstanceMetadataFieldLimitsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_pleroma_instance_metadata_field_limits_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIPleromaInstanceMetadataFieldLimits), 0, (GInstanceInitFunc) tuba_api_pleroma_instance_metadata_field_limits_instance_init, NULL };
	GType tuba_api_pleroma_instance_metadata_field_limits_type_id;
	tuba_api_pleroma_instance_metadata_field_limits_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIPleromaInstanceMetadataFieldLimits", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaAPIPleromaInstanceMetadataFieldLimits_private_offset = g_type_add_instance_private (tuba_api_pleroma_instance_metadata_field_limits_type_id, sizeof (TubaAPIPleromaInstanceMetadataFieldLimitsPrivate));
	return tuba_api_pleroma_instance_metadata_field_limits_type_id;
}

GType
tuba_api_pleroma_instance_metadata_field_limits_get_type (void)
{
	static GType tuba_api_pleroma_instance_metadata_field_limits_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_pleroma_instance_metadata_field_limits_type_id__once)) {
		GType tuba_api_pleroma_instance_metadata_field_limits_type_id;
		tuba_api_pleroma_instance_metadata_field_limits_type_id = tuba_api_pleroma_instance_metadata_field_limits_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_pleroma_instance_metadata_field_limits_type_id__once, tuba_api_pleroma_instance_metadata_field_limits_type_id);
	}
	return tuba_api_pleroma_instance_metadata_field_limits_type_id__once;
}

static void
_vala_tuba_api_pleroma_instance_metadata_field_limits_get_property (GObject * object,
                                                                    guint property_id,
                                                                    GValue * value,
                                                                    GParamSpec * pspec)
{
	TubaAPIPleromaInstanceMetadataFieldLimits * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS, TubaAPIPleromaInstanceMetadataFieldLimits);
	switch (property_id) {
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_MAX_FIELDS_PROPERTY:
		g_value_set_int64 (value, tuba_api_pleroma_instance_metadata_field_limits_get_max_fields (self));
		break;
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_NAME_LENGTH_PROPERTY:
		g_value_set_int64 (value, tuba_api_pleroma_instance_metadata_field_limits_get_name_length (self));
		break;
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_VALUE_LENGTH_PROPERTY:
		g_value_set_int64 (value, tuba_api_pleroma_instance_metadata_field_limits_get_value_length (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_pleroma_instance_metadata_field_limits_set_property (GObject * object,
                                                                    guint property_id,
                                                                    const GValue * value,
                                                                    GParamSpec * pspec)
{
	TubaAPIPleromaInstanceMetadataFieldLimits * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS, TubaAPIPleromaInstanceMetadataFieldLimits);
	switch (property_id) {
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_MAX_FIELDS_PROPERTY:
		tuba_api_pleroma_instance_metadata_field_limits_set_max_fields (self, g_value_get_int64 (value));
		break;
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_NAME_LENGTH_PROPERTY:
		tuba_api_pleroma_instance_metadata_field_limits_set_name_length (self, g_value_get_int64 (value));
		break;
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FIELD_LIMITS_VALUE_LENGTH_PROPERTY:
		tuba_api_pleroma_instance_metadata_field_limits_set_value_length (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
tuba_api_pleroma_instance_metadata_class_init (TubaAPIPleromaInstanceMetadataClass * klass,
                                               gpointer klass_data)
{
	tuba_api_pleroma_instance_metadata_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIPleromaInstanceMetadata_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_pleroma_instance_metadata_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_pleroma_instance_metadata_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_pleroma_instance_metadata_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PLEROMA_INSTANCE_METADATA_FIELDS_LIMITS_PROPERTY, tuba_api_pleroma_instance_metadata_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FIELDS_LIMITS_PROPERTY] = g_param_spec_object ("fields-limits", "fields-limits", "fields-limits", TUBA_API_PLEROMA_INSTANCE_METADATA_TYPE_FIELD_LIMITS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PLEROMA_INSTANCE_METADATA_POST_FORMATS_PROPERTY, tuba_api_pleroma_instance_metadata_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_POST_FORMATS_PROPERTY] = g_param_spec_boxed ("post-formats", "post-formats", "post-formats", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PLEROMA_INSTANCE_METADATA_FEATURES_PROPERTY, tuba_api_pleroma_instance_metadata_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_FEATURES_PROPERTY] = g_param_spec_boxed ("features", "features", "features", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_api_pleroma_instance_metadata_instance_init (TubaAPIPleromaInstanceMetadata * self,
                                                  gpointer klass)
{
	self->priv = tuba_api_pleroma_instance_metadata_get_instance_private (self);
	self->priv->_fields_limits = NULL;
	self->priv->_post_formats = NULL;
	self->priv->_post_formats_length1 = 0;
	self->priv->__post_formats_size_ = self->priv->_post_formats_length1;
	self->priv->_features = NULL;
	self->priv->_features_length1 = 0;
	self->priv->__features_size_ = self->priv->_features_length1;
}

static void
tuba_api_pleroma_instance_metadata_finalize (GObject * obj)
{
	TubaAPIPleromaInstanceMetadata * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA, TubaAPIPleromaInstanceMetadata);
	_g_object_unref0 (self->priv->_fields_limits);
	self->priv->_post_formats = (_vala_array_free (self->priv->_post_formats, self->priv->_post_formats_length1, (GDestroyNotify) g_free), NULL);
	self->priv->_features = (_vala_array_free (self->priv->_features, self->priv->_features_length1, (GDestroyNotify) g_free), NULL);
	G_OBJECT_CLASS (tuba_api_pleroma_instance_metadata_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_pleroma_instance_metadata_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIPleromaInstanceMetadataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_pleroma_instance_metadata_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIPleromaInstanceMetadata), 0, (GInstanceInitFunc) tuba_api_pleroma_instance_metadata_instance_init, NULL };
	GType tuba_api_pleroma_instance_metadata_type_id;
	tuba_api_pleroma_instance_metadata_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIPleromaInstanceMetadata", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaAPIPleromaInstanceMetadata_private_offset = g_type_add_instance_private (tuba_api_pleroma_instance_metadata_type_id, sizeof (TubaAPIPleromaInstanceMetadataPrivate));
	return tuba_api_pleroma_instance_metadata_type_id;
}

GType
tuba_api_pleroma_instance_metadata_get_type (void)
{
	static GType tuba_api_pleroma_instance_metadata_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_pleroma_instance_metadata_type_id__once)) {
		GType tuba_api_pleroma_instance_metadata_type_id;
		tuba_api_pleroma_instance_metadata_type_id = tuba_api_pleroma_instance_metadata_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_pleroma_instance_metadata_type_id__once, tuba_api_pleroma_instance_metadata_type_id);
	}
	return tuba_api_pleroma_instance_metadata_type_id__once;
}

static void
_vala_tuba_api_pleroma_instance_metadata_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	TubaAPIPleromaInstanceMetadata * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA, TubaAPIPleromaInstanceMetadata);
	switch (property_id) {
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FIELDS_LIMITS_PROPERTY:
		g_value_set_object (value, tuba_api_pleroma_instance_metadata_get_fields_limits (self));
		break;
		case TUBA_API_PLEROMA_INSTANCE_METADATA_POST_FORMATS_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, tuba_api_pleroma_instance_metadata_get_post_formats (self, &length));
		}
		break;
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FEATURES_PROPERTY:
		{
			int length;
			g_value_set_boxed (value, tuba_api_pleroma_instance_metadata_get_features (self, &length));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_pleroma_instance_metadata_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	TubaAPIPleromaInstanceMetadata * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA, TubaAPIPleromaInstanceMetadata);
	switch (property_id) {
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FIELDS_LIMITS_PROPERTY:
		tuba_api_pleroma_instance_metadata_set_fields_limits (self, g_value_get_object (value));
		break;
		case TUBA_API_PLEROMA_INSTANCE_METADATA_POST_FORMATS_PROPERTY:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			tuba_api_pleroma_instance_metadata_set_post_formats (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		case TUBA_API_PLEROMA_INSTANCE_METADATA_FEATURES_PROPERTY:
		{
			gpointer boxed;
			boxed = g_value_get_boxed (value);
			tuba_api_pleroma_instance_metadata_set_features (self, boxed, (boxed == NULL) ? 0 : g_strv_length (boxed));
		}
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
tuba_api_pleroma_instance_class_init (TubaAPIPleromaInstanceClass * klass,
                                      gpointer klass_data)
{
	tuba_api_pleroma_instance_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIPleromaInstance_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_pleroma_instance_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_pleroma_instance_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_pleroma_instance_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_PLEROMA_INSTANCE_METADATA_PROPERTY, tuba_api_pleroma_instance_properties[TUBA_API_PLEROMA_INSTANCE_METADATA_PROPERTY] = g_param_spec_object ("metadata", "metadata", "metadata", TUBA_API_PLEROMA_INSTANCE_TYPE_METADATA, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_api_pleroma_instance_instance_init (TubaAPIPleromaInstance * self,
                                         gpointer klass)
{
	self->priv = tuba_api_pleroma_instance_get_instance_private (self);
	self->priv->_metadata = NULL;
}

static void
tuba_api_pleroma_instance_finalize (GObject * obj)
{
	TubaAPIPleromaInstance * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstance);
	_g_object_unref0 (self->priv->_metadata);
	G_OBJECT_CLASS (tuba_api_pleroma_instance_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_pleroma_instance_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIPleromaInstanceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_pleroma_instance_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIPleromaInstance), 0, (GInstanceInitFunc) tuba_api_pleroma_instance_instance_init, NULL };
	GType tuba_api_pleroma_instance_type_id;
	tuba_api_pleroma_instance_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIPleromaInstance", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaAPIPleromaInstance_private_offset = g_type_add_instance_private (tuba_api_pleroma_instance_type_id, sizeof (TubaAPIPleromaInstancePrivate));
	return tuba_api_pleroma_instance_type_id;
}

GType
tuba_api_pleroma_instance_get_type (void)
{
	static GType tuba_api_pleroma_instance_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_pleroma_instance_type_id__once)) {
		GType tuba_api_pleroma_instance_type_id;
		tuba_api_pleroma_instance_type_id = tuba_api_pleroma_instance_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_pleroma_instance_type_id__once, tuba_api_pleroma_instance_type_id);
	}
	return tuba_api_pleroma_instance_type_id__once;
}

static void
_vala_tuba_api_pleroma_instance_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	TubaAPIPleromaInstance * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstance);
	switch (property_id) {
		case TUBA_API_PLEROMA_INSTANCE_METADATA_PROPERTY:
		g_value_set_object (value, tuba_api_pleroma_instance_get_metadata (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_pleroma_instance_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	TubaAPIPleromaInstance * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstance);
	switch (property_id) {
		case TUBA_API_PLEROMA_INSTANCE_METADATA_PROPERTY:
		tuba_api_pleroma_instance_set_metadata (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

