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

#include "system.h"
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <packagekit-glib2/packagekit.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

#define _g_free0(var) (var = (g_free (var), NULL))
enum  {
	SYSTEM_UPDATE_STATE_CHANGED_SIGNAL,
	SYSTEM_UPDATE_NUM_SIGNALS
};
static guint system_update_signals[SYSTEM_UPDATE_NUM_SIGNALS] = {0};
typedef GDBusProxy SystemUpdateProxy;
typedef GDBusProxyClass SystemUpdateProxyClass;
typedef struct _SystemUpdateGetCurrentStateReadyData SystemUpdateGetCurrentStateReadyData;
typedef struct _SystemUpdateGetUpdateDetailsReadyData SystemUpdateGetUpdateDetailsReadyData;
typedef struct _SystemUpdateCancelReadyData SystemUpdateCancelReadyData;
typedef struct _SystemUpdateCheckForUpdatesReadyData SystemUpdateCheckForUpdatesReadyData;
typedef struct _SystemUpdateUpdateReadyData SystemUpdateUpdateReadyData;
typedef struct _SystemUpdateGetLastRefreshTimeReadyData SystemUpdateGetLastRefreshTimeReadyData;

struct _SystemUpdateGetCurrentStateReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _SystemUpdateGetUpdateDetailsReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _SystemUpdateCancelReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _SystemUpdateCheckForUpdatesReadyData {
	GDBusMethodInvocation* _invocation_;
	gboolean force;
	gboolean notify;
};

struct _SystemUpdateUpdateReadyData {
	GDBusMethodInvocation* _invocation_;
};

struct _SystemUpdateGetLastRefreshTimeReadyData {
	GDBusMethodInvocation* _invocation_;
};

static gchar** _vala_array_dup1 (gchar** self,
                          gssize length);
static PkInfoEnum* _vala_array_dup2 (PkInfoEnum* self,
                              gssize length);
static GType system_update_get_type_once (void);
static void system_update_proxy_g_signal (GDBusProxy* proxy,
                                   const gchar* sender_name,
                                   const gchar* signal_name,
                                   GVariant* parameters);
