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

/*
* Copyright (c) 2017 elementary LLC (https://elementary.io)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

#include "slingshot.h"
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>

#define SLINGSHOT_BACKEND_APP_CENTER_DBUS_NAME "io.elementary.appcenter"
#define SLINGSHOT_BACKEND_APP_CENTER_DBUS_PATH "/io/elementary/appcenter"
#define SLINGSHOT_BACKEND_APP_CENTER_RECONNECT_TIMEOUT 5000U
#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

typedef GDBusProxy AppCenterDBusProxy;
typedef GDBusProxyClass AppCenterDBusProxyClass;
typedef struct _AppCenterDbusInstallReadyData AppCenterDbusInstallReadyData;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _AppCenterDbusUpdateReadyData AppCenterDbusUpdateReadyData;
typedef struct _AppCenterDbusUninstallReadyData AppCenterDbusUninstallReadyData;
typedef struct _AppCenterDbusGetComponentFromDesktopIdReadyData AppCenterDbusGetComponentFromDesktopIdReadyData;
typedef struct _AppCenterDbusSearchComponentsReadyData AppCenterDbusSearchComponentsReadyData;
enum  {
	SLINGSHOT_BACKEND_APP_CENTER_0_PROPERTY,
	SLINGSHOT_BACKEND_APP_CENTER_DBUS_PROPERTY,
	SLINGSHOT_BACKEND_APP_CENTER_NUM_PROPERTIES
};
static GParamSpec* slingshot_backend_app_center_properties[SLINGSHOT_BACKEND_APP_CENTER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

struct _AppCenterDbusInstallReadyData {
	GDBusMethodInvocation* _invocation_;
	gchar* component_id;
};

struct _AppCenterDbusUpdateReadyData {
	GDBusMethodInvocation* _invocation_;
	gchar* component_id;
};

struct _AppCenterDbusUninstallReadyData {
	GDBusMethodInvocation* _invocation_;
	gchar* component_id;
};

struct _AppCenterDbusGetComponentFromDesktopIdReadyData {
	GDBusMethodInvocation* _invocation_;
	gchar* desktop_id;
};

struct _AppCenterDbusSearchComponentsReadyData {
	GDBusMethodInvocation* _invocation_;
	gchar* query;
};

struct _SlingshotBackendAppCenterPrivate {
	AppCenterDBus* _dbus;
};

static GType app_center_dbus_type_id = 0;
static gint SlingshotBackendAppCenter_private_offset;
static gpointer slingshot_backend_app_center_parent_class = NULL;
static SlingshotBackendAppCenter* slingshot_backend_app_center_instance;
static SlingshotBackendAppCenter* slingshot_backend_app_center_instance = NULL;
static GType slingshot_backend_app_center_type_id = 0;

static void app_center_dbus_proxy_g_signal (GDBusProxy* proxy,
                                     const gchar* sender_name,
                                     const gchar* signal_name,
                                     GVariant* parameters);
static void _vala_g_async_ready_callback (GObject *source_object,
                                   GAsyncResult *res,
                                   void *user_data);
static void app_center_dbus_proxy_install_async (AppCenterDBus* self,
                                          const gchar* component_id,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static void app_center_dbus_proxy_install_finish (AppCenterDBus* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static void app_center_dbus_proxy_update_async (AppCenterDBus* self,
                                         const gchar* component_id,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static void app_center_dbus_proxy_update_finish (AppCenterDBus* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static void app_center_dbus_proxy_uninstall_async (AppCenterDBus* self,
                                            const gchar* component_id,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
static void app_center_dbus_proxy_uninstall_finish (AppCenterDBus* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static void app_center_dbus_proxy_get_component_from_desktop_id_async (AppCenterDBus* self,
                                                                const gchar* desktop_id,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_);
static gchar* app_center_dbus_proxy_get_component_from_desktop_id_finish (AppCenterDBus* self,
                                                                   GAsyncResult* _res_,
                                                                   GError** error);
static void app_center_dbus_proxy_search_components_async (AppCenterDBus* self,
                                                    const gchar* query,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_);
static gchar** app_center_dbus_proxy_search_components_finish (AppCenterDBus* self,
                                                        GAsyncResult* _res_,
                                                        gint* result_length1,
                                                        GError** error);
static void app_center_dbus_proxy_app_center_dbus_interface_init (AppCenterDBusIface* iface);
static void _dbus_app_center_dbus_install (AppCenterDBus* self,
                                    GVariant* _parameters_,
                                    GDBusMethodInvocation* invocation);
static void _dbus_app_center_dbus_install_ready (GObject * source_object,
                                          GAsyncResult * _res_,
                                          gpointer _user_data_);
static void _dbus_app_center_dbus_update (AppCenterDBus* self,
                                   GVariant* _parameters_,
                                   GDBusMethodInvocation* invocation);
static void _dbus_app_center_dbus_update_ready (GObject * source_object,
                                         GAsyncResult * _res_,
                                         gpointer _user_data_);
static void _dbus_app_center_dbus_uninstall (AppCenterDBus* self,
                                      GVariant* _parameters_,
                                      GDBusMethodInvocation* invocation);
static void _dbus_app_center_dbus_uninstall_ready (GObject * source_object,
                                            GAsyncResult * _res_,
                                            gpointer _user_data_);
static void _dbus_app_center_dbus_get_component_from_desktop_id (AppCenterDBus* self,
                                                          GVariant* _parameters_,
                                                          GDBusMethodInvocation* invocation);
static void _dbus_app_center_dbus_get_component_from_desktop_id_ready (GObject * source_object,
                                                                GAsyncResult * _res_,
                                                                gpointer _user_data_);
static void _dbus_app_center_dbus_search_components (AppCenterDBus* self,
                                              GVariant* _parameters_,
                                              GDBusMethodInvocation* invocation);
static void _dbus_app_center_dbus_search_components_ready (GObject * source_object,
                                                    GAsyncResult * _res_,
                                                    gpointer _user_data_);
static void app_center_dbus_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* app_center_dbus_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 app_center_dbus_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 _app_center_dbus_unregister_object (gpointer user_data);
static SlingshotBackendAppCenter* slingshot_backend_app_center_new (void);
static SlingshotBackendAppCenter* slingshot_backend_app_center_construct (GType object_type);
static void slingshot_backend_app_center_try_connect (SlingshotBackendAppCenter* self);
static void __lambda119_ (SlingshotBackendAppCenter* self,
                   GObject* obj,
                   GAsyncResult* res);
static void slingshot_backend_app_center_set_dbus (SlingshotBackendAppCenter* self,
                                            AppCenterDBus* value);
static gboolean ___lambda120_ (SlingshotBackendAppCenter* self);
static gboolean ____lambda120__gsource_func (gpointer self);
static void ___lambda119__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void slingshot_backend_app_center_name_vanished_callback (SlingshotBackendAppCenter* self,
                                                          GDBusConnection* connection,
                                                          const gchar* name);
static GObject * slingshot_backend_app_center_constructor (GType type,
                                                    guint n_construct_properties,
                                                    GObjectConstructParam * construct_properties);
static void _slingshot_backend_app_center___lambda121_ (SlingshotBackendAppCenter* self);
static void __slingshot_backend_app_center___lambda121__gbus_name_appeared_callback (GDBusConnection* connection,
                                                                              const gchar* name,
                                                                              const gchar* name_owner,
                                                                              gpointer self);
static void _slingshot_backend_app_center_name_vanished_callback_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                       const gchar* name,
                                                                                       gpointer self);
static void slingshot_backend_app_center_finalize (GObject * obj);
static void _vala_slingshot_backend_app_center_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void _vala_slingshot_backend_app_center_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 const GDBusArgInfo _app_center_dbus_dbus_arg_info_install_component_id = {-1, "component_id", "s", NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_install_in[] = {&_app_center_dbus_dbus_arg_info_install_component_id, NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_install_out[] = {NULL};
static const GDBusMethodInfo _app_center_dbus_dbus_method_info_install = {-1, "Install", (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_install_in), (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_install_out), NULL};
static const GDBusArgInfo _app_center_dbus_dbus_arg_info_update_component_id = {-1, "component_id", "s", NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_update_in[] = {&_app_center_dbus_dbus_arg_info_update_component_id, NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_update_out[] = {NULL};
static const GDBusMethodInfo _app_center_dbus_dbus_method_info_update = {-1, "Update", (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_update_in), (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_update_out), NULL};
static const GDBusArgInfo _app_center_dbus_dbus_arg_info_uninstall_component_id = {-1, "component_id", "s", NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_uninstall_in[] = {&_app_center_dbus_dbus_arg_info_uninstall_component_id, NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_uninstall_out[] = {NULL};
static const GDBusMethodInfo _app_center_dbus_dbus_method_info_uninstall = {-1, "Uninstall", (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_uninstall_in), (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_uninstall_out), NULL};
static const GDBusArgInfo _app_center_dbus_dbus_arg_info_get_component_from_desktop_id_desktop_id = {-1, "desktop_id", "s", NULL};
static const GDBusArgInfo _app_center_dbus_dbus_arg_info_get_component_from_desktop_id_result = {-1, "result", "s", NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_get_component_from_desktop_id_in[] = {&_app_center_dbus_dbus_arg_info_get_component_from_desktop_id_desktop_id, NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_get_component_from_desktop_id_out[] = {&_app_center_dbus_dbus_arg_info_get_component_from_desktop_id_result, NULL};
static const GDBusMethodInfo _app_center_dbus_dbus_method_info_get_component_from_desktop_id = {-1, "GetComponentFromDesktopId", (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_get_component_from_desktop_id_in), (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_get_component_from_desktop_id_out), NULL};
static const GDBusArgInfo _app_center_dbus_dbus_arg_info_search_components_query = {-1, "query", "s", NULL};
static const GDBusArgInfo _app_center_dbus_dbus_arg_info_search_components_result = {-1, "result", "as", NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_search_components_in[] = {&_app_center_dbus_dbus_arg_info_search_components_query, NULL};
static const GDBusArgInfo * const _app_center_dbus_dbus_arg_info_search_components_out[] = {&_app_center_dbus_dbus_arg_info_search_components_result, NULL};
static const GDBusMethodInfo _app_center_dbus_dbus_method_info_search_components = {-1, "SearchComponents", (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_search_components_in), (GDBusArgInfo **) (&_app_center_dbus_dbus_arg_info_search_components_out), NULL};
static const GDBusMethodInfo * const _app_center_dbus_dbus_method_info[] = {&_app_center_dbus_dbus_method_info_install, &_app_center_dbus_dbus_method_info_update, &_app_center_dbus_dbus_method_info_uninstall, &_app_center_dbus_dbus_method_info_get_component_from_desktop_id, &_app_center_dbus_dbus_method_info_search_components, NULL};
static const GDBusSignalInfo * const _app_center_dbus_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo * const _app_center_dbus_dbus_property_info[] = {NULL};
static const GDBusInterfaceInfo _app_center_dbus_dbus_interface_info = {-1, "io.elementary.appcenter", (GDBusMethodInfo **) (&_app_center_dbus_dbus_method_info), (GDBusSignalInfo **) (&_app_center_dbus_dbus_signal_info), (GDBusPropertyInfo **) (&_app_center_dbus_dbus_property_info), NULL};
static const GDBusInterfaceVTable _app_center_dbus_dbus_interface_vtable = {app_center_dbus_dbus_interface_method_call, app_center_dbus_dbus_interface_get_property, app_center_dbus_dbus_interface_set_property};

void
app_center_dbus_install (AppCenterDBus* self,
                         const gchar* component_id,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->install) {
		_iface_->install (self, component_id, _callback_, _user_data_);
	}
}

void
app_center_dbus_install_finish (AppCenterDBus* self,
                                GAsyncResult* _res_,
                                GError** error)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->install_finish) {
		_iface_->install_finish (self, _res_, error);
	}
}

void
app_center_dbus_update (AppCenterDBus* self,
                        const gchar* component_id,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->update) {
		_iface_->update (self, component_id, _callback_, _user_data_);
	}
}

void
app_center_dbus_update_finish (AppCenterDBus* self,
                               GAsyncResult* _res_,
                               GError** error)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->update_finish) {
		_iface_->update_finish (self, _res_, error);
	}
}

void
app_center_dbus_uninstall (AppCenterDBus* self,
                           const gchar* component_id,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->uninstall) {
		_iface_->uninstall (self, component_id, _callback_, _user_data_);
	}
}

void
app_center_dbus_uninstall_finish (AppCenterDBus* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->uninstall_finish) {
		_iface_->uninstall_finish (self, _res_, error);
	}
}

void
app_center_dbus_get_component_from_desktop_id (AppCenterDBus* self,
                                               const gchar* desktop_id,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->get_component_from_desktop_id) {
		_iface_->get_component_from_desktop_id (self, desktop_id, _callback_, _user_data_);
	}
}

gchar*
app_center_dbus_get_component_from_desktop_id_finish (AppCenterDBus* self,
                                                      GAsyncResult* _res_,
                                                      GError** error)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->get_component_from_desktop_id_finish) {
		return _iface_->get_component_from_desktop_id_finish (self, _res_, error);
	}
	return NULL;
}

void
app_center_dbus_search_components (AppCenterDBus* self,
                                   const gchar* query,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->search_components) {
		_iface_->search_components (self, query, _callback_, _user_data_);
	}
}

gchar**
app_center_dbus_search_components_finish (AppCenterDBus* self,
                                          GAsyncResult* _res_,
                                          gint* result_length1,
                                          GError** error)
{
	AppCenterDBusIface* _iface_;
	_iface_ = APP_CENTER_DBUS_GET_INTERFACE (self);
	if (_iface_->search_components_finish) {
		return _iface_->search_components_finish (self, _res_, result_length1, error);
	}
	return NULL;
}

static void
app_center_dbus_default_init (AppCenterDBusIface * iface,
                              gpointer iface_data)
{
}

GType
app_center_dbus_get_type (void)
{
	return app_center_dbus_type_id;
}

GType
app_center_dbus_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (AppCenterDBusIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) app_center_dbus_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	app_center_dbus_type_id = g_type_module_register_type (module, G_TYPE_INTERFACE, "AppCenterDBus", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (app_center_dbus_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (app_center_dbus_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) app_center_dbus_proxy_get_type);
	g_type_set_qdata (app_center_dbus_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "io.elementary.appcenter");
	g_type_set_qdata (app_center_dbus_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_app_center_dbus_dbus_interface_info));
	g_type_set_qdata (app_center_dbus_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) app_center_dbus_register_object);
	return app_center_dbus_type_id;
}

G_DEFINE_DYNAMIC_TYPE_EXTENDED (AppCenterDBusProxy, app_center_dbus_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE_DYNAMIC (TYPE_APP_CENTER_DBUS, app_center_dbus_proxy_app_center_dbus_interface_init) )
static void
app_center_dbus_proxy_class_init (AppCenterDBusProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = app_center_dbus_proxy_g_signal;
}

static void
app_center_dbus_proxy_g_signal (GDBusProxy* proxy,
                                const gchar* sender_name,
                                const gchar* signal_name,
                                GVariant* parameters)
{
}

static void
app_center_dbus_proxy_class_finalize (AppCenterDBusProxyClass* klass)
{
}

void
app_center_dbus_proxy_register_dynamic_type (GTypeModule* module)
{
	app_center_dbus_proxy_register_type (module);
}

static void
app_center_dbus_proxy_init (AppCenterDBusProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_app_center_dbus_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
app_center_dbus_proxy_install_async (AppCenterDBus* self,
                                     const gchar* component_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.appcenter", "Install");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (component_id));
	_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
app_center_dbus_proxy_install_finish (AppCenterDBus* 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
app_center_dbus_proxy_update_async (AppCenterDBus* self,
                                    const gchar* component_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.appcenter", "Update");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (component_id));
	_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
app_center_dbus_proxy_update_finish (AppCenterDBus* 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
app_center_dbus_proxy_uninstall_async (AppCenterDBus* self,
                                       const gchar* component_id,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.appcenter", "Uninstall");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (component_id));
	_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
app_center_dbus_proxy_uninstall_finish (AppCenterDBus* 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
app_center_dbus_proxy_get_component_from_desktop_id_async (AppCenterDBus* self,
                                                           const gchar* desktop_id,
                                                           GAsyncReadyCallback _callback_,
                                                           gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.appcenter", "GetComponentFromDesktopId");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (desktop_id));
	_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 gchar*
app_center_dbus_proxy_get_component_from_desktop_id_finish (AppCenterDBus* self,
                                                            GAsyncResult* _res_,
                                                            GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gchar* _result = NULL;
	GVariant* _tmp0_;
	_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 NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_tmp0_ = g_variant_iter_next_value (&_reply_iter);
	_result = g_variant_dup_string (_tmp0_, NULL);
	g_variant_unref (_tmp0_);
	g_object_unref (_reply_message);
	return _result;
}

static void
app_center_dbus_proxy_search_components_async (AppCenterDBus* self,
                                               const gchar* query,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "io.elementary.appcenter", "SearchComponents");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (query));
	_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 gchar**
app_center_dbus_proxy_search_components_finish (AppCenterDBus* self,
                                                GAsyncResult* _res_,
                                                gint* result_length1,
                                                GError** error)
{
	GAsyncResult *_inner_res;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	gchar** _result = NULL;
	gint _result_length1;
	GVariant* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length;
	gint _tmp2__size;
	gint _tmp2__length1;
	GVariantIter _tmp3_;
	GVariant* _tmp4_;
	_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 NULL;
	}
	if (g_dbus_message_to_gerror (_reply_message, error)) {
		g_object_unref (_reply_message);
		return NULL;
	}
	_reply = g_dbus_message_get_body (_reply_message);
	g_variant_iter_init (&_reply_iter, _reply);
	_result_length1 = 0;
	_tmp1_ = g_variant_iter_next_value (&_reply_iter);
	_tmp2_ = g_new (gchar*, 5);
	_tmp2__length = 0;
	_tmp2__size = 4;
	_tmp2__length1 = 0;
	g_variant_iter_init (&_tmp3_, _tmp1_);
	for (; (_tmp4_ = g_variant_iter_next_value (&_tmp3_)) != NULL; _tmp2__length1++) {
		if (_tmp2__size == _tmp2__length) {
			_tmp2__size = 2 * _tmp2__size;
			_tmp2_ = g_renew (gchar*, _tmp2_, _tmp2__size + 1);
		}
		_tmp2_[_tmp2__length++] = g_variant_dup_string (_tmp4_, NULL);
		g_variant_unref (_tmp4_);
	}
	_result_length1 = _tmp2__length1;
	_tmp2_[_tmp2__length] = NULL;
	_result = _tmp2_;
	g_variant_unref (_tmp1_);
	*result_length1 = _result_length1;
	g_object_unref (_reply_message);
	return _result;
}

static void
app_center_dbus_proxy_app_center_dbus_interface_init (AppCenterDBusIface* iface)
{
	iface->install = app_center_dbus_proxy_install_async;
	iface->install_finish = app_center_dbus_proxy_install_finish;
	iface->update = app_center_dbus_proxy_update_async;
	iface->update_finish = app_center_dbus_proxy_update_finish;
	iface->uninstall = app_center_dbus_proxy_uninstall_async;
	iface->uninstall_finish = app_center_dbus_proxy_uninstall_finish;
	iface->get_component_from_desktop_id = app_center_dbus_proxy_get_component_from_desktop_id_async;
	iface->get_component_from_desktop_id_finish = app_center_dbus_proxy_get_component_from_desktop_id_finish;
	iface->search_components = app_center_dbus_proxy_search_components_async;
	iface->search_components_finish = app_center_dbus_proxy_search_components_finish;
}

static void
_dbus_app_center_dbus_install (AppCenterDBus* self,
                               GVariant* _parameters_,
                               GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	AppCenterDbusInstallReadyData* _ready_data;
	GVariant* _tmp5_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (AppCenterDbusInstallReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp5_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->component_id = g_variant_dup_string (_tmp5_, NULL);
	g_variant_unref (_tmp5_);
	app_center_dbus_install (self, _ready_data->component_id, (GAsyncReadyCallback) _dbus_app_center_dbus_install_ready, _ready_data);
	_error:
	;
}

static void
_dbus_app_center_dbus_install_ready (GObject * source_object,
                                     GAsyncResult * _res_,
                                     gpointer _user_data_)
{
	AppCenterDbusInstallReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	app_center_dbus_install_finish ((AppCenterDBus*) 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_free0 (_ready_data->component_id);
	g_slice_free (AppCenterDbusInstallReadyData, _ready_data);
}

static void
_dbus_app_center_dbus_update (AppCenterDBus* self,
                              GVariant* _parameters_,
                              GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	AppCenterDbusUpdateReadyData* _ready_data;
	GVariant* _tmp6_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (AppCenterDbusUpdateReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp6_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->component_id = g_variant_dup_string (_tmp6_, NULL);
	g_variant_unref (_tmp6_);
	app_center_dbus_update (self, _ready_data->component_id, (GAsyncReadyCallback) _dbus_app_center_dbus_update_ready, _ready_data);
	_error:
	;
}

static void
_dbus_app_center_dbus_update_ready (GObject * source_object,
                                    GAsyncResult * _res_,
                                    gpointer _user_data_)
{
	AppCenterDbusUpdateReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	app_center_dbus_update_finish ((AppCenterDBus*) 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_free0 (_ready_data->component_id);
	g_slice_free (AppCenterDbusUpdateReadyData, _ready_data);
}

static void
_dbus_app_center_dbus_uninstall (AppCenterDBus* self,
                                 GVariant* _parameters_,
                                 GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	AppCenterDbusUninstallReadyData* _ready_data;
	GVariant* _tmp7_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (AppCenterDbusUninstallReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp7_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->component_id = g_variant_dup_string (_tmp7_, NULL);
	g_variant_unref (_tmp7_);
	app_center_dbus_uninstall (self, _ready_data->component_id, (GAsyncReadyCallback) _dbus_app_center_dbus_uninstall_ready, _ready_data);
	_error:
	;
}

static void
_dbus_app_center_dbus_uninstall_ready (GObject * source_object,
                                       GAsyncResult * _res_,
                                       gpointer _user_data_)
{
	AppCenterDbusUninstallReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	app_center_dbus_uninstall_finish ((AppCenterDBus*) 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_free0 (_ready_data->component_id);
	g_slice_free (AppCenterDbusUninstallReadyData, _ready_data);
}

static void
_dbus_app_center_dbus_get_component_from_desktop_id (AppCenterDBus* self,
                                                     GVariant* _parameters_,
                                                     GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	AppCenterDbusGetComponentFromDesktopIdReadyData* _ready_data;
	GVariant* _tmp8_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (AppCenterDbusGetComponentFromDesktopIdReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp8_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->desktop_id = g_variant_dup_string (_tmp8_, NULL);
	g_variant_unref (_tmp8_);
	app_center_dbus_get_component_from_desktop_id (self, _ready_data->desktop_id, (GAsyncReadyCallback) _dbus_app_center_dbus_get_component_from_desktop_id_ready, _ready_data);
	_error:
	;
}

static void
_dbus_app_center_dbus_get_component_from_desktop_id_ready (GObject * source_object,
                                                           GAsyncResult * _res_,
                                                           gpointer _user_data_)
{
	AppCenterDbusGetComponentFromDesktopIdReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar* result;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	result = app_center_dbus_get_component_from_desktop_id_finish ((AppCenterDBus*) 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_string (result));
	_g_free0 (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_free0 (_ready_data->desktop_id);
	g_slice_free (AppCenterDbusGetComponentFromDesktopIdReadyData, _ready_data);
}

static void
_dbus_app_center_dbus_search_components (AppCenterDBus* self,
                                         GVariant* _parameters_,
                                         GDBusMethodInvocation* invocation)
{
	GVariantIter _arguments_iter;
	AppCenterDbusSearchComponentsReadyData* _ready_data;
	GVariant* _tmp9_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_ready_data = g_slice_new0 (AppCenterDbusSearchComponentsReadyData);
	_ready_data->_invocation_ = invocation;
	_tmp9_ = g_variant_iter_next_value (&_arguments_iter);
	_ready_data->query = g_variant_dup_string (_tmp9_, NULL);
	g_variant_unref (_tmp9_);
	app_center_dbus_search_components (self, _ready_data->query, (GAsyncReadyCallback) _dbus_app_center_dbus_search_components_ready, _ready_data);
	_error:
	;
}

static void
_dbus_app_center_dbus_search_components_ready (GObject * source_object,
                                               GAsyncResult * _res_,
                                               gpointer _user_data_)
{
	AppCenterDbusSearchComponentsReadyData* _ready_data;
	GDBusMethodInvocation* invocation;
	GError* error = NULL;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	gchar** result;
	gint result_length1 = 0;
	gchar** _tmp10_;
	GVariantBuilder _tmp11_;
	gint _tmp12_;
	_ready_data = _user_data_;
	invocation = _ready_data->_invocation_;
	result = app_center_dbus_search_components_finish ((AppCenterDBus*) source_object, _res_, &result_length1, &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);
	_tmp10_ = result;
	g_variant_builder_init (&_tmp11_, G_VARIANT_TYPE ("as"));
	for (_tmp12_ = 0; _tmp12_ < result_length1; _tmp12_++) {
		g_variant_builder_add_value (&_tmp11_, g_variant_new_string (*_tmp10_));
		_tmp10_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp11_));
	result = (_vala_array_free (result, result_length1, (GDestroyNotify) g_free), NULL);
	_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_free0 (_ready_data->query);
	g_slice_free (AppCenterDbusSearchComponentsReadyData, _ready_data);
}

static void
app_center_dbus_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, "Install") == 0) {
		_dbus_app_center_dbus_install (object, parameters, invocation);
	} else if (strcmp (method_name, "Update") == 0) {
		_dbus_app_center_dbus_update (object, parameters, invocation);
	} else if (strcmp (method_name, "Uninstall") == 0) {
		_dbus_app_center_dbus_uninstall (object, parameters, invocation);
	} else if (strcmp (method_name, "GetComponentFromDesktopId") == 0) {
		_dbus_app_center_dbus_get_component_from_desktop_id (object, parameters, invocation);
	} else if (strcmp (method_name, "SearchComponents") == 0) {
		_dbus_app_center_dbus_search_components (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
app_center_dbus_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
app_center_dbus_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;
}

guint
app_center_dbus_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 *) (&_app_center_dbus_dbus_interface_info), &_app_center_dbus_dbus_interface_vtable, data, _app_center_dbus_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_app_center_dbus_unregister_object (gpointer user_data)
{
	gpointer* data;
	data = user_data;
	g_object_unref (data[0]);
	g_object_unref (data[1]);
	g_free (data[2]);
	g_free (data);
}

static inline gpointer
slingshot_backend_app_center_get_instance_private (SlingshotBackendAppCenter* self)
{
	return G_STRUCT_MEMBER_P (self, SlingshotBackendAppCenter_private_offset);
}

SlingshotBackendAppCenter*
slingshot_backend_app_center_get_default (void)
{
	SlingshotBackendAppCenter* _tmp0_;
	SlingshotBackendAppCenter* _tmp2_;
	SlingshotBackendAppCenter* result;
	_tmp0_ = slingshot_backend_app_center_instance;
	if (_tmp0_ == NULL) {
		SlingshotBackendAppCenter* _tmp1_;
		_tmp1_ = slingshot_backend_app_center_new ();
		_g_object_unref0 (slingshot_backend_app_center_instance);
		slingshot_backend_app_center_instance = _tmp1_;
	}
	_tmp2_ = slingshot_backend_app_center_instance;
	result = _tmp2_;
	return result;
}

static SlingshotBackendAppCenter*
slingshot_backend_app_center_construct (GType object_type)
{
	SlingshotBackendAppCenter * self = NULL;
	self = (SlingshotBackendAppCenter*) g_object_new (object_type, NULL);
	return self;
}

static SlingshotBackendAppCenter*
slingshot_backend_app_center_new (void)
{
	return slingshot_backend_app_center_construct (SLINGSHOT_BACKEND_TYPE_APP_CENTER);
}

static gboolean
___lambda120_ (SlingshotBackendAppCenter* self)
{
	gboolean result;
	slingshot_backend_app_center_try_connect (self);
	result = FALSE;
	return result;
}

static gboolean
____lambda120__gsource_func (gpointer self)
{
	gboolean result;
	result = ___lambda120_ ((SlingshotBackendAppCenter*) self);
	return result;
}

static void
__lambda119_ (SlingshotBackendAppCenter* self,
              GObject* obj,
              GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		AppCenterDBus* _tmp0_ = NULL;
		AppCenterDBus* _tmp1_;
		AppCenterDBus* _tmp2_;
		_tmp1_ = g_async_result_get_source_object (res);
		_tmp2_ = (AppCenterDBus*) g_async_initable_new_finish ((GAsyncInitable *) _tmp1_, res, &_inner_error0_);
		g_object_unref (_tmp1_);
		_tmp0_ = (AppCenterDBus*) _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		slingshot_backend_app_center_set_dbus (self, _tmp0_);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		g_warning ("AppCenter.vala:59: %s", _tmp4_);
		g_timeout_add_full (G_PRIORITY_DEFAULT, SLINGSHOT_BACKEND_APP_CENTER_RECONNECT_TIMEOUT, ____lambda120__gsource_func, g_object_ref (self), g_object_unref);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		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;
	}
}

static void
___lambda119__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda119_ ((SlingshotBackendAppCenter*) self, source_object, res);
	g_object_unref (self);
}

static void
slingshot_backend_app_center_try_connect (SlingshotBackendAppCenter* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_async_initable_new_async (TYPE_APP_CENTER_DBUS_PROXY, 0, NULL, ___lambda119__gasync_ready_callback, g_object_ref (self), "g-flags", 0, "g-name", SLINGSHOT_BACKEND_APP_CENTER_DBUS_NAME, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", SLINGSHOT_BACKEND_APP_CENTER_DBUS_PATH, "g-interface-name", "io.elementary.appcenter", NULL);
}

static void
slingshot_backend_app_center_name_vanished_callback (SlingshotBackendAppCenter* self,
                                                     GDBusConnection* connection,
                                                     const gchar* name)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (name != NULL);
	slingshot_backend_app_center_set_dbus (self, NULL);
}

AppCenterDBus*
slingshot_backend_app_center_get_dbus (SlingshotBackendAppCenter* self)
{
	AppCenterDBus* result;
	AppCenterDBus* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_dbus;
	result = _tmp0_;
	return result;
}

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

static void
slingshot_backend_app_center_set_dbus (SlingshotBackendAppCenter* self,
                                       AppCenterDBus* value)
{
	AppCenterDBus* old_value;
	g_return_if_fail (self != NULL);
	old_value = slingshot_backend_app_center_get_dbus (self);
	if (old_value != value) {
		AppCenterDBus* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_dbus);
		self->priv->_dbus = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, slingshot_backend_app_center_properties[SLINGSHOT_BACKEND_APP_CENTER_DBUS_PROPERTY]);
	}
}

static void
_slingshot_backend_app_center___lambda121_ (SlingshotBackendAppCenter* self)
{
	slingshot_backend_app_center_try_connect (self);
}

static void
__slingshot_backend_app_center___lambda121__gbus_name_appeared_callback (GDBusConnection* connection,
                                                                         const gchar* name,
                                                                         const gchar* name_owner,
                                                                         gpointer self)
{
	_slingshot_backend_app_center___lambda121_ ((SlingshotBackendAppCenter*) self);
}

static void
_slingshot_backend_app_center_name_vanished_callback_gbus_name_vanished_callback (GDBusConnection* connection,
                                                                                  const gchar* name,
                                                                                  gpointer self)
{
	slingshot_backend_app_center_name_vanished_callback ((SlingshotBackendAppCenter*) self, connection, name);
}

static GObject *
slingshot_backend_app_center_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	SlingshotBackendAppCenter * self;
	parent_class = G_OBJECT_CLASS (slingshot_backend_app_center_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_BACKEND_TYPE_APP_CENTER, SlingshotBackendAppCenter);
	g_bus_watch_name_with_closures (G_BUS_TYPE_SESSION, SLINGSHOT_BACKEND_APP_CENTER_DBUS_NAME, G_BUS_NAME_WATCHER_FLAGS_AUTO_START, (GClosure*) ((__slingshot_backend_app_center___lambda121__gbus_name_appeared_callback == NULL) ? NULL : g_cclosure_new ((GCallback) __slingshot_backend_app_center___lambda121__gbus_name_appeared_callback, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((_slingshot_backend_app_center_name_vanished_callback_gbus_name_vanished_callback == NULL) ? NULL : g_cclosure_new ((GCallback) _slingshot_backend_app_center_name_vanished_callback_gbus_name_vanished_callback, g_object_ref (self), (GClosureNotify) g_object_unref)));
	return obj;
}

static void
slingshot_backend_app_center_class_init (SlingshotBackendAppCenterClass * klass,
                                         gpointer klass_data)
{
	slingshot_backend_app_center_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &SlingshotBackendAppCenter_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_slingshot_backend_app_center_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_slingshot_backend_app_center_set_property;
	G_OBJECT_CLASS (klass)->constructor = slingshot_backend_app_center_constructor;
	G_OBJECT_CLASS (klass)->finalize = slingshot_backend_app_center_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), SLINGSHOT_BACKEND_APP_CENTER_DBUS_PROPERTY, slingshot_backend_app_center_properties[SLINGSHOT_BACKEND_APP_CENTER_DBUS_PROPERTY] = g_param_spec_object ("dbus", "dbus", "dbus", TYPE_APP_CENTER_DBUS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
slingshot_backend_app_center_instance_init (SlingshotBackendAppCenter * self,
                                            gpointer klass)
{
	self->priv = slingshot_backend_app_center_get_instance_private (self);
	self->priv->_dbus = NULL;
}

static void
slingshot_backend_app_center_finalize (GObject * obj)
{
	SlingshotBackendAppCenter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SLINGSHOT_BACKEND_TYPE_APP_CENTER, SlingshotBackendAppCenter);
	_g_object_unref0 (self->priv->_dbus);
	G_OBJECT_CLASS (slingshot_backend_app_center_parent_class)->finalize (obj);
}

GType
slingshot_backend_app_center_get_type (void)
{
	return slingshot_backend_app_center_type_id;
}

GType
slingshot_backend_app_center_register_type (GTypeModule * module)
{
	static const GTypeInfo g_define_type_info = { sizeof (SlingshotBackendAppCenterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) slingshot_backend_app_center_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (SlingshotBackendAppCenter), 0, (GInstanceInitFunc) slingshot_backend_app_center_instance_init, NULL };
	slingshot_backend_app_center_type_id = g_type_module_register_type (module, G_TYPE_OBJECT, "SlingshotBackendAppCenter", &g_define_type_info, 0);
	SlingshotBackendAppCenter_private_offset = sizeof (SlingshotBackendAppCenterPrivate);
	return slingshot_backend_app_center_type_id;
}

static void
_vala_slingshot_backend_app_center_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	SlingshotBackendAppCenter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SLINGSHOT_BACKEND_TYPE_APP_CENTER, SlingshotBackendAppCenter);
	switch (property_id) {
		case SLINGSHOT_BACKEND_APP_CENTER_DBUS_PROPERTY:
		g_value_set_object (value, slingshot_backend_app_center_get_dbus (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_slingshot_backend_app_center_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec)
{
	SlingshotBackendAppCenter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, SLINGSHOT_BACKEND_TYPE_APP_CENTER, SlingshotBackendAppCenter);
	switch (property_id) {
		case SLINGSHOT_BACKEND_APP_CENTER_DBUS_PROPERTY:
		slingshot_backend_app_center_set_dbus (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);
}

