/* outbox-email-identifier.c generated by valac 0.56.19, the Vala compiler
 * generated from outbox-email-identifier.vala, do not modify */

/*
 * Copyright 2016 Software Freedom Conservancy Inc.
 * Copyright 2018-2019 Michael Gratton <mike@vee.net>.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later). See the COPYING file in this distribution.
 */

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

#define GEARY_OUTBOX_EMAIL_IDENTIFIER_VARIANT_TYPE "(y(xx))"
#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

#define GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER (geary_outbox_email_identifier_get_type ())
#define GEARY_OUTBOX_EMAIL_IDENTIFIER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier))
#define GEARY_OUTBOX_EMAIL_IDENTIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifierClass))
#define GEARY_OUTBOX_IS_EMAIL_IDENTIFIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER))
#define GEARY_OUTBOX_IS_EMAIL_IDENTIFIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER))
#define GEARY_OUTBOX_EMAIL_IDENTIFIER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifierClass))

typedef struct _GearyOutboxEmailIdentifier GearyOutboxEmailIdentifier;
typedef struct _GearyOutboxEmailIdentifierClass GearyOutboxEmailIdentifierClass;
typedef struct _GearyOutboxEmailIdentifierPrivate GearyOutboxEmailIdentifierPrivate;
enum  {
	GEARY_OUTBOX_EMAIL_IDENTIFIER_0_PROPERTY,
	GEARY_OUTBOX_EMAIL_IDENTIFIER_MESSAGE_ID_PROPERTY,
	GEARY_OUTBOX_EMAIL_IDENTIFIER_ORDERING_PROPERTY,
	GEARY_OUTBOX_EMAIL_IDENTIFIER_NUM_PROPERTIES
};
static GParamSpec* geary_outbox_email_identifier_properties[GEARY_OUTBOX_EMAIL_IDENTIFIER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

struct _GearyOutboxEmailIdentifier {
	GearyEmailIdentifier parent_instance;
	GearyOutboxEmailIdentifierPrivate * priv;
};

struct _GearyOutboxEmailIdentifierClass {
	GearyEmailIdentifierClass parent_class;
};

struct _GearyOutboxEmailIdentifierPrivate {
	gint64 _message_id;
	gint64 _ordering;
};

static gint GearyOutboxEmailIdentifier_private_offset;
static gpointer geary_outbox_email_identifier_parent_class = NULL;

VALA_EXTERN GType geary_outbox_email_identifier_get_type (void) G_GNUC_CONST ;
VALA_EXTERN gint64 geary_outbox_email_identifier_get_message_id (GearyOutboxEmailIdentifier* self);
static void geary_outbox_email_identifier_set_message_id (GearyOutboxEmailIdentifier* self,
                                                   gint64 value);
VALA_EXTERN gint64 geary_outbox_email_identifier_get_ordering (GearyOutboxEmailIdentifier* self);
static void geary_outbox_email_identifier_set_ordering (GearyOutboxEmailIdentifier* self,
                                                 gint64 value);
VALA_EXTERN GearyOutboxEmailIdentifier* geary_outbox_email_identifier_new (gint64 message_id,
                                                               gint64 ordering);
VALA_EXTERN GearyOutboxEmailIdentifier* geary_outbox_email_identifier_construct (GType object_type,
                                                                     gint64 message_id,
                                                                     gint64 ordering);
VALA_EXTERN GearyOutboxEmailIdentifier* geary_outbox_email_identifier_new_from_variant (GVariant* serialised,
                                                                            GError** error);
VALA_EXTERN GearyOutboxEmailIdentifier* geary_outbox_email_identifier_construct_from_variant (GType object_type,
                                                                                  GVariant* serialised,
                                                                                  GError** error);
static guint geary_outbox_email_identifier_real_hash (GearyEmailIdentifier* base);
static gboolean geary_outbox_email_identifier_real_equal_to (GearyEmailIdentifier* base,
                                                      GearyEmailIdentifier* other);
static gchar* geary_outbox_email_identifier_real_to_string (GearyEmailIdentifier* base);
static gint geary_outbox_email_identifier_real_natural_sort_comparator (GearyEmailIdentifier* base,
                                                                 GearyEmailIdentifier* o);
static GVariant* geary_outbox_email_identifier_real_to_variant (GearyEmailIdentifier* base);
static void geary_outbox_email_identifier_finalize (GObject * obj);
static GType geary_outbox_email_identifier_get_type_once (void);
static void _vala_geary_outbox_email_identifier_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec);
static void _vala_geary_outbox_email_identifier_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
geary_outbox_email_identifier_get_instance_private (GearyOutboxEmailIdentifier* self)
{
	return G_STRUCT_MEMBER_P (self, GearyOutboxEmailIdentifier_private_offset);
}