static void _dbus_handle_system_update_state_changed (SystemUpdate* self,
                                               GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void system_update_proxy_get_current_state_async (SystemUpdate* self,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static void system_update_proxy_get_current_state_finish (SystemUpdate* self,
                                                   GAsyncResult* _res_,
                                                   SystemUpdateCurrentState* result,
                                                   GError** error);
static void system_update_proxy_get_update_details_async (SystemUpdate* self,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void system_update_proxy_get_update_details_finish (SystemUpdate* self,
                                                    GAsyncResult* _res_,
                                                    SystemUpdateUpdateDetails* result,
                                                    GError** error);
static void system_update_proxy_cancel_async (SystemUpdate* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static void system_update_proxy_cancel_finish (SystemUpdate* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static void system_update_proxy_check_for_updates_async (SystemUpdate* self,
                                                  gboolean force,
                                                  gboolean notify,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
static void system_update_proxy_check_for_updates_finish (SystemUpdate* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static void system_update_proxy_update_async (SystemUpdate* self,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static void system_update_proxy_update_finish (SystemUpdate* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static void system_update_proxy_get_last_refresh_time_async (SystemUpdate* self,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static gint64 system_update_proxy_get_last_refresh_time_finish (SystemUpdate* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static void system_update_proxy_system_update_interface_init (SystemUpdateIface* iface);
static void _dbus_system_update_get_current_state (SystemUpdate* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void _dbus_system_update_get_current_state_ready (GObject * source_object,
                                                  GAsyncResult * _res_,
                                                  gpointer _user_data_);
static void _dbus_system_update_get_update_details (SystemUpdate* self,
                                             GVariant* _parameters_,
                                             GDBusMethodInvocation* invocation);
static void _dbus_system_update_get_update_details_ready (GObject * source_object,
                                                   GAsyncResult * _res_,
                                                   gpointer _user_data_);
static void _dbus_system_update_cancel (SystemUpdate* self,
                                 GVariant* _parameters_,
                                 GDBusMethodInvocation* invocation);
static void _dbus_system_update_cancel_ready (GObject * source_object,
                                       GAsyncResult * _res_,
                                       gpointer _user_data_);
static void _dbus_system_update_check_for_updates (SystemUpdate* self,
                                            GVariant* _parameters_,
                                            GDBusMethodInvocation* invocation);
static void _dbus_system_update_check_for_updates_ready (GObject * source_object,
                                                  GAsyncResult * _res_,
                                                  gpointer _user_data_);
static void _dbus_system_update_update (SystemUpdate* self,
                                 GVariant* _parameters_,
                                 GDBusMethodInvocation* invocation);
static void _dbus_system_update_update_ready (GObject * source_object,
                                       GAsyncResult * _res_,
                                       gpointer _user_data_);
static void _dbus_system_update_get_last_refresh_time (SystemUpdate* self,
                                                GVariant* _parameters_,
                                                GDBusMethodInvocation* invocation);
static void _dbus_system_update_get_last_refresh_time_ready (GObject * source_object,
                                                      GAsyncResult * _res_,
                                                      gpointer _user_data_);
static void system_update_dbus_interface_method_call (GDBusConnection* connection,
                                               const gchar* sender,
                                               const gchar* object_path,
                                               const gchar* interface_name,
                                               const gchar* method_name,
                                               GVariant* parameters,
                                               GDBusMethodInvocation* invocation,
                                               gpointer user_data);
static GVariant* system_update_dbus_interface_get_property (GDBusConnection* connection,
                                                     const gchar* sender,
                                                     const gchar* object_path,
                                                     const gchar* interface_name,
                                                     const gchar* property_name,
                                                     GError** error,
                                                     gpointer user_data);
static gboolean system_update_dbus_interface_set_property (GDBusConnection* connection,
                                                    const gchar* sender,
                                                    const gchar* object_path,
                                                    const gchar* interface_name,
                                                    const gchar* property_name,
                                                    GVariant* value,
                                                    GError** error,
                                                    gpointer user_data);
static void _dbus_system_update_state_changed (GObject* _sender,
                                        gpointer* _data);
static void _system_update_unregister_object (gpointer user_data);
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 _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static const GDBusArgInfo _system_update_dbus_arg_info_get_current_state_result = {-1, "result", "(isut)", NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_get_current_state_in[] = {NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_get_current_state_out[] = {&_system_update_dbus_arg_info_get_current_state_result, NULL};
static const GDBusMethodInfo _system_update_dbus_method_info_get_current_state = {-1, "GetCurrentState", (GDBusArgInfo **) (&_system_update_dbus_arg_info_get_current_state_in), (GDBusArgInfo **) (&_system_update_dbus_arg_info_get_current_state_out), NULL};
static const GDBusArgInfo _system_update_dbus_arg_info_get_update_details_result = {-1, "result", "(astai)", NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_get_update_details_in[] = {NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_get_update_details_out[] = {&_system_update_dbus_arg_info_get_update_details_result, NULL};
static const GDBusMethodInfo _system_update_dbus_method_info_get_update_details = {-1, "GetUpdateDetails", (GDBusArgInfo **) (&_system_update_dbus_arg_info_get_update_details_in), (GDBusArgInfo **) (&_system_update_dbus_arg_info_get_update_details_out), NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_cancel_in[] = {NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_cancel_out[] = {NULL};
static const GDBusMethodInfo _system_update_dbus_method_info_cancel = {-1, "Cancel", (GDBusArgInfo **) (&_system_update_dbus_arg_info_cancel_in), (GDBusArgInfo **) (&_system_update_dbus_arg_info_cancel_out), NULL};
static const GDBusArgInfo _system_update_dbus_arg_info_check_for_updates_force = {-1, "force", "b", NULL};
static const GDBusArgInfo _system_update_dbus_arg_info_check_for_updates_notify = {-1, "notify", "b", NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_check_for_updates_in[] = {&_system_update_dbus_arg_info_check_for_updates_force, &_system_update_dbus_arg_info_check_for_updates_notify, NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_check_for_updates_out[] = {NULL};
static const GDBusMethodInfo _system_update_dbus_method_info_check_for_updates = {-1, "CheckForUpdates", (GDBusArgInfo **) (&_system_update_dbus_arg_info_check_for_updates_in), (GDBusArgInfo **) (&_system_update_dbus_arg_info_check_for_updates_out), NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_update_in[] = {NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_update_out[] = {NULL};
static const GDBusMethodInfo _system_update_dbus_method_info_update = {-1, "Update", (GDBusArgInfo **) (&_system_update_dbus_arg_info_update_in), (GDBusArgInfo **) (&_system_update_dbus_arg_info_update_out), NULL};
static const GDBusArgInfo _system_update_dbus_arg_info_get_last_refresh_time_result = {-1, "result", "x", NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_get_last_refresh_time_in[] = {NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_get_last_refresh_time_out[] = {&_system_update_dbus_arg_info_get_last_refresh_time_result, NULL};
static const GDBusMethodInfo _system_update_dbus_method_info_get_last_refresh_time = {-1, "GetLastRefreshTime", (GDBusArgInfo **) (&_system_update_dbus_arg_info_get_last_refresh_time_in), (GDBusArgInfo **) (&_system_update_dbus_arg_info_get_last_refresh_time_out), NULL};
static const GDBusMethodInfo * const _system_update_dbus_method_info[] = {&_system_update_dbus_method_info_get_current_state, &_system_update_dbus_method_info_get_update_details, &_system_update_dbus_method_info_cancel, &_system_update_dbus_method_info_check_for_updates, &_system_update_dbus_method_info_update, &_system_update_dbus_method_info_get_last_refresh_time, NULL};
static const GDBusArgInfo * const _system_update_dbus_arg_info_state_changed[] = {NULL};
static const GDBusSignalInfo _system_update_dbus_signal_info_state_changed = {-1, "StateChanged", (GDBusArgInfo **) (&_system_update_dbus_arg_info_state_changed), NULL};
static const GDBusSignalInfo * const _system_update_dbus_signal_info[] = {&_system_update_dbus_signal_info_state_changed, NULL};
static const GDBusPropertyInfo * const _system_update_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _system_update_dbus_interface_info = {-1, "io.elementary.settings_daemon.SystemUpdate", (GDBusMethodInfo **) (&_system_update_dbus_method_info), (GDBusSignalInfo **) (&_system_update_dbus_signal_info), (GDBusPropertyInfo **) (&_system_update_dbus_property_info), NULL};
static const GDBusInterfaceVTable _system_update_dbus_interface_vtable = {system_update_dbus_interface_method_call, system_update_dbus_interface_get_property, system_update_dbus_interface_set_property};

 G_GNUC_NO_INLINE static GType
system_update_state_get_type_once (void)
{
	static const GEnumValue values[] = {{SYSTEM_UPDATE_STATE_UP_TO_DATE, "SYSTEM_UPDATE_STATE_UP_TO_DATE", "up-to-date"}, {SYSTEM_UPDATE_STATE_CHECKING, "SYSTEM_UPDATE_STATE_CHECKING", "checking"}, {SYSTEM_UPDATE_STATE_AVAILABLE, "SYSTEM_UPDATE_STATE_AVAILABLE", "available"}, {SYSTEM_UPDATE_STATE_DOWNLOADING, "SYSTEM_UPDATE_STATE_DOWNLOADING", "downloading"}, {SYSTEM_UPDATE_STATE_RESTART_REQUIRED, "SYSTEM_UPDATE_STATE_RESTART_REQUIRED", "restart-required"}, {SYSTEM_UPDATE_STATE_ERROR, "SYSTEM_UPDATE_STATE_ERROR", "error"}, {0, NULL, NULL}};
	GType system_update_state_type_id;
	system_update_state_type_id = g_enum_register_static ("SystemUpdateState", values);
	return system_update_state_type_id;
}

GType
system_update_state_get_type (void)
{
	static volatile gsize system_update_state_type_id__once = 0;
	if (g_once_init_enter (&system_update_state_type_id__once)) {
		GType system_update_state_type_id;
		system_update_state_type_id = system_update_state_get_type_once ();
		g_once_init_leave (&system_update_state_type_id__once, system_update_state_type_id);
	}
	return system_update_state_type_id__once;
}

void
system_update_get_current_state (SystemUpdate* self,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->get_current_state) {
		_iface_->get_current_state (self, _callback_, _user_data_);
	}
}

void
system_update_get_current_state_finish (SystemUpdate* self,
                                        GAsyncResult* _res_,
                                        SystemUpdateCurrentState* result,
                                        GError** error)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->get_current_state_finish) {
		_iface_->get_current_state_finish (self, _res_, result, error);
	}
	return;
}

void
system_update_get_update_details (SystemUpdate* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->get_update_details) {
		_iface_->get_update_details (self, _callback_, _user_data_);
	}
}

void
system_update_get_update_details_finish (SystemUpdate* self,
                                         GAsyncResult* _res_,
                                         SystemUpdateUpdateDetails* result,
                                         GError** error)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->get_update_details_finish) {
		_iface_->get_update_details_finish (self, _res_, result, error);
	}
	return;
}

void
system_update_cancel (SystemUpdate* self,
                      GAsyncReadyCallback _callback_,
                      gpointer _user_data_)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->cancel) {
		_iface_->cancel (self, _callback_, _user_data_);
	}
}

void
system_update_cancel_finish (SystemUpdate* self,
                             GAsyncResult* _res_,
                             GError** error)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->cancel_finish) {
		_iface_->cancel_finish (self, _res_, error);
	}
}

void
system_update_check_for_updates (SystemUpdate* self,
                                 gboolean force,
                                 gboolean notify,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->check_for_updates) {
		_iface_->check_for_updates (self, force, notify, _callback_, _user_data_);
	}
}

void
system_update_check_for_updates_finish (SystemUpdate* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->check_for_updates_finish) {
		_iface_->check_for_updates_finish (self, _res_, error);
	}
}

void
system_update_update (SystemUpdate* self,
                      GAsyncReadyCallback _callback_,
                      gpointer _user_data_)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->update) {
		_iface_->update (self, _callback_, _user_data_);
	}
}

void
system_update_update_finish (SystemUpdate* self,
                             GAsyncResult* _res_,
                             GError** error)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->update_finish) {
		_iface_->update_finish (self, _res_, error);
	}
}

void
system_update_get_last_refresh_time (SystemUpdate* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->get_last_refresh_time) {
		_iface_->get_last_refresh_time (self, _callback_, _user_data_);
	}
}

gint64
system_update_get_last_refresh_time_finish (SystemUpdate* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	SystemUpdateIface* _iface_;
	_iface_ = SYSTEM_UPDATE_GET_INTERFACE (self);
	if (_iface_->get_last_refresh_time_finish) {
		return _iface_->get_last_refresh_time_finish (self, _res_, error);
	}
	return -1LL;
}

void
system_update_current_state_copy (const SystemUpdateCurrentState* self,
                                  SystemUpdateCurrentState* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	(*dest).state = (*self).state;
	_tmp0_ = (*self).message;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).message);
	(*dest).message = _tmp1_;
	(*dest).percentage = (*self).percentage;
	(*dest).download_size_remaining = (*self).download_size_remaining;
}

void
system_update_current_state_destroy (SystemUpdateCurrentState* self)
{
	_g_free0 ((*self).message);
}

SystemUpdateCurrentState*
system_update_current_state_dup (const SystemUpdateCurrentState* self)
{
	SystemUpdateCurrentState* dup;
	dup = g_new0 (SystemUpdateCurrentState, 1);
	system_update_current_state_copy (self, dup);
	return dup;
}

void
system_update_current_state_free (SystemUpdateCurrentState* self)
{
	system_update_current_state_destroy (self);
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
system_update_current_state_get_type_once (void)
{
	GType system_update_current_state_type_id;
	system_update_current_state_type_id = g_boxed_type_register_static ("SystemUpdateCurrentState", (GBoxedCopyFunc) system_update_current_state_dup, (GBoxedFreeFunc) system_update_current_state_free);
	return system_update_current_state_type_id;
}

GType
system_update_current_state_get_type (void)
{
	static volatile gsize system_update_current_state_type_id__once = 0;
	if (g_once_init_enter (&system_update_current_state_type_id__once)) {
		GType system_update_current_state_type_id;
		system_update_current_state_type_id = system_update_current_state_get_type_once ();
		g_once_init_leave (&system_update_current_state_type_id__once, system_update_current_state_type_id);
	}
	return system_update_current_state_type_id__once;
}

static gchar**
_vala_array_dup1 (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;
}

static PkInfoEnum*
_vala_array_dup2 (PkInfoEnum* self,
                  gssize length)
{
	if (length > 0) {
		return _vala_memdup2 (self, length * sizeof (PkInfoEnum));
	}
	return NULL;
}

void
system_update_update_details_copy (const SystemUpdateUpdateDetails* self,
                                   SystemUpdateUpdateDetails* dest)
{
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar** _tmp1_;
	gint _tmp1__length1;
	PkInfoEnum* _tmp2_;
	gint _tmp2__length1;
	PkInfoEnum* _tmp3_;
	gint _tmp3__length1;
	_tmp0_ = (*self).packages;
	_tmp0__length1 = (*self).packages_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	(*dest).packages = (_vala_array_free ((*dest).packages, (*dest).packages_length1, (GDestroyNotify) g_free), NULL);
	(*dest).packages = _tmp1_;
	(*dest).packages_length1 = _tmp1__length1;
	(*dest).size = (*self).size;
	_tmp2_ = (*self).info;
	_tmp2__length1 = (*self).info_length1;
	_tmp3_ = (_tmp2_ != NULL) ? _vala_array_dup2 (_tmp2_, _tmp2__length1) : _tmp2_;
	_tmp3__length1 = _tmp2__length1;
	(*dest).info = (g_free ((*dest).info), NULL);
	(*dest).info = _tmp3_;
	(*dest).info_length1 = _tmp3__length1;
}

void
system_update_update_details_destroy (SystemUpdateUpdateDetails* self)
{
	(*self).packages = (_vala_array_free ((*self).packages, (*self).packages_length1, (GDestroyNotify) g_free), NULL);
	(*self).info = (g_free ((*self).info), NULL);
}

SystemUpdateUpdateDetails*
system_update_update_details_dup (const SystemUpdateUpdateDetails* self)
{
	SystemUpdateUpdateDetails* dup;
	dup = g_new0 (SystemUpdateUpdateDetails, 1);
	system_update_update_details_copy (self, dup);
	return dup;
}

void
system_update_update_details_free (SystemUpdateUpdateDetails* self)
{
	system_update_update_details_destroy (self);
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
system_update_update_details_get_type_once (void)
{
	GType system_update_update_details_type_id;
	system_update_update_details_type_id = g_boxed_type_register_static ("SystemUpdateUpdateDetails", (GBoxedCopyFunc) system_update_update_details_dup, (GBoxedFreeFunc) system_update_update_details_free);
	return system_update_update_details_type_id;
}

GType
system_update_update_details_get_type (void)
{
	static volatile gsize system_update_update_details_type_id__once = 0;
	if (g_once_init_enter (&system_update_update_details_type_id__once)) {
		GType system_update_update_details_type_id;
		system_update_update_details_type_id = system_update_update_details_get_type_once ();
		g_once_init_leave (&system_update_update_details_type_id__once, system_update_update_details_type_id);
	}
	return system_update_update_details_type_id__once;
}

static void
system_update_default_init (SystemUpdateIface * iface,
                            gpointer iface_data)
{
	system_update_signals[SYSTEM_UPDATE_STATE_CHANGED_SIGNAL] = g_signal_new ("state-changed", TYPE_SYSTEM_UPDATE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

 G_GNUC_NO_INLINE static GType
system_update_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SystemUpdateIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) system_update_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType system_update_type_id;
	system_update_type_id = g_type_register_static (G_TYPE_INTERFACE, "SystemUpdate", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (system_update_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (system_update_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) system_update_proxy_get_type);
	g_type_set_qdata (system_update_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "io.elementary.settings_daemon.SystemUpdate");
	g_type_set_qdata (system_update_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_system_update_dbus_interface_info));
	g_type_set_qdata (system_update_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) system_update_register_object);
	return system_update_type_id;
}

GType
system_update_get_type (void)
{
	static volatile gsize system_update_type_id__once = 0;
	if (g_once_init_enter (&system_update_type_id__once)) {
		GType system_update_type_id;
		system_update_type_id = system_update_get_type_once ();
		g_once_init_leave (&system_update_type_id__once, system_update_type_id);
	}
	return system_update_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SystemUpdateProxy, system_update_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (TYPE_SYSTEM_UPDATE, system_update_proxy_system_update_interface_init) )
static void
system_update_proxy_class_init (SystemUpdateProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = system_update_proxy_g_signal;
}

static void
_dbus_handle_system_update_state_changed (SystemUpdate* self,
                                          GVariant* parameters)
{
	GVariantIter _arguments_iter;
	g_variant_iter_init (&_arguments_iter, parameters);
	g_signal_emit_by_name (self, "state-changed");
}

static void
system_update_proxy_g_signal (GDBusProxy* proxy,
                              const gchar* sender_name,
                              const gchar* signal_name,
                              GVariant* parameters)
{
	if (strcmp (signal_name, "StateChanged") == 0) {
		_dbus_handle_system_update_state_changed ((SystemUpdate*) proxy, parameters);
	}
}

static void
system_update_proxy_init (SystemUpdateProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_system_update_dbus_interface_info));
}

static void
_vala_g_async_ready_callback (GObject *source_object,
                              GAsyncResult *res,
                              void *user_data)
{
	g_task_return_pointer (user_data, g_object_ref (res), g_object_unref);
	g_object_unref (user_data);
}

static void
system_update_proxy_get_current_state_async (SystemUpdate* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.settings_daemon.SystemUpdate", "GetCurrentState");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
system_update_proxy_get_current_state_finish (SystemUpdate* self,
                                              GAsyncResult* _res_,
                                              SystemUpdateCurrentState* result,
                                              GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	GVariant* _tmp0_;
	SystemUpdateCurrentState _tmp1_;
	GVariantIter _tmp2_;
	GVariant* _tmp3_;
	GVariant* _tmp4_;
	GVariant* _tmp5_;
	GVariant* _tmp6_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp0_ = g_variant_iter_next_value (&_reply_iter);
	g_variant_iter_init (&_tmp2_, _tmp0_);
	_tmp3_ = g_variant_iter_next_value (&_tmp2_);
	_tmp1_.state = g_variant_get_int32 (_tmp3_);
	g_variant_unref (_tmp3_);
	_tmp4_ = g_variant_iter_next_value (&_tmp2_);
	_tmp1_.message = g_variant_dup_string (_tmp4_, NULL);
	g_variant_unref (_tmp4_);
	_tmp5_ = g_variant_iter_next_value (&_tmp2_);
	_tmp1_.percentage = g_variant_get_uint32 (_tmp5_);
	g_variant_unref (_tmp5_);
	_tmp6_ = g_variant_iter_next_value (&_tmp2_);
	_tmp1_.download_size_remaining = g_variant_get_uint64 (_tmp6_);
	g_variant_unref (_tmp6_);
	*result = _tmp1_;
	g_variant_unref (_tmp0_);
	g_object_unref (_reply_message);
}

static void
system_update_proxy_get_update_details_async (SystemUpdate* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.settings_daemon.SystemUpdate", "GetUpdateDetails");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
system_update_proxy_get_update_details_finish (SystemUpdate* self,
                                               GAsyncResult* _res_,
                                               SystemUpdateUpdateDetails* result,
                                               GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	GVariant* _tmp7_;
	SystemUpdateUpdateDetails _tmp8_;
	GVariantIter _tmp9_;
	GVariant* _tmp10_;
	gchar** _tmp11_;
	gint _tmp11__length;
	gint _tmp11__size;
	gint _tmp11__length1;
	GVariantIter _tmp12_;
	GVariant* _tmp13_;
	GVariant* _tmp14_;
	GVariant* _tmp15_;
	PkInfoEnum* _tmp16_;
	gint _tmp16__length;
	gint _tmp16__size;
	gint _tmp16__length1;
	GVariantIter _tmp17_;
	GVariant* _tmp18_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp7_ = g_variant_iter_next_value (&_reply_iter);
	g_variant_iter_init (&_tmp9_, _tmp7_);
	_tmp10_ = g_variant_iter_next_value (&_tmp9_);
	_tmp11_ = g_new (gchar*, 5);
	_tmp11__length = 0;
	_tmp11__size = 4;
	_tmp11__length1 = 0;
	g_variant_iter_init (&_tmp12_, _tmp10_);
	for (; (_tmp13_ = g_variant_iter_next_value (&_tmp12_)) != NULL; _tmp11__length1++) {
		if (_tmp11__size == _tmp11__length) {
			_tmp11__size = 2 * _tmp11__size;
			_tmp11_ = g_renew (gchar*, _tmp11_, _tmp11__size + 1);
		}
		_tmp11_[_tmp11__length++] = g_variant_dup_string (_tmp13_, NULL);
		g_variant_unref (_tmp13_);
	}
	_tmp8_.packages_length1 = _tmp11__length1;
	_tmp11_[_tmp11__length] = NULL;
	_tmp8_.packages = _tmp11_;
	g_variant_unref (_tmp10_);
	_tmp14_ = g_variant_iter_next_value (&_tmp9_);
	_tmp8_.size = g_variant_get_uint64 (_tmp14_);
	g_variant_unref (_tmp14_);
	_tmp15_ = g_variant_iter_next_value (&_tmp9_);
	_tmp16_ = g_new (PkInfoEnum, 5);
	_tmp16__length = 0;
	_tmp16__size = 4;
	_tmp16__length1 = 0;
	g_variant_iter_init (&_tmp17_, _tmp15_);
	for (; (_tmp18_ = g_variant_iter_next_value (&_tmp17_)) != NULL; _tmp16__length1++) {
		if (_tmp16__size == _tmp16__length) {
			_tmp16__size = 2 * _tmp16__size;
			_tmp16_ = g_renew (PkInfoEnum, _tmp16_, _tmp16__size + 1);
		}
		_tmp16_[_tmp16__length++] = g_variant_get_int32 (_tmp18_);
		g_variant_unref (_tmp18_);
	}
	_tmp8_.info_length1 = _tmp16__length1;
	_tmp8_.info = _tmp16_;
	g_variant_unref (_tmp15_);
	*result = _tmp8_;
	g_variant_unref (_tmp7_);
	g_object_unref (_reply_message);
}

static void
system_update_proxy_cancel_async (SystemUpdate* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.settings_daemon.SystemUpdate", "Cancel");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
system_update_proxy_cancel_finish (SystemUpdate* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
system_update_proxy_check_for_updates_async (SystemUpdate* self,
                                             gboolean force,
                                             gboolean notify,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.settings_daemon.SystemUpdate", "CheckForUpdates");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (force));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_boolean (notify));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
system_update_proxy_check_for_updates_finish (SystemUpdate* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
system_update_proxy_update_async (SystemUpdate* self,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.settings_daemon.SystemUpdate", "Update");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static void
system_update_proxy_update_finish (SystemUpdate* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		return;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return;
	}
	g_object_unref (_reply_message);
}

static void
system_update_proxy_get_last_refresh_time_async (SystemUpdate* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	G_DBUS_ERROR;
	G_IO_ERROR;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.settings_daemon.SystemUpdate", "GetLastRefreshTime");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	if (_callback_ != NULL) {
		g_dbus_connection_send_message_with_reply (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, _vala_g_async_ready_callback, g_task_new ((GObject *) self, NULL, _callback_, _user_data_));
	} else {
		g_dbus_message_set_flags (_message, G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED);
		g_dbus_connection_send_message (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	}
	g_object_unref (_message);
}

static gint64
system_update_proxy_get_last_refresh_time_finish (SystemUpdate* self,
                                                  GAsyncResult* _res_,
                                                  GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gint64 _result = 0LL;
	GVariant* _tmp21_;
	_inner_res = g_task_propagate_pointer ((GTask *) _res_, NULL);
	_reply_message = g_dbus_connection_send_message_with_reply_finish (g_dbus_proxy_get_connection ((GDBusProxy *) self), _inner_res, error);
	g_object_unref (_inner_res);
	if (!_reply_message) {
		gint64 _tmp19_ = 0LL;
		return _tmp19_;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		gint64 _tmp20_ = 0LL;
		g_object_unref (_reply_message);
		return _tmp20_;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp21_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_get_int64 (_tmp21_);
	g_variant_unref (_tmp21_);
	g_object_unref (_reply_message);
	return _result;
}

static void
system_update_proxy_system_update_interface_init (SystemUpdateIface* iface)
{
	iface->get_current_state = system_update_proxy_get_current_state_async;
	iface->get_current_state_finish = system_update_proxy_get_current_state_finish;
	iface->get_update_details = system_update_proxy_get_update_details_async;
	iface->get_update_details_finish = system_update_proxy_get_update_details_finish;
	iface->cancel = system_update_proxy_cancel_async;
	iface->cancel_finish = system_update_proxy_cancel_finish;
	iface->check_for_updates = system_update_proxy_check_for_updates_async;
	iface->check_for_updates_finish = system_update_proxy_check_for_updates_finish;
	iface->update = system_update_proxy_update_async;
	iface->update_finish = system_update_proxy_update_finish;
	iface->get_last_refresh_time = system_update_proxy_get_last_refresh_time_async;
	iface->get_last_refresh_time_finish = system_update_proxy_get_last_refresh_time_finish;
}

static void
_dbus_system_update_get_current_state (SystemUpdate* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	SystemUpdateGetCurrentStateReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (SystemUpdateGetCurrentStateReadyData);
	_ready_data->_invocation_ = invocation;
	system_update_get_current_state (self, (GAsyncReadyCallback) _dbus_system_update_get_current_state_ready, _ready_data);
}

static void
_dbus_system_update_get_current_state_ready (GObject * source_object,
                                             GAsyncResult * _res_,
                                             gpointer _user_data_)
{
	SystemUpdateGetCurrentStateReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	SystemUpdateCurrentState result = {0};
	GVariantBuilder _tmp22_;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	system_update_get_current_state_finish ((SystemUpdate*) source_object, _res_, &result, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_init (&_tmp22_, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_tmp22_, g_variant_new_int32 (result.state));
	g_variant_builder_add_value (&_tmp22_, g_variant_new_string (result.message));
	g_variant_builder_add_value (&_tmp22_, g_variant_new_uint32 (result.percentage));
	g_variant_builder_add_value (&_tmp22_, g_variant_new_uint64 (result.download_size_remaining));
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp22_));
	system_update_current_state_destroy (&result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (SystemUpdateGetCurrentStateReadyData, _ready_data);
}

static void
_dbus_system_update_get_update_details (SystemUpdate* self,
                                        GVariant* _parameters_,
                                        GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	SystemUpdateGetUpdateDetailsReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (SystemUpdateGetUpdateDetailsReadyData);
	_ready_data->_invocation_ = invocation;
	system_update_get_update_details (self, (GAsyncReadyCallback) _dbus_system_update_get_update_details_ready, _ready_data);
}

static void
_dbus_system_update_get_update_details_ready (GObject * source_object,
                                              GAsyncResult * _res_,
                                              gpointer _user_data_)
{
	SystemUpdateGetUpdateDetailsReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	SystemUpdateUpdateDetails result = {0};
	GVariantBuilder _tmp23_;
	gchar** _tmp24_;
	GVariantBuilder _tmp25_;
	gint _tmp26_;
	PkInfoEnum* _tmp27_;
	GVariantBuilder _tmp28_;
	gint _tmp29_;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	system_update_get_update_details_finish ((SystemUpdate*) source_object, _res_, &result, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_init (&_tmp23_, G_VARIANT_TYPE_TUPLE);
	_tmp24_ = result.packages;
	g_variant_builder_init (&_tmp25_, G_VARIANT_TYPE ("as"));
	for (_tmp26_ = 0; _tmp26_ < result.packages_length1; _tmp26_++) {
		g_variant_builder_add_value (&_tmp25_, g_variant_new_string (*_tmp24_));
		_tmp24_++;
	}
	g_variant_builder_add_value (&_tmp23_, g_variant_builder_end (&_tmp25_));
	g_variant_builder_add_value (&_tmp23_, g_variant_new_uint64 (result.size));
	_tmp27_ = result.info;
	g_variant_builder_init (&_tmp28_, G_VARIANT_TYPE ("ai"));
	for (_tmp29_ = 0; _tmp29_ < result.info_length1; _tmp29_++) {
		g_variant_builder_add_value (&_tmp28_, g_variant_new_int32 (*_tmp27_));
		_tmp27_++;
	}
	g_variant_builder_add_value (&_tmp23_, g_variant_builder_end (&_tmp28_));
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp23_));
	system_update_update_details_destroy (&result);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (SystemUpdateGetUpdateDetailsReadyData, _ready_data);
}

static void
_dbus_system_update_cancel (SystemUpdate* self,
                            GVariant* _parameters_,
                            GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	SystemUpdateCancelReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (SystemUpdateCancelReadyData);
	_ready_data->_invocation_ = invocation;
	system_update_cancel (self, (GAsyncReadyCallback) _dbus_system_update_cancel_ready, _ready_data);
}

static void
_dbus_system_update_cancel_ready (GObject * source_object,
                                  GAsyncResult * _res_,
                                  gpointer _user_data_)
{
	SystemUpdateCancelReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	system_update_cancel_finish ((SystemUpdate*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (SystemUpdateCancelReadyData, _ready_data);
}

static void
_dbus_system_update_check_for_updates (SystemUpdate* self,
                                       GVariant* _parameters_,
                                       GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	SystemUpdateCheckForUpdatesReadyData* _ready_data;
	GVariant* _tmp30_;
	GVariant* _tmp31_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (SystemUpdateCheckForUpdatesReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp30_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->force = g_variant_get_boolean (_tmp30_);
	g_variant_unref (_tmp30_);
	_tmp31_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->notify = g_variant_get_boolean (_tmp31_);
	g_variant_unref (_tmp31_);
	system_update_check_for_updates (self, _ready_data->force, _ready_data->notify, (GAsyncReadyCallback) _dbus_system_update_check_for_updates_ready, _ready_data);
}

static void
_dbus_system_update_check_for_updates_ready (GObject * source_object,
                                             GAsyncResult * _res_,
                                             gpointer _user_data_)
{
	SystemUpdateCheckForUpdatesReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	system_update_check_for_updates_finish ((SystemUpdate*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (SystemUpdateCheckForUpdatesReadyData, _ready_data);
}

static void
_dbus_system_update_update (SystemUpdate* self,
                            GVariant* _parameters_,
                            GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	SystemUpdateUpdateReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (SystemUpdateUpdateReadyData);
	_ready_data->_invocation_ = invocation;
	system_update_update (self, (GAsyncReadyCallback) _dbus_system_update_update_ready, _ready_data);
}

static void
_dbus_system_update_update_ready (GObject * source_object,
                                  GAsyncResult * _res_,
                                  gpointer _user_data_)
{
	SystemUpdateUpdateReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	system_update_update_finish ((SystemUpdate*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (SystemUpdateUpdateReadyData, _ready_data);
}

static void
_dbus_system_update_get_last_refresh_time (SystemUpdate* self,
                                           GVariant* _parameters_,
                                           GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	SystemUpdateGetLastRefreshTimeReadyData* _ready_data;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (SystemUpdateGetLastRefreshTimeReadyData);
	_ready_data->_invocation_ = invocation;
	system_update_get_last_refresh_time (self, (GAsyncReadyCallback) _dbus_system_update_get_last_refresh_time_ready, _ready_data);
}

static void
_dbus_system_update_get_last_refresh_time_ready (GObject * source_object,
                                                 GAsyncResult * _res_,
                                                 gpointer _user_data_)
{
	SystemUpdateGetLastRefreshTimeReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gint64 result;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	result = system_update_get_last_refresh_time_finish ((SystemUpdate*) source_object, _res_, &error);
	if (error) {
		g_dbus_method_invocation_take_error (invocation, error);
		goto _error;
	}
	_reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
	g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_reply_builder, g_variant_new_int64 (result));
	_reply = g_variant_builder_end (&_reply_builder);
	g_dbus_message_set_body (_reply_message, _reply);
	g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
	g_object_unref (invocation);
	g_object_unref (_reply_message);
	_error:
	g_slice_free (SystemUpdateGetLastRefreshTimeReadyData, _ready_data);
}

static void
system_update_dbus_interface_method_call (GDBusConnection* connection,
                                          const gchar* sender,
                                          const gchar* object_path,
                                          const gchar* interface_name,
                                          const gchar* method_name,
                                          GVariant* parameters,
                                          GDBusMethodInvocation* invocation,
                                          gpointer user_data)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (method_name, "GetCurrentState") == 0) {
		_dbus_system_update_get_current_state (object, parameters, invocation);
	} else if (strcmp (method_name, "GetUpdateDetails") == 0) {
		_dbus_system_update_get_update_details (object, parameters, invocation);
	} else if (strcmp (method_name, "Cancel") == 0) {
		_dbus_system_update_cancel (object, parameters, invocation);
	} else if (strcmp (method_name, "CheckForUpdates") == 0) {
		_dbus_system_update_check_for_updates (object, parameters, invocation);
	} else if (strcmp (method_name, "Update") == 0) {
		_dbus_system_update_update (object, parameters, invocation);
	} else if (strcmp (method_name, "GetLastRefreshTime") == 0) {
		_dbus_system_update_get_last_refresh_time (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
system_update_dbus_interface_get_property (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* property_name,
                                           GError** error,
                                           gpointer user_data)
{
	return NULL;
}

static gboolean
system_update_dbus_interface_set_property (GDBusConnection* connection,
                                           const gchar* sender,
                                           const gchar* object_path,
                                           const gchar* interface_name,
                                           const gchar* property_name,
                                           GVariant* value,
                                           GError** error,
                                           gpointer user_data)
{
	return FALSE;
}

static void
_dbus_system_update_state_changed (GObject* _sender,
                                   gpointer* _data)
{
	GDBusConnection * _connection;
	const gchar * _path;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_connection = _data[1];
	_path = _data[2];
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_connection_emit_signal (_connection, NULL, _path, "io.elementary.settings_daemon.SystemUpdate", "StateChanged", _arguments, NULL);
}

guint
system_update_register_object (gpointer object,
                               GDBusConnection* connection,
                               const gchar* path,
                               GError** error)
{
	guint result;
	gpointer *data;
	data = g_new (gpointer, 3);
	data[0] = g_object_ref (object);
	data[1] = g_object_ref (connection);
	data[2] = g_strdup (path);
	result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_system_update_dbus_interface_info), &_system_update_dbus_interface_vtable, data, _system_update_unregister_object, error);
	if (!result) {
		return 0;
	}
	g_signal_connect (object, "state-changed", (GCallback) _dbus_system_update_state_changed, data);
	return result;
}

static void
_system_update_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_signal_handlers_disconnect_by_func (data[0], _dbus_system_update_state_changed, data);
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

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);
}

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;
}

