/* imap-expunge-command.c generated by valac 0.56.3, the Vala compiler
 * generated from imap-expunge-command.vala, do not modify */

/*
 * Copyright 2016 Software Freedom Conservancy Inc.
 *
 * 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 <gio/gio.h>
#include <glib.h>

enum  {
	GEARY_IMAP_EXPUNGE_COMMAND_0_PROPERTY,
	GEARY_IMAP_EXPUNGE_COMMAND_NUM_PROPERTIES
};
static GParamSpec* geary_imap_expunge_command_properties[GEARY_IMAP_EXPUNGE_COMMAND_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

static gpointer geary_imap_expunge_command_parent_class = NULL;

static GType geary_imap_expunge_command_get_type_once (void);

GearyImapExpungeCommand*
geary_imap_expunge_command_construct (GType object_type,
                                      GCancellable* should_send)
{
	GearyImapExpungeCommand * self = NULL;
	g_return_val_if_fail ((should_send == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (should_send, g_cancellable_get_type ()), NULL);
	self = (GearyImapExpungeCommand*) geary_imap_command_construct (object_type, GEARY_IMAP_EXPUNGE_COMMAND_NAME, NULL, (gint) 0, should_send);
	return self;
}

GearyImapExpungeCommand*
geary_imap_expunge_command_new (GCancellable* should_send)
{
	return geary_imap_expunge_command_construct (GEARY_IMAP_TYPE_EXPUNGE_COMMAND, should_send);
}

GearyImapExpungeCommand*
geary_imap_expunge_command_construct_uid (GType object_type,
                                          GearyImapMessageSet* message_set,
                                          GCancellable* should_send)
{
	GearyImapExpungeCommand * self = NULL;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GearyImapListParameter* _tmp2_;
	GearyImapListParameter* _tmp3_;
	GearyImapParameter* _tmp4_;
	GearyImapParameter* _tmp5_;
	g_return_val_if_fail (GEARY_IMAP_IS_MESSAGE_SET (message_set), NULL);
	g_return_val_if_fail ((should_send == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (should_send, g_cancellable_get_type ()), NULL);
	self = (GearyImapExpungeCommand*) geary_imap_command_construct (object_type, GEARY_IMAP_EXPUNGE_COMMAND_UID_NAME, NULL, (gint) 0, should_send);
	_tmp0_ = geary_imap_message_set_get_is_uid (message_set);
	_tmp1_ = _tmp0_;
	_vala_assert (_tmp1_, "message_set.is_uid");
	_tmp2_ = geary_imap_command_get_args (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_IMAP_TYPE_COMMAND, GearyImapCommand));
	_tmp3_ = _tmp2_;
	_tmp4_ = geary_imap_message_set_to_parameter (message_set);
	_tmp5_ = _tmp4_;
	geary_imap_list_parameter_add (_tmp3_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	return self;
}

GearyImapExpungeCommand*
geary_imap_expunge_command_new_uid (GearyImapMessageSet* message_set,
                                    GCancellable* should_send)
{
	return geary_imap_expunge_command_construct_uid (GEARY_IMAP_TYPE_EXPUNGE_COMMAND, message_set, should_send);
}

static void
geary_imap_expunge_command_class_init (GearyImapExpungeCommandClass * klass,
                                       gpointer klass_data)
{
	geary_imap_expunge_command_parent_class = g_type_class_peek_parent (klass);
}

static void
geary_imap_expunge_command_instance_init (GearyImapExpungeCommand * self,
                                          gpointer klass)
{
}

/**
 * See [[http://tools.ietf.org/html/rfc3501#section-6.4.3]] and
 * [[http://tools.ietf.org/html/rfc4315#section-2.1]]
 */
 G_GNUC_NO_INLINE static GType
geary_imap_expunge_command_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyImapExpungeCommandClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_imap_expunge_command_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyImapExpungeCommand), 0, (GInstanceInitFunc) geary_imap_expunge_command_instance_init, NULL };
	GType geary_imap_expunge_command_type_id;
	geary_imap_expunge_command_type_id = g_type_register_static (GEARY_IMAP_TYPE_COMMAND, "GearyImapExpungeCommand", &g_define_type_info, 0);
	return geary_imap_expunge_command_type_id;
}

GType
geary_imap_expunge_command_get_type (void)
{
	static gsize geary_imap_expunge_command_type_id__once = 0;
	if (g_once_init_enter (&geary_imap_expunge_command_type_id__once)) {
		GType geary_imap_expunge_command_type_id;
		geary_imap_expunge_command_type_id = geary_imap_expunge_command_get_type_once ();
		g_once_init_leave (&geary_imap_expunge_command_type_id__once, geary_imap_expunge_command_type_id);
	}
	return geary_imap_expunge_command_type_id__once;
}

