/* SharingDBusInterface.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from SharingDBusInterface.vala, do not modify */

/*
 * Copyright (c) 2011-2015 elementary Developers (https://launchpad.net/elementary)
 *
 * 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 "io.elementary.settings.sharing.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gio/gio.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))
typedef GDBusProxy SharingBackendSharingDBusInterfaceProxy;
typedef GDBusProxyClass SharingBackendSharingDBusInterfaceProxyClass;

static GType sharing_backend_sharing_dbus_interface_get_type_once (void);
static void sharing_backend_sharing_dbus_interface_proxy_g_signal (GDBusProxy* proxy,
                                                            const gchar* sender_name,
                                                            const gchar* signal_name,
                                                            GVariant* parameters);
static void sharing_backend_sharing_dbus_interface_proxy_enable_service (SharingBackendSharingDBusInterface* self,
                                                                  const gchar* service_name,
                                                                  GError** error);
static void sharing_backend_sharing_dbus_interface_proxy_disable_service (SharingBackendSharingDBusInterface* self,
                                                                   const gchar* service_name,
                                                                   const gchar* network,
                                                                   GError** error);
static SharingBackendSharingDBusInterfaceSharingNetwork* sharing_backend_sharing_dbus_interface_proxy_list_networks (SharingBackendSharingDBusInterface* self,
                                                                                                              const gchar* service_name,
                                                                                                              gint* result_length1,
                                                                                                              GError** error);
static gchar* sharing_backend_sharing_dbus_interface_dbus_proxy_get_current_network (SharingBackendSharingDBusInterface* self);
static void sharing_backend_sharing_dbus_interface_proxy_sharing_backend_sharing_dbus_interface_interface_init (SharingBackendSharingDBusInterfaceIface* iface);
static void _dbus_sharing_backend_sharing_dbus_interface_enable_service (SharingBackendSharingDBusInterface* self,
                                                                  GVariant* _parameters_,
                                                                  GDBusMethodInvocation* invocation);
static void _dbus_sharing_backend_sharing_dbus_interface_disable_service (SharingBackendSharingDBusInterface* self,
                                                                   GVariant* _parameters_,
                                                                   GDBusMethodInvocation* invocation);
static void _vala_SharingBackendSharingDBusInterfaceSharingNetwork_array_free (SharingBackendSharingDBusInterfaceSharingNetwork * array,
                                                                        gssize array_length);
static void _dbus_sharing_backend_sharing_dbus_interface_list_networks (SharingBackendSharingDBusInterface* self,
                                                                 GVariant* _parameters_,
                                                                 GDBusMethodInvocation* invocation);
static void sharing_backend_sharing_dbus_interface_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* sharing_backend_sharing_dbus_interface_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 GVariant* _dbus_sharing_backend_sharing_dbus_interface_get_current_network (SharingBackendSharingDBusInterface* self);
static gboolean sharing_backend_sharing_dbus_interface_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 _sharing_backend_sharing_dbus_interface_unregister_object (gpointer user_data);

static const GDBusArgInfo _sharing_backend_sharing_dbus_interface_dbus_arg_info_enable_service_service_name = {-1, "service_name", "s", NULL};
static const GDBusArgInfo * const _sharing_backend_sharing_dbus_interface_dbus_arg_info_enable_service_in[] = {&_sharing_backend_sharing_dbus_interface_dbus_arg_info_enable_service_service_name, NULL};
static const GDBusArgInfo * const _sharing_backend_sharing_dbus_interface_dbus_arg_info_enable_service_out[] = {NULL};
static const GDBusMethodInfo _sharing_backend_sharing_dbus_interface_dbus_method_info_enable_service = {-1, "EnableService", (GDBusArgInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_arg_info_enable_service_in), (GDBusArgInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_arg_info_enable_service_out), NULL};
static const GDBusArgInfo _sharing_backend_sharing_dbus_interface_dbus_arg_info_disable_service_service_name = {-1, "service_name", "s", NULL};
static const GDBusArgInfo _sharing_backend_sharing_dbus_interface_dbus_arg_info_disable_service_network = {-1, "network", "s", NULL};
static const GDBusArgInfo * const _sharing_backend_sharing_dbus_interface_dbus_arg_info_disable_service_in[] = {&_sharing_backend_sharing_dbus_interface_dbus_arg_info_disable_service_service_name, &_sharing_backend_sharing_dbus_interface_dbus_arg_info_disable_service_network, NULL};
static const GDBusArgInfo * const _sharing_backend_sharing_dbus_interface_dbus_arg_info_disable_service_out[] = {NULL};
static const GDBusMethodInfo _sharing_backend_sharing_dbus_interface_dbus_method_info_disable_service = {-1, "DisableService", (GDBusArgInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_arg_info_disable_service_in), (GDBusArgInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_arg_info_disable_service_out), NULL};
static const GDBusArgInfo _sharing_backend_sharing_dbus_interface_dbus_arg_info_list_networks_service_name = {-1, "service_name", "s", NULL};
static const GDBusArgInfo _sharing_backend_sharing_dbus_interface_dbus_arg_info_list_networks_result = {-1, "result", "a(sss)", NULL};
static const GDBusArgInfo * const _sharing_backend_sharing_dbus_interface_dbus_arg_info_list_networks_in[] = {&_sharing_backend_sharing_dbus_interface_dbus_arg_info_list_networks_service_name, NULL};
static const GDBusArgInfo * const _sharing_backend_sharing_dbus_interface_dbus_arg_info_list_networks_out[] = {&_sharing_backend_sharing_dbus_interface_dbus_arg_info_list_networks_result, NULL};
static const GDBusMethodInfo _sharing_backend_sharing_dbus_interface_dbus_method_info_list_networks = {-1, "ListNetworks", (GDBusArgInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_arg_info_list_networks_in), (GDBusArgInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_arg_info_list_networks_out), NULL};
static const GDBusMethodInfo * const _sharing_backend_sharing_dbus_interface_dbus_method_info[] = {&_sharing_backend_sharing_dbus_interface_dbus_method_info_enable_service, &_sharing_backend_sharing_dbus_interface_dbus_method_info_disable_service, &_sharing_backend_sharing_dbus_interface_dbus_method_info_list_networks, NULL};
static const GDBusSignalInfo * const _sharing_backend_sharing_dbus_interface_dbus_signal_info[] = {NULL};
static const GDBusPropertyInfo _sharing_backend_sharing_dbus_interface_dbus_property_info_current_network = {-1, "CurrentNetwork", "s", G_DBUS_PROPERTY_INFO_FLAGS_READABLE, NULL};
static const GDBusPropertyInfo * const _sharing_backend_sharing_dbus_interface_dbus_property_info[] = {&_sharing_backend_sharing_dbus_interface_dbus_property_info_current_network, NULL};
static const GDBusInterfaceInfo _sharing_backend_sharing_dbus_interface_dbus_interface_info = {-1, "org.gnome.SettingsDaemon.Sharing", (GDBusMethodInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_method_info), (GDBusSignalInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_signal_info), (GDBusPropertyInfo **) (&_sharing_backend_sharing_dbus_interface_dbus_property_info), NULL};
static const GDBusInterfaceVTable _sharing_backend_sharing_dbus_interface_dbus_interface_vtable = {sharing_backend_sharing_dbus_interface_dbus_interface_method_call, sharing_backend_sharing_dbus_interface_dbus_interface_get_property, sharing_backend_sharing_dbus_interface_dbus_interface_set_property};

void
sharing_backend_sharing_dbus_interface_enable_service (SharingBackendSharingDBusInterface* self,
                                                       const gchar* service_name,
                                                       GError** error)
{
	SharingBackendSharingDBusInterfaceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = SHARING_BACKEND_SHARING_DBUS_INTERFACE_GET_INTERFACE (self);
	if (_iface_->enable_service) {
		_iface_->enable_service (self, service_name, error);
	}
}

void
sharing_backend_sharing_dbus_interface_disable_service (SharingBackendSharingDBusInterface* self,
                                                        const gchar* service_name,
                                                        const gchar* network,
                                                        GError** error)
{
	SharingBackendSharingDBusInterfaceIface* _iface_;
	g_return_if_fail (self != NULL);
	_iface_ = SHARING_BACKEND_SHARING_DBUS_INTERFACE_GET_INTERFACE (self);
	if (_iface_->disable_service) {
		_iface_->disable_service (self, service_name, network, error);
	}
}

SharingBackendSharingDBusInterfaceSharingNetwork*
sharing_backend_sharing_dbus_interface_list_networks (SharingBackendSharingDBusInterface* self,
                                                      const gchar* service_name,
                                                      gint* result_length1,
                                                      GError** error)
{
	SharingBackendSharingDBusInterfaceIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = SHARING_BACKEND_SHARING_DBUS_INTERFACE_GET_INTERFACE (self);
	if (_iface_->list_networks) {
		return _iface_->list_networks (self, service_name, result_length1, error);
	}
	return NULL;
}

gchar*
sharing_backend_sharing_dbus_interface_get_current_network (SharingBackendSharingDBusInterface* self)
{
	SharingBackendSharingDBusInterfaceIface* _iface_;
	g_return_val_if_fail (self != NULL, NULL);
	_iface_ = SHARING_BACKEND_SHARING_DBUS_INTERFACE_GET_INTERFACE (self);
	if (_iface_->get_current_network) {
		return _iface_->get_current_network (self);
	}
	return NULL;
}

void
sharing_backend_sharing_dbus_interface_sharing_network_copy (const SharingBackendSharingDBusInterfaceSharingNetwork* self,
                                                             SharingBackendSharingDBusInterfaceSharingNetwork* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	_tmp0_ = (*self).uuid;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).uuid);
	(*dest).uuid = _tmp1_;
	_tmp2_ = (*self).network_name;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).network_name);
	(*dest).network_name = _tmp3_;
	_tmp4_ = (*self).carrier_type;
	_tmp5_ = g_strdup (_tmp4_);
	_g_free0 ((*dest).carrier_type);
	(*dest).carrier_type = _tmp5_;
}

void
sharing_backend_sharing_dbus_interface_sharing_network_destroy (SharingBackendSharingDBusInterfaceSharingNetwork* self)
{
	_g_free0 ((*self).uuid);
	_g_free0 ((*self).network_name);
	_g_free0 ((*self).carrier_type);
}

SharingBackendSharingDBusInterfaceSharingNetwork*
sharing_backend_sharing_dbus_interface_sharing_network_dup (const SharingBackendSharingDBusInterfaceSharingNetwork* self)
{
	SharingBackendSharingDBusInterfaceSharingNetwork* dup;
	dup = g_new0 (SharingBackendSharingDBusInterfaceSharingNetwork, 1);
	sharing_backend_sharing_dbus_interface_sharing_network_copy (self, dup);
	return dup;
}

void
sharing_backend_sharing_dbus_interface_sharing_network_free (SharingBackendSharingDBusInterfaceSharingNetwork* self)
{
	sharing_backend_sharing_dbus_interface_sharing_network_destroy (self);
	g_free (self);
}

static GType
sharing_backend_sharing_dbus_interface_sharing_network_get_type_once (void)
{
	GType sharing_backend_sharing_dbus_interface_sharing_network_type_id;
	sharing_backend_sharing_dbus_interface_sharing_network_type_id = g_boxed_type_register_static ("SharingBackendSharingDBusInterfaceSharingNetwork", (GBoxedCopyFunc) sharing_backend_sharing_dbus_interface_sharing_network_dup, (GBoxedFreeFunc) sharing_backend_sharing_dbus_interface_sharing_network_free);
	return sharing_backend_sharing_dbus_interface_sharing_network_type_id;
}

GType
sharing_backend_sharing_dbus_interface_sharing_network_get_type (void)
{
	static volatile gsize sharing_backend_sharing_dbus_interface_sharing_network_type_id__once = 0;
	if (g_once_init_enter (&sharing_backend_sharing_dbus_interface_sharing_network_type_id__once)) {
		GType sharing_backend_sharing_dbus_interface_sharing_network_type_id;
		sharing_backend_sharing_dbus_interface_sharing_network_type_id = sharing_backend_sharing_dbus_interface_sharing_network_get_type_once ();
		g_once_init_leave (&sharing_backend_sharing_dbus_interface_sharing_network_type_id__once, sharing_backend_sharing_dbus_interface_sharing_network_type_id);
	}
	return sharing_backend_sharing_dbus_interface_sharing_network_type_id__once;
}

static void
sharing_backend_sharing_dbus_interface_default_init (SharingBackendSharingDBusInterfaceIface * iface,
                                                     gpointer iface_data)
{
}

static GType
sharing_backend_sharing_dbus_interface_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (SharingBackendSharingDBusInterfaceIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) sharing_backend_sharing_dbus_interface_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
	GType sharing_backend_sharing_dbus_interface_type_id;
	sharing_backend_sharing_dbus_interface_type_id = g_type_register_static (G_TYPE_INTERFACE, "SharingBackendSharingDBusInterface", &g_define_type_info, 0);
	g_type_interface_add_prerequisite (sharing_backend_sharing_dbus_interface_type_id, G_TYPE_OBJECT);
	g_type_set_qdata (sharing_backend_sharing_dbus_interface_type_id, g_quark_from_static_string ("vala-dbus-proxy-type"), (void*) sharing_backend_sharing_dbus_interface_proxy_get_type);
	g_type_set_qdata (sharing_backend_sharing_dbus_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-name"), "org.gnome.SettingsDaemon.Sharing");
	g_type_set_qdata (sharing_backend_sharing_dbus_interface_type_id, g_quark_from_static_string ("vala-dbus-interface-info"), (void*) (&_sharing_backend_sharing_dbus_interface_dbus_interface_info));
	g_type_set_qdata (sharing_backend_sharing_dbus_interface_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) sharing_backend_sharing_dbus_interface_register_object);
	return sharing_backend_sharing_dbus_interface_type_id;
}

GType
sharing_backend_sharing_dbus_interface_get_type (void)
{
	static volatile gsize sharing_backend_sharing_dbus_interface_type_id__once = 0;
	if (g_once_init_enter (&sharing_backend_sharing_dbus_interface_type_id__once)) {
		GType sharing_backend_sharing_dbus_interface_type_id;
		sharing_backend_sharing_dbus_interface_type_id = sharing_backend_sharing_dbus_interface_get_type_once ();
		g_once_init_leave (&sharing_backend_sharing_dbus_interface_type_id__once, sharing_backend_sharing_dbus_interface_type_id);
	}
	return sharing_backend_sharing_dbus_interface_type_id__once;
}

G_DEFINE_TYPE_EXTENDED (SharingBackendSharingDBusInterfaceProxy, sharing_backend_sharing_dbus_interface_proxy, G_TYPE_DBUS_PROXY, 0, G_IMPLEMENT_INTERFACE (SHARING_BACKEND_TYPE_SHARING_DBUS_INTERFACE, sharing_backend_sharing_dbus_interface_proxy_sharing_backend_sharing_dbus_interface_interface_init) )
static void
sharing_backend_sharing_dbus_interface_proxy_class_init (SharingBackendSharingDBusInterfaceProxyClass* klass)
{
	G_DBUS_PROXY_CLASS (klass)->g_signal = sharing_backend_sharing_dbus_interface_proxy_g_signal;
}

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

static void
sharing_backend_sharing_dbus_interface_proxy_init (SharingBackendSharingDBusInterfaceProxy* self)
{
	g_dbus_proxy_set_interface_info (G_DBUS_PROXY (self), (GDBusInterfaceInfo *) (&_sharing_backend_sharing_dbus_interface_dbus_interface_info));
}

static void
sharing_backend_sharing_dbus_interface_proxy_enable_service (SharingBackendSharingDBusInterface* self,
                                                             const gchar* service_name,
                                                             GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.SettingsDaemon.Sharing", "EnableService");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (service_name));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	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
sharing_backend_sharing_dbus_interface_proxy_disable_service (SharingBackendSharingDBusInterface* self,
                                                              const gchar* service_name,
                                                              const gchar* network,
                                                              GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.SettingsDaemon.Sharing", "DisableService");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (service_name));
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (network));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	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 SharingBackendSharingDBusInterfaceSharingNetwork*
sharing_backend_sharing_dbus_interface_proxy_list_networks (SharingBackendSharingDBusInterface* self,
                                                            const gchar* service_name,
                                                            gint* result_length1,
                                                            GError** error)
{
	GDBusMessage *_message;
	GVariant *_arguments;
	GVariantBuilder _arguments_builder;
	GDBusMessage *_reply_message;
	GVariant *_reply;
	GVariantIter _reply_iter;
	SharingBackendSharingDBusInterfaceSharingNetwork* _result = NULL;
	gint _result_length1;
	GVariant* _tmp0_;
	SharingBackendSharingDBusInterfaceSharingNetwork* _tmp1_;
	gint _tmp1__length;
	gint _tmp1__size;
	gint _tmp1__length1;
	GVariantIter _tmp2_;
	GVariant* _tmp3_;
	_message = g_dbus_message_new_method_call (g_dbus_proxy_get_name ((GDBusProxy *) self), g_dbus_proxy_get_object_path ((GDBusProxy *) self), "org.gnome.SettingsDaemon.Sharing", "ListNetworks");
	g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
	g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (service_name));
	_arguments = g_variant_builder_end (&_arguments_builder);
	g_dbus_message_set_body (_message, _arguments);
	_reply_message = g_dbus_connection_send_message_with_reply_sync (g_dbus_proxy_get_connection ((GDBusProxy *) self), _message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, g_dbus_proxy_get_default_timeout ((GDBusProxy *) self), NULL, NULL, error);
	g_object_unref (_message);
	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;
	_tmp0_ = g_variant_iter_next_value (&_reply_iter);
	_tmp1_ = g_new (SharingBackendSharingDBusInterfaceSharingNetwork, 5);
	_tmp1__length = 0;
	_tmp1__size = 4;
	_tmp1__length1 = 0;
	g_variant_iter_init (&_tmp2_, _tmp0_);
	for (; (_tmp3_ = g_variant_iter_next_value (&_tmp2_)) != NULL; _tmp1__length1++) {
		SharingBackendSharingDBusInterfaceSharingNetwork _tmp4_;
		GVariantIter _tmp5_;
		GVariant* _tmp6_;
		GVariant* _tmp7_;
		GVariant* _tmp8_;
		if (_tmp1__size == _tmp1__length) {
			_tmp1__size = 2 * _tmp1__size;
			_tmp1_ = g_renew (SharingBackendSharingDBusInterfaceSharingNetwork, _tmp1_, _tmp1__size + 1);
		}
		g_variant_iter_init (&_tmp5_, _tmp3_);
		_tmp6_ = g_variant_iter_next_value (&_tmp5_);
		_tmp4_.uuid = g_variant_dup_string (_tmp6_, NULL);
		g_variant_unref (_tmp6_);
		_tmp7_ = g_variant_iter_next_value (&_tmp5_);
		_tmp4_.network_name = g_variant_dup_string (_tmp7_, NULL);
		g_variant_unref (_tmp7_);
		_tmp8_ = g_variant_iter_next_value (&_tmp5_);
		_tmp4_.carrier_type = g_variant_dup_string (_tmp8_, NULL);
		g_variant_unref (_tmp8_);
		_tmp1_[_tmp1__length++] = _tmp4_;
		g_variant_unref (_tmp3_);
	}
	_result_length1 = _tmp1__length1;
	_result = _tmp1_;
	g_variant_unref (_tmp0_);
	*result_length1 = _result_length1;
	g_object_unref (_reply_message);
	return _result;
}

static gchar*
sharing_backend_sharing_dbus_interface_dbus_proxy_get_current_network (SharingBackendSharingDBusInterface* self)
{
	GVariant *_inner_reply;
	gchar* _result;
	_inner_reply = g_dbus_proxy_get_cached_property ((GDBusProxy *) self, "CurrentNetwork");
	if (!_inner_reply) {
		GVariant *_arguments;
		GVariant *_reply;
		GVariantBuilder _arguments_builder;
		g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("org.gnome.SettingsDaemon.Sharing"));
		g_variant_builder_add_value (&_arguments_builder, g_variant_new_string ("CurrentNetwork"));
		_arguments = g_variant_builder_end (&_arguments_builder);
		_reply = g_dbus_proxy_call_sync ((GDBusProxy *) self, "org.freedesktop.DBus.Properties.Get", _arguments, G_DBUS_CALL_FLAGS_NONE, -1, NULL, NULL);
		if (!_reply) {
			return NULL;
		}
		g_variant_get (_reply, "(v)", &_inner_reply);
		g_variant_unref (_reply);
	}
	_result = g_variant_dup_string (_inner_reply, NULL);
	g_variant_unref (_inner_reply);
	return _result;
}

static void
sharing_backend_sharing_dbus_interface_proxy_sharing_backend_sharing_dbus_interface_interface_init (SharingBackendSharingDBusInterfaceIface* iface)
{
	iface->enable_service = sharing_backend_sharing_dbus_interface_proxy_enable_service;
	iface->disable_service = sharing_backend_sharing_dbus_interface_proxy_disable_service;
	iface->list_networks = sharing_backend_sharing_dbus_interface_proxy_list_networks;
	iface->get_current_network = sharing_backend_sharing_dbus_interface_dbus_proxy_get_current_network;
}

static void
_dbus_sharing_backend_sharing_dbus_interface_enable_service (SharingBackendSharingDBusInterface* self,
                                                             GVariant* _parameters_,
                                                             GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* service_name = NULL;
	GVariant* _tmp9_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp9_ = g_variant_iter_next_value (&_arguments_iter);
	service_name = g_variant_dup_string (_tmp9_, NULL);
	g_variant_unref (_tmp9_);
	sharing_backend_sharing_dbus_interface_enable_service (self, service_name, &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 (service_name);
	;
}

static void
_dbus_sharing_backend_sharing_dbus_interface_disable_service (SharingBackendSharingDBusInterface* self,
                                                              GVariant* _parameters_,
                                                              GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* service_name = NULL;
	GVariant* _tmp10_;
	gchar* network = NULL;
	GVariant* _tmp11_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp10_ = g_variant_iter_next_value (&_arguments_iter);
	service_name = g_variant_dup_string (_tmp10_, NULL);
	g_variant_unref (_tmp10_);
	_tmp11_ = g_variant_iter_next_value (&_arguments_iter);
	network = g_variant_dup_string (_tmp11_, NULL);
	g_variant_unref (_tmp11_);
	sharing_backend_sharing_dbus_interface_disable_service (self, service_name, network, &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 (service_name);
	_g_free0 (network);
	;
}

static void
_vala_SharingBackendSharingDBusInterfaceSharingNetwork_array_free (SharingBackendSharingDBusInterfaceSharingNetwork * array,
                                                                   gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			sharing_backend_sharing_dbus_interface_sharing_network_destroy (&array[i]);
		}
	}
	g_free (array);
}

static void
_dbus_sharing_backend_sharing_dbus_interface_list_networks (SharingBackendSharingDBusInterface* self,
                                                            GVariant* _parameters_,
                                                            GDBusMethodInvocation* invocation)
{
	GError* error = NULL;
	GVariantIter _arguments_iter;
	gchar* service_name = NULL;
	GVariant* _tmp12_;
	GDBusMessage* _reply_message = NULL;
	GVariant* _reply;
	GVariantBuilder _reply_builder;
	SharingBackendSharingDBusInterfaceSharingNetwork* result;
	gint result_length1 = 0;
	SharingBackendSharingDBusInterfaceSharingNetwork* _tmp13_;
	GVariantBuilder _tmp14_;
	gint _tmp15_;
	g_variant_iter_init (&_arguments_iter, _parameters_);
	_tmp12_ = g_variant_iter_next_value (&_arguments_iter);
	service_name = g_variant_dup_string (_tmp12_, NULL);
	g_variant_unref (_tmp12_);
	result = sharing_backend_sharing_dbus_interface_list_networks (self, service_name, &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);
	_tmp13_ = result;
	g_variant_builder_init (&_tmp14_, G_VARIANT_TYPE ("a(sss)"));
	for (_tmp15_ = 0; _tmp15_ < result_length1; _tmp15_++) {
		GVariantBuilder _tmp16_;
		g_variant_builder_init (&_tmp16_, G_VARIANT_TYPE_TUPLE);
		g_variant_builder_add_value (&_tmp16_, g_variant_new_string ((*_tmp13_).uuid));
		g_variant_builder_add_value (&_tmp16_, g_variant_new_string ((*_tmp13_).network_name));
		g_variant_builder_add_value (&_tmp16_, g_variant_new_string ((*_tmp13_).carrier_type));
		g_variant_builder_add_value (&_tmp14_, g_variant_builder_end (&_tmp16_));
		_tmp13_++;
	}
	g_variant_builder_add_value (&_reply_builder, g_variant_builder_end (&_tmp14_));
	result = (_vala_SharingBackendSharingDBusInterfaceSharingNetwork_array_free (result, result_length1), 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 (service_name);
	;
}

static void
sharing_backend_sharing_dbus_interface_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, "EnableService") == 0) {
		_dbus_sharing_backend_sharing_dbus_interface_enable_service (object, parameters, invocation);
	} else if (strcmp (method_name, "DisableService") == 0) {
		_dbus_sharing_backend_sharing_dbus_interface_disable_service (object, parameters, invocation);
	} else if (strcmp (method_name, "ListNetworks") == 0) {
		_dbus_sharing_backend_sharing_dbus_interface_list_networks (object, parameters, invocation);
	} else {
		g_object_unref (invocation);
	}
}

static GVariant*
_dbus_sharing_backend_sharing_dbus_interface_get_current_network (SharingBackendSharingDBusInterface* self)
{
	gchar* result;
	GVariant* _reply;
	result = sharing_backend_sharing_dbus_interface_get_current_network (self);
	_reply = g_variant_new_string (result);
	_g_free0 (result);
	return _reply;
}

static GVariant*
sharing_backend_sharing_dbus_interface_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)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	if (strcmp (property_name, "CurrentNetwork") == 0) {
		return _dbus_sharing_backend_sharing_dbus_interface_get_current_network (object);
	}
	return NULL;
}

static gboolean
sharing_backend_sharing_dbus_interface_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)
{
	gpointer* data;
	gpointer object;
	data = user_data;
	object = data[0];
	return FALSE;
}

guint
sharing_backend_sharing_dbus_interface_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 *) (&_sharing_backend_sharing_dbus_interface_dbus_interface_info), &_sharing_backend_sharing_dbus_interface_dbus_interface_vtable, data, _sharing_backend_sharing_dbus_interface_unregister_object, error);
	if (!result) {
		return 0;
	}
	return result;
}

static void
_sharing_backend_sharing_dbus_interface_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);
}