gint64
geary_outbox_email_identifier_get_message_id (GearyOutboxEmailIdentifier* self)
{
	gint64 result;
	g_return_val_if_fail (GEARY_OUTBOX_IS_EMAIL_IDENTIFIER (self), -1LL);
	result = self->priv->_message_id;
	return result;
}

static void
geary_outbox_email_identifier_set_message_id (GearyOutboxEmailIdentifier* self,
                                              gint64 value)
{
	gint64 old_value;
	g_return_if_fail (GEARY_OUTBOX_IS_EMAIL_IDENTIFIER (self));
	old_value = geary_outbox_email_identifier_get_message_id (self);
	if (old_value != value) {
		self->priv->_message_id = value;
		g_object_notify_by_pspec ((GObject *) self, geary_outbox_email_identifier_properties[GEARY_OUTBOX_EMAIL_IDENTIFIER_MESSAGE_ID_PROPERTY]);
	}
}

gint64
geary_outbox_email_identifier_get_ordering (GearyOutboxEmailIdentifier* self)
{
	gint64 result;
	g_return_val_if_fail (GEARY_OUTBOX_IS_EMAIL_IDENTIFIER (self), -1LL);
	result = self->priv->_ordering;
	return result;
}

static void
geary_outbox_email_identifier_set_ordering (GearyOutboxEmailIdentifier* self,
                                            gint64 value)
{
	gint64 old_value;
	g_return_if_fail (GEARY_OUTBOX_IS_EMAIL_IDENTIFIER (self));
	old_value = geary_outbox_email_identifier_get_ordering (self);
	if (old_value != value) {
		self->priv->_ordering = value;
		g_object_notify_by_pspec ((GObject *) self, geary_outbox_email_identifier_properties[GEARY_OUTBOX_EMAIL_IDENTIFIER_ORDERING_PROPERTY]);
	}
}

GearyOutboxEmailIdentifier*
geary_outbox_email_identifier_construct (GType object_type,
                                         gint64 message_id,
                                         gint64 ordering)
{
	GearyOutboxEmailIdentifier * self = NULL;
	self = (GearyOutboxEmailIdentifier*) geary_email_identifier_construct (object_type);
	geary_outbox_email_identifier_set_message_id (self, message_id);
	geary_outbox_email_identifier_set_ordering (self, ordering);
	return self;
}

GearyOutboxEmailIdentifier*
geary_outbox_email_identifier_new (gint64 message_id,
                                   gint64 ordering)
{
	return geary_outbox_email_identifier_construct (GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, message_id, ordering);
}

GearyOutboxEmailIdentifier*
geary_outbox_email_identifier_construct_from_variant (GType object_type,
                                                      GVariant* serialised,
                                                      GError** error)
{
	GearyOutboxEmailIdentifier * self = NULL;
	const gchar* _tmp0_;
	GVariant* inner = NULL;
	GVariant* _tmp3_;
	GVariant* mid = NULL;
	GVariant* _tmp4_;
	GVariant* ord = NULL;
	GVariant* _tmp5_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (serialised != NULL, NULL);
	_tmp0_ = g_variant_get_type_string (serialised);
	if (g_strcmp0 (_tmp0_, GEARY_OUTBOX_EMAIL_IDENTIFIER_VARIANT_TYPE) != 0) {
		const gchar* _tmp1_;
		GError* _tmp2_;
		_tmp1_ = g_variant_get_type_string (serialised);
		_tmp2_ = g_error_new (GEARY_ENGINE_ERROR, GEARY_ENGINE_ERROR_BAD_PARAMETERS, "Invalid serialised id type: %s", _tmp1_);
		_inner_error0_ = _tmp2_;
		if (_inner_error0_->domain == GEARY_ENGINE_ERROR) {
			g_propagate_error (error, _inner_error0_);
			_g_object_unref0 (self);
			return NULL;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
	}
	_tmp3_ = g_variant_get_child_value (serialised, (gsize) 1);
	inner = _tmp3_;
	_tmp4_ = g_variant_get_child_value (inner, (gsize) 0);
	mid = _tmp4_;
	_tmp5_ = g_variant_get_child_value (inner, (gsize) 1);
	ord = _tmp5_;
	self = (GearyOutboxEmailIdentifier*) geary_outbox_email_identifier_construct (object_type, g_variant_get_int64 (mid), g_variant_get_int64 (ord));
	_g_variant_unref0 (ord);
	_g_variant_unref0 (mid);
	_g_variant_unref0 (inner);
	return self;
}

GearyOutboxEmailIdentifier*
geary_outbox_email_identifier_new_from_variant (GVariant* serialised,
                                                GError** error)
{
	return geary_outbox_email_identifier_construct_from_variant (GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, serialised, error);
}

/** {@inheritDoc} */
static guint
geary_outbox_email_identifier_real_hash (GearyEmailIdentifier* base)
{
	GearyOutboxEmailIdentifier * self;
	GHashFunc _tmp0_;
	gint64 _tmp1_;
	guint result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier);
	_tmp0_ = g_int64_hash;
	_tmp1_ = self->priv->_message_id;
	result = _tmp0_ (&_tmp1_);
	return result;
}

/** {@inheritDoc} */
static gboolean
geary_outbox_email_identifier_real_equal_to (GearyEmailIdentifier* base,
                                             GearyEmailIdentifier* other)
{
	GearyOutboxEmailIdentifier * self;
	gboolean _tmp0_ = FALSE;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier);
	g_return_val_if_fail (GEARY_IS_EMAIL_IDENTIFIER (other), FALSE);
	if (G_TYPE_FROM_INSTANCE (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject)) == G_TYPE_FROM_INSTANCE (G_TYPE_CHECK_INSTANCE_CAST (other, G_TYPE_OBJECT, GObject))) {
		gint64 _tmp1_;
		gint64 _tmp2_;
		_tmp1_ = self->priv->_message_id;
		_tmp2_ = G_TYPE_CHECK_INSTANCE_CAST (other, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier)->priv->_message_id;
		_tmp0_ = _tmp1_ == _tmp2_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

/** {@inheritDoc} */
static gchar*
geary_outbox_email_identifier_real_to_string (GearyEmailIdentifier* base)
{
	GearyOutboxEmailIdentifier * self;
	const gchar* _tmp0_;
	gint64 _tmp1_;
	gint64 _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier);
	_tmp0_ = g_type_name (G_TYPE_FROM_INSTANCE (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject)));
	_tmp1_ = self->priv->_message_id;
	_tmp2_ = self->priv->_ordering;
	_tmp3_ = g_strdup_printf ("%s(%lld,%lld)", _tmp0_, _tmp1_, _tmp2_);
	result = _tmp3_;
	return result;
}

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

static gint
geary_outbox_email_identifier_real_natural_sort_comparator (GearyEmailIdentifier* base,
                                                            GearyEmailIdentifier* o)
{
	GearyOutboxEmailIdentifier * self;
	GearyOutboxEmailIdentifier* other = NULL;
	GearyOutboxEmailIdentifier* _tmp0_;
	GearyOutboxEmailIdentifier* _tmp1_;
	gint64 _tmp2_;
	GearyOutboxEmailIdentifier* _tmp3_;
	gint64 _tmp4_;
	gint result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier);
	g_return_val_if_fail (GEARY_IS_EMAIL_IDENTIFIER (o), -1);
	_tmp0_ = _g_object_ref0 (GEARY_OUTBOX_IS_EMAIL_IDENTIFIER (o) ? ((GearyOutboxEmailIdentifier*) o) : NULL);
	other = _tmp0_;
	_tmp1_ = other;
	if (_tmp1_ == NULL) {
		result = 1;
		_g_object_unref0 (other);
		return result;
	}
	_tmp2_ = self->priv->_ordering;
	_tmp3_ = other;
	_tmp4_ = _tmp3_->priv->_ordering;
	result = (gint) CLAMP (_tmp2_ - _tmp4_, (gint64) -1, (gint64) 1);
	_g_object_unref0 (other);
	return result;
}

static GVariant*
geary_outbox_email_identifier_real_to_variant (GearyEmailIdentifier* base)
{
	GearyOutboxEmailIdentifier * self;
	GVariant* _tmp0_;
	gint64 _tmp1_;
	GVariant* _tmp2_;
	gint64 _tmp3_;
	GVariant* _tmp4_;
	GVariant** _tmp5_;
	GVariant** _tmp6_;
	gint _tmp6__length1;
	GVariant* _tmp7_;
	GVariant** _tmp8_;
	GVariant** _tmp9_;
	gint _tmp9__length1;
	GVariant* _tmp10_;
	GVariant* _tmp11_;
	GVariant* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier);
	_tmp0_ = g_variant_new_byte ((guint8) 'o');
	g_variant_ref_sink (_tmp0_);
	_tmp1_ = self->priv->_message_id;
	_tmp2_ = g_variant_new_int64 (_tmp1_);
	g_variant_ref_sink (_tmp2_);
	_tmp3_ = self->priv->_ordering;
	_tmp4_ = g_variant_new_int64 (_tmp3_);
	g_variant_ref_sink (_tmp4_);
	_tmp5_ = g_new0 (GVariant*, 2 + 1);
	_tmp5_[0] = _tmp2_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = _tmp5_;
	_tmp6__length1 = 2;
	_tmp7_ = g_variant_new_tuple (_tmp6_, 2);
	g_variant_ref_sink (_tmp7_);
	_tmp8_ = g_new0 (GVariant*, 2 + 1);
	_tmp8_[0] = _tmp0_;
	_tmp8_[1] = _tmp7_;
	_tmp9_ = _tmp8_;
	_tmp9__length1 = 2;
	_tmp10_ = g_variant_new_tuple (_tmp9_, 2);
	g_variant_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	_tmp9_ = (_vala_array_free (_tmp9_, _tmp9__length1, (GDestroyNotify) g_variant_unref), NULL);
	_tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_variant_unref), NULL);
	result = _tmp11_;
	return result;
}

static void
geary_outbox_email_identifier_class_init (GearyOutboxEmailIdentifierClass * klass,
                                          gpointer klass_data)
{
	geary_outbox_email_identifier_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GearyOutboxEmailIdentifier_private_offset);
	((GearyEmailIdentifierClass *) klass)->hash = (guint (*) (GearyEmailIdentifier*)) geary_outbox_email_identifier_real_hash;
	((GearyEmailIdentifierClass *) klass)->equal_to = (gboolean (*) (GearyEmailIdentifier*, GearyEmailIdentifier*)) geary_outbox_email_identifier_real_equal_to;
	((GearyEmailIdentifierClass *) klass)->to_string = (gchar* (*) (GearyEmailIdentifier*)) geary_outbox_email_identifier_real_to_string;
	((GearyEmailIdentifierClass *) klass)->natural_sort_comparator = (gint (*) (GearyEmailIdentifier*, GearyEmailIdentifier*)) geary_outbox_email_identifier_real_natural_sort_comparator;
	((GearyEmailIdentifierClass *) klass)->to_variant = (GVariant* (*) (GearyEmailIdentifier*)) geary_outbox_email_identifier_real_to_variant;
	G_OBJECT_CLASS (klass)->get_property = _vala_geary_outbox_email_identifier_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_geary_outbox_email_identifier_set_property;
	G_OBJECT_CLASS (klass)->finalize = geary_outbox_email_identifier_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_OUTBOX_EMAIL_IDENTIFIER_MESSAGE_ID_PROPERTY, geary_outbox_email_identifier_properties[GEARY_OUTBOX_EMAIL_IDENTIFIER_MESSAGE_ID_PROPERTY] = g_param_spec_int64 ("message-id", "message-id", "message-id", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_OUTBOX_EMAIL_IDENTIFIER_ORDERING_PROPERTY, geary_outbox_email_identifier_properties[GEARY_OUTBOX_EMAIL_IDENTIFIER_ORDERING_PROPERTY] = g_param_spec_int64 ("ordering", "ordering", "ordering", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
geary_outbox_email_identifier_instance_init (GearyOutboxEmailIdentifier * self,
                                             gpointer klass)
{
	self->priv = geary_outbox_email_identifier_get_instance_private (self);
}

static void
geary_outbox_email_identifier_finalize (GObject * obj)
{
	GearyOutboxEmailIdentifier * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier);
	G_OBJECT_CLASS (geary_outbox_email_identifier_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
geary_outbox_email_identifier_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyOutboxEmailIdentifierClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_outbox_email_identifier_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyOutboxEmailIdentifier), 0, (GInstanceInitFunc) geary_outbox_email_identifier_instance_init, NULL };
	GType geary_outbox_email_identifier_type_id;
	geary_outbox_email_identifier_type_id = g_type_register_static (GEARY_TYPE_EMAIL_IDENTIFIER, "GearyOutboxEmailIdentifier", &g_define_type_info, 0);
	GearyOutboxEmailIdentifier_private_offset = g_type_add_instance_private (geary_outbox_email_identifier_type_id, sizeof (GearyOutboxEmailIdentifierPrivate));
	return geary_outbox_email_identifier_type_id;
}

GType
geary_outbox_email_identifier_get_type (void)
{
	static gsize geary_outbox_email_identifier_type_id__once = 0;
	if (g_once_init_enter (&geary_outbox_email_identifier_type_id__once)) {
		GType geary_outbox_email_identifier_type_id;
		geary_outbox_email_identifier_type_id = geary_outbox_email_identifier_get_type_once ();
		g_once_init_leave (&geary_outbox_email_identifier_type_id__once, geary_outbox_email_identifier_type_id);
	}
	return geary_outbox_email_identifier_type_id__once;
}

static void
_vala_geary_outbox_email_identifier_get_property (GObject * object,
                                                  guint property_id,
                                                  GValue * value,
                                                  GParamSpec * pspec)
{
	GearyOutboxEmailIdentifier * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier);
	switch (property_id) {
		case GEARY_OUTBOX_EMAIL_IDENTIFIER_MESSAGE_ID_PROPERTY:
		g_value_set_int64 (value, geary_outbox_email_identifier_get_message_id (self));
		break;
		case GEARY_OUTBOX_EMAIL_IDENTIFIER_ORDERING_PROPERTY:
		g_value_set_int64 (value, geary_outbox_email_identifier_get_ordering (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_geary_outbox_email_identifier_set_property (GObject * object,
                                                  guint property_id,
                                                  const GValue * value,
                                                  GParamSpec * pspec)
{
	GearyOutboxEmailIdentifier * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEARY_OUTBOX_TYPE_EMAIL_IDENTIFIER, GearyOutboxEmailIdentifier);
	switch (property_id) {
		case GEARY_OUTBOX_EMAIL_IDENTIFIER_MESSAGE_ID_PROPERTY:
		geary_outbox_email_identifier_set_message_id (self, g_value_get_int64 (value));
		break;
		case GEARY_OUTBOX_EMAIL_IDENTIFIER_ORDERING_PROPERTY:
		geary_outbox_email_identifier_set_ordering (self, g_value_get_int64 (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);
}

