/* ovirt-broker.c generated by valac 0.37.1.4-3591e, the Vala compiler
 * generated from ovirt-broker.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <libcommon.h>
#include <stdlib.h>
#include <string.h>
#include <govirt/govirt.h>
#include <gtk/gtk.h>
#include <rest/rest-proxy.h>
#include <rest/oauth-proxy-call.h>
#include <rest/oauth-proxy.h>
#include <rest/oauth2-proxy-call.h>
#include <rest/oauth2-proxy.h>
#include <rest/rest-enum-types.h>
#include <rest/rest-param.h>
#include <rest/rest-params.h>
#include <rest/rest-proxy-auth.h>
#include <rest/rest-proxy-call.h>
#include <rest/rest-xml-node.h>
#include <rest/rest-xml-parser.h>
#include <glib/gi18n-lib.h>


#define BOXES_TYPE_BROKER (boxes_broker_get_type ())
#define BOXES_BROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_BROKER, BoxesBroker))
#define BOXES_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_BROKER, BoxesBrokerClass))
#define BOXES_IS_BROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_BROKER))
#define BOXES_IS_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_BROKER))
#define BOXES_BROKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_BROKER, BoxesBrokerClass))

typedef struct _BoxesBroker BoxesBroker;
typedef struct _BoxesBrokerClass BoxesBrokerClass;
typedef struct _BoxesBrokerPrivate BoxesBrokerPrivate;

#define BOXES_TYPE_OVIRT_BROKER (boxes_ovirt_broker_get_type ())
#define BOXES_OVIRT_BROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBroker))
#define BOXES_OVIRT_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBrokerClass))
#define BOXES_IS_OVIRT_BROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_OVIRT_BROKER))
#define BOXES_IS_OVIRT_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_OVIRT_BROKER))
#define BOXES_OVIRT_BROKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBrokerClass))

typedef struct _BoxesOvirtBroker BoxesOvirtBroker;
typedef struct _BoxesOvirtBrokerClass BoxesOvirtBrokerClass;
typedef struct _BoxesOvirtBrokerPrivate BoxesOvirtBrokerPrivate;
enum  {
	BOXES_OVIRT_BROKER_DUMMY_PROPERTY,
	BOXES_OVIRT_BROKER_LAST_PROPERTY
};
static GParamSpec* boxes_ovirt_broker_properties[BOXES_OVIRT_BROKER_LAST_PROPERTY];
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_MACHINE (boxes_machine_get_type ())
#define BOXES_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE, BoxesMachine))
#define BOXES_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE, BoxesMachineClass))
#define BOXES_IS_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE))
#define BOXES_IS_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE))
#define BOXES_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE, BoxesMachineClass))

typedef struct _BoxesMachine BoxesMachine;
typedef struct _BoxesMachineClass BoxesMachineClass;

#define BOXES_TYPE_OVIRT_MACHINE (boxes_ovirt_machine_get_type ())
#define BOXES_OVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_OVIRT_MACHINE, BoxesOvirtMachine))
#define BOXES_OVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_OVIRT_MACHINE, BoxesOvirtMachineClass))
#define BOXES_IS_OVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_OVIRT_MACHINE))
#define BOXES_IS_OVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_OVIRT_MACHINE))
#define BOXES_OVIRT_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_OVIRT_MACHINE, BoxesOvirtMachineClass))

typedef struct _BoxesOvirtMachine BoxesOvirtMachine;
typedef struct _BoxesOvirtMachineClass BoxesOvirtMachineClass;

#define BOXES_TYPE_APP (boxes_app_get_type ())
#define BOXES_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP, BoxesApp))
#define BOXES_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP, BoxesAppClass))
#define BOXES_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP))
#define BOXES_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP))
#define BOXES_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP, BoxesAppClass))

typedef struct _BoxesApp BoxesApp;
typedef struct _BoxesAppClass BoxesAppClass;
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#define BOXES_TYPE_COLLECTION (boxes_collection_get_type ())
#define BOXES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION, BoxesCollection))
#define BOXES_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION, BoxesCollectionClass))
#define BOXES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION))
#define BOXES_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION))
#define BOXES_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION, BoxesCollectionClass))

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block109Data Block109Data;

#define BOXES_TYPE_APP_WINDOW (boxes_app_window_get_type ())
#define BOXES_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindow))
#define BOXES_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))
#define BOXES_IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP_WINDOW))
#define BOXES_IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP_WINDOW))
#define BOXES_APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))

typedef struct _BoxesAppWindow BoxesAppWindow;
typedef struct _BoxesAppWindowClass BoxesAppWindowClass;

#define BOXES_TYPE_NOTIFICATIONBAR (boxes_notificationbar_get_type ())
#define BOXES_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbar))
#define BOXES_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))
#define BOXES_IS_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_IS_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_NOTIFICATIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))

typedef struct _BoxesNotificationbar BoxesNotificationbar;
typedef struct _BoxesNotificationbarClass BoxesNotificationbarClass;

#define BOXES_TYPE_NOTIFICATION (boxes_notification_get_type ())
#define BOXES_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATION, BoxesNotification))
#define BOXES_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATION, BoxesNotificationClass))
#define BOXES_IS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATION))
#define BOXES_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATION))
#define BOXES_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATION, BoxesNotificationClass))

typedef struct _BoxesNotification BoxesNotification;
typedef struct _BoxesNotificationClass BoxesNotificationClass;
#define _g_byte_array_unref0(var) ((var == NULL) ? NULL : (var = (g_byte_array_unref (var), NULL)))
typedef struct _BoxesOvirtBrokerAddSourceData BoxesOvirtBrokerAddSourceData;

struct _BoxesBroker {
	GObject parent_instance;
	BoxesBrokerPrivate * priv;
};

struct _BoxesBrokerClass {
	GObjectClass parent_class;
	void (*add_source) (BoxesBroker* self, BoxesCollectionSource* source, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*add_source_finish) (BoxesBroker* self, GAsyncResult* _res_, GError** error);
};

struct _BoxesOvirtBroker {
	BoxesBroker parent_instance;
	BoxesOvirtBrokerPrivate * priv;
};

struct _BoxesOvirtBrokerClass {
	BoxesBrokerClass parent_class;
};

struct _BoxesOvirtBrokerPrivate {
	GHashTable* proxies;
};

struct _BoxesApp {
	GtkApplication parent_instance;
	BoxesAppPrivate * priv;
	BoxesCollection* collection;
	BoxesAsyncLauncher* async_launcher;
};

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

struct _Block109Data {
	int _ref_count_;
	BoxesOvirtBroker* self;
	RestProxy* proxy;
	RestProxyAuth* auth;
};

typedef void (*BoxesAuthNotificationAuthFunc) (const gchar* username, const gchar* password, void* user_data);
typedef void (*BoxesNotificationDismissFunc) (void* user_data);
struct _BoxesOvirtBrokerAddSourceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesOvirtBroker* self;
	BoxesCollectionSource* source;
	GHashTable* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gconstpointer _tmp5_;
	gboolean _tmp6_;
	OvirtProxy* proxy;
	BoxesCollectionSource* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	OvirtProxy* _tmp11_;
	OvirtProxy* _tmp12_;
	OvirtProxy* _tmp13_;
	OvirtProxy* _tmp14_;
	GByteArray* _tmp15_;
	GByteArray* _tmp16_;
	OvirtProxy* _tmp17_;
	GError* _error_;
	GError* _tmp18_;
	const gchar* _tmp19_;
	BoxesApp* _tmp20_;
	BoxesAppWindow* _tmp21_;
	BoxesAppWindow* _tmp22_;
	BoxesNotificationbar* _tmp23_;
	BoxesNotificationbar* _tmp24_;
	BoxesNotification* _tmp25_;
	BoxesNotification* _tmp26_;
	GHashTable* _tmp27_;
	BoxesCollectionSource* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	OvirtProxy* _tmp31_;
	OvirtProxy* _tmp32_;
	OvirtProxy* _tmp33_;
	GList* _tmp34_;
	GList* vm_collection;
	GList* vm_it;
	OvirtVm* _tmp35_;
	OvirtVm* vm;
	BoxesCollectionSource* _tmp36_;
	OvirtProxy* _tmp37_;
	OvirtVm* _tmp38_;
	BoxesCollectionSource* _tmp39_;
	GError * _inner_error_;
};


static gpointer boxes_ovirt_broker_parent_class = NULL;
static BoxesOvirtBroker* boxes_ovirt_broker_broker;
static BoxesOvirtBroker* boxes_ovirt_broker_broker = NULL;
extern BoxesApp* boxes_app_app;

GType boxes_broker_get_type (void) G_GNUC_CONST;
GType boxes_ovirt_broker_get_type (void) G_GNUC_CONST;
#define BOXES_OVIRT_BROKER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBrokerPrivate))
BoxesOvirtBroker* boxes_ovirt_broker_get_default (void);
static BoxesOvirtBroker* boxes_ovirt_broker_new (void);
static BoxesOvirtBroker* boxes_ovirt_broker_construct (GType object_type);
BoxesBroker* boxes_broker_construct (GType object_type);
static void _g_free0_ (gpointer var);
static void _g_object_unref0_ (gpointer var);
static void boxes_ovirt_broker_add_vm (BoxesOvirtBroker* self, BoxesCollectionSource* source, OvirtProxy* proxy, OvirtVm* vm);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_machine_get_type (void) G_GNUC_CONST;
GType boxes_ovirt_machine_get_type (void) G_GNUC_CONST;
BoxesOvirtMachine* boxes_ovirt_machine_new (BoxesCollectionSource* source, OvirtProxy* proxy, OvirtVm* vm, GError** error);
BoxesOvirtMachine* boxes_ovirt_machine_construct (GType object_type, BoxesCollectionSource* source, OvirtProxy* proxy, OvirtVm* vm, GError** error);
GType boxes_app_get_type (void) G_GNUC_CONST;
GType boxes_collection_get_type (void) G_GNUC_CONST;
void boxes_collection_add_item (BoxesCollection* self, BoxesCollectionItem* item);
static void boxes_ovirt_broker_real_add_source_data_free (gpointer _data);
static void boxes_ovirt_broker_real_add_source (BoxesBroker* base, BoxesCollectionSource* source, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean boxes_ovirt_broker_real_add_source_co (BoxesOvirtBrokerAddSourceData* _data_);
static gboolean __lambda249_ (BoxesOvirtBroker* self, RestProxy* proxy, RestProxyAuth* auth, gboolean retrying);
static Block109Data* block109_data_ref (Block109Data* _data109_);
static void block109_data_unref (void * _userdata_);
static void __lambda250_ (Block109Data* _data109_, const gchar* username, const gchar* password);
static void ___lambda250__boxes_auth_notification_auth_func (const gchar* username, const gchar* password, gpointer self);
static void __lambda251_ (Block109Data* _data109_);
static void ___lambda251__boxes_notification_dismiss_func (gpointer self);
GType boxes_app_window_get_type (void) G_GNUC_CONST;
BoxesAppWindow* boxes_app_get_main_window (BoxesApp* self);
GType boxes_notificationbar_get_type (void) G_GNUC_CONST;
BoxesNotificationbar* boxes_app_window_get_notificationbar (BoxesAppWindow* self);
GType boxes_notification_get_type (void) G_GNUC_CONST;
BoxesNotification* boxes_notificationbar_display_for_optional_auth (BoxesNotificationbar* self, const gchar* broker_name, BoxesAuthNotificationAuthFunc auth_func, void* auth_func_target, GDestroyNotify auth_func_target_destroy_notify, BoxesNotificationDismissFunc dismiss_func, void* dismiss_func_target, GDestroyNotify dismiss_func_target_destroy_notify);
static gboolean ___lambda249__rest_proxy_authenticate (RestProxy* _sender, RestProxyAuth* auth, gboolean retrying, gpointer self);
static void boxes_ovirt_broker_add_source_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
BoxesNotification* boxes_notificationbar_display_error (BoxesNotificationbar* self, const gchar* message, gint timeout);
#define BOXES_NOTIFICATIONBAR_DEFAULT_TIMEOUT 6
void boxes_broker_add_source (BoxesBroker* self, BoxesCollectionSource* source, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_broker_add_source_finish (BoxesBroker* self, GAsyncResult* _res_, GError** error);
static void boxes_ovirt_broker_finalize (GObject * obj);


static gpointer _g_object_ref0 (gpointer self) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return self ? g_object_ref (self) : NULL;
#line 296 "ovirt-broker.c"
}


BoxesOvirtBroker* boxes_ovirt_broker_get_default (void) {
	BoxesOvirtBroker* result = NULL;
	BoxesOvirtBroker* _tmp0_;
	BoxesOvirtBroker* _tmp2_;
	BoxesOvirtBroker* _tmp3_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = boxes_ovirt_broker_broker;
#line 9 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_tmp0_ == NULL) {
#line 309 "ovirt-broker.c"
		BoxesOvirtBroker* _tmp1_;
#line 10 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp1_ = boxes_ovirt_broker_new ();
#line 10 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (boxes_ovirt_broker_broker);
#line 10 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		boxes_ovirt_broker_broker = _tmp1_;
#line 317 "ovirt-broker.c"
	}
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp2_ = boxes_ovirt_broker_broker;
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	result = _tmp3_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return result;
#line 327 "ovirt-broker.c"
}


static void _g_free0_ (gpointer var) {
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	var = (g_free (var), NULL);
#line 334 "ovirt-broker.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 341 "ovirt-broker.c"
}


static BoxesOvirtBroker* boxes_ovirt_broker_construct (GType object_type) {
	BoxesOvirtBroker * self = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
#line 15 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = (BoxesOvirtBroker*) boxes_broker_construct (object_type);
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = g_str_hash;
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp1_ = g_str_equal;
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_object_unref0_);
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_hash_table_unref0 (self->priv->proxies);
#line 16 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self->priv->proxies = _tmp2_;
#line 15 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return self;
#line 364 "ovirt-broker.c"
}


static BoxesOvirtBroker* boxes_ovirt_broker_new (void) {
#line 15 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return boxes_ovirt_broker_construct (BOXES_TYPE_OVIRT_BROKER);
#line 371 "ovirt-broker.c"
}


static void boxes_ovirt_broker_add_vm (BoxesOvirtBroker* self, BoxesCollectionSource* source, OvirtProxy* proxy, OvirtVm* vm) {
	GError * _inner_error_ = NULL;
#line 19 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (self != NULL);
#line 19 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (source != NULL);
#line 19 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (proxy != NULL);
#line 19 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (vm != NULL);
#line 385 "ovirt-broker.c"
	{
		BoxesOvirtMachine* machine = NULL;
		BoxesCollectionSource* _tmp0_;
		OvirtProxy* _tmp1_;
		OvirtVm* _tmp2_;
		BoxesOvirtMachine* _tmp3_;
		BoxesApp* _tmp4_;
		BoxesCollection* _tmp5_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp0_ = source;
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp1_ = proxy;
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp2_ = vm;
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp3_ = boxes_ovirt_machine_new (_tmp0_, _tmp1_, _tmp2_, &_inner_error_);
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		machine = _tmp3_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 406 "ovirt-broker.c"
			goto __catch159_g_error;
		}
#line 22 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp4_ = boxes_app_app;
#line 22 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp5_ = _tmp4_->collection;
#line 22 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		boxes_collection_add_item (_tmp5_, (BoxesCollectionItem*) machine);
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (machine);
#line 417 "ovirt-broker.c"
	}
	goto __finally159;
	__catch159_g_error:
	{
		GError* _error_ = NULL;
		BoxesCollectionSource* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		GError* _tmp10_;
		const gchar* _tmp11_;
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_error_ = _inner_error_;
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_inner_error_ = NULL;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp6_ = source;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp7_ = boxes_collection_source_get_name (_tmp6_);
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp8_ = _tmp7_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp9_ = _tmp8_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp10_ = _error_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_tmp11_ = _tmp10_->message;
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_warning ("ovirt-broker.vala:24: Failed to create source '%s': %s", _tmp9_, _tmp11_);
#line 24 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_free0 (_tmp9_);
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_error_free0 (_error_);
#line 451 "ovirt-broker.c"
	}
	__finally159:
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_clear_error (&_inner_error_);
#line 20 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return;
#line 462 "ovirt-broker.c"
	}
}


static void boxes_ovirt_broker_real_add_source_data_free (gpointer _data) {
	BoxesOvirtBrokerAddSourceData* _data_;
	_data_ = _data;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data_->source);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data_->self);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_slice_free (BoxesOvirtBrokerAddSourceData, _data_);
#line 476 "ovirt-broker.c"
}


static void boxes_ovirt_broker_real_add_source (BoxesBroker* base, BoxesCollectionSource* source, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOvirtBroker * self;
	BoxesOvirtBrokerAddSourceData* _data_;
	BoxesOvirtBroker* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	BoxesCollectionSource* _tmp2_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = (BoxesOvirtBroker*) base;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_ = g_slice_new0 (BoxesOvirtBrokerAddSourceData);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_ovirt_broker_real_add_source_data_free);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->self = _tmp0_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp1_ = source;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data_->source);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->source = _tmp2_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	boxes_ovirt_broker_real_add_source_co (_data_);
#line 508 "ovirt-broker.c"
}


static void boxes_ovirt_broker_real_add_source_finish (BoxesBroker* base, GAsyncResult* _res_, GError** error) {
	BoxesOvirtBrokerAddSourceData* _data_;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (NULL == _data_) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return;
#line 520 "ovirt-broker.c"
	}
}


static Block109Data* block109_data_ref (Block109Data* _data109_) {
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_atomic_int_inc (&_data109_->_ref_count_);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return _data109_;
#line 530 "ovirt-broker.c"
}


static void block109_data_unref (void * _userdata_) {
	Block109Data* _data109_;
	_data109_ = (Block109Data*) _userdata_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (g_atomic_int_dec_and_test (&_data109_->_ref_count_)) {
#line 539 "ovirt-broker.c"
		BoxesOvirtBroker* self;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		self = _data109_->self;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data109_->proxy);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data109_->auth);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (self);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_slice_free (Block109Data, _data109_);
#line 551 "ovirt-broker.c"
	}
}


static void __lambda250_ (Block109Data* _data109_, const gchar* username, const gchar* password) {
	BoxesOvirtBroker* self;
	RestProxy* _tmp0_;
	const gchar* _tmp1_;
	RestProxy* _tmp2_;
	const gchar* _tmp3_;
	RestProxyAuth* _tmp4_;
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = _data109_->self;
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (username != NULL);
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_if_fail (password != NULL);
#line 39 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = _data109_->proxy;
#line 39 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp1_ = username;
#line 39 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_object_set (_tmp0_, "username", _tmp1_, NULL);
#line 40 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp2_ = _data109_->proxy;
#line 40 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp3_ = password;
#line 40 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_object_set (_tmp2_, "password", _tmp3_, NULL);
#line 41 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp4_ = _data109_->auth;
#line 41 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	rest_proxy_auth_unpause (_tmp4_);
#line 585 "ovirt-broker.c"
}


static void ___lambda250__boxes_auth_notification_auth_func (const gchar* username, const gchar* password, gpointer self) {
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	__lambda250_ (self, username, password);
#line 592 "ovirt-broker.c"
}


static void __lambda251_ (Block109Data* _data109_) {
	BoxesOvirtBroker* self;
	RestProxyAuth* _tmp0_;
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = _data109_->self;
#line 46 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = _data109_->auth;
#line 46 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	rest_proxy_auth_unpause (_tmp0_);
#line 605 "ovirt-broker.c"
}


static void ___lambda251__boxes_notification_dismiss_func (gpointer self) {
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	__lambda251_ (self);
#line 612 "ovirt-broker.c"
}


static gboolean __lambda249_ (BoxesOvirtBroker* self, RestProxy* proxy, RestProxyAuth* auth, gboolean retrying) {
	gboolean result = FALSE;
	Block109Data* _data109_;
	RestProxy* _tmp0_;
	RestProxy* _tmp1_;
	RestProxyAuth* _tmp2_;
	RestProxyAuth* _tmp3_;
	gboolean _tmp4_;
	BoxesAuthNotificationAuthFunc auth_cb = NULL;
	void* auth_cb_target;
	GDestroyNotify auth_cb_target_destroy_notify;
	BoxesNotificationDismissFunc cancel_cb = NULL;
	void* cancel_cb_target;
	GDestroyNotify cancel_cb_target_destroy_notify;
	BoxesApp* _tmp5_;
	BoxesAppWindow* _tmp6_;
	BoxesAppWindow* _tmp7_;
	BoxesNotificationbar* _tmp8_;
	BoxesNotificationbar* _tmp9_;
	BoxesAuthNotificationAuthFunc _tmp10_;
	void* _tmp10__target;
	GDestroyNotify _tmp10__target_destroy_notify;
	BoxesNotificationDismissFunc _tmp11_;
	void* _tmp11__target;
	GDestroyNotify _tmp11__target_destroy_notify;
	BoxesNotification* _tmp12_;
	BoxesNotification* _tmp13_;
	RestProxyAuth* _tmp14_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_val_if_fail (proxy != NULL, FALSE);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_return_val_if_fail (auth != NULL, FALSE);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data109_ = g_slice_new0 (Block109Data);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data109_->_ref_count_ = 1;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data109_->self = g_object_ref (self);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp0_ = proxy;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp1_ = _g_object_ref0 (_tmp0_);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data109_->proxy);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data109_->proxy = _tmp1_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp2_ = auth;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data109_->auth);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data109_->auth = _tmp3_;
#line 35 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp4_ = retrying;
#line 35 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_tmp4_) {
#line 36 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		result = FALSE;
#line 36 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		block109_data_unref (_data109_);
#line 36 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data109_ = NULL;
#line 36 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return result;
#line 682 "ovirt-broker.c"
	}
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb = ___lambda250__boxes_auth_notification_auth_func;
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target = block109_data_ref (_data109_);
#line 38 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target_destroy_notify = block109_data_unref;
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb = ___lambda251__boxes_notification_dismiss_func;
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target = block109_data_ref (_data109_);
#line 43 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target_destroy_notify = block109_data_unref;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp5_ = boxes_app_app;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp6_ = boxes_app_get_main_window (_tmp5_);
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp7_ = _tmp6_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp8_ = boxes_app_window_get_notificationbar (_tmp7_);
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp9_ = _tmp8_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp10_ = auth_cb;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp10__target = auth_cb_target;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp10__target_destroy_notify = auth_cb_target_destroy_notify;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target_destroy_notify = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp11_ = cancel_cb;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp11__target = cancel_cb_target;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp11__target_destroy_notify = cancel_cb_target_destroy_notify;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target_destroy_notify = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp12_ = boxes_notificationbar_display_for_optional_auth (_tmp9_, "oVirt broker", _tmp10_, _tmp10__target, _tmp10__target_destroy_notify, _tmp11_, _tmp11__target, _tmp11__target_destroy_notify);
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp13_ = _tmp12_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_tmp13_);
#line 49 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_tmp14_ = _data109_->auth;
#line 49 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	rest_proxy_auth_pause (_tmp14_);
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	result = FALSE;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	(cancel_cb_target_destroy_notify == NULL) ? NULL : (cancel_cb_target_destroy_notify (cancel_cb_target), NULL);
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	cancel_cb_target_destroy_notify = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	(auth_cb_target_destroy_notify == NULL) ? NULL : (auth_cb_target_destroy_notify (auth_cb_target), NULL);
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	auth_cb_target_destroy_notify = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	block109_data_unref (_data109_);
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data109_ = NULL;
#line 51 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return result;
#line 764 "ovirt-broker.c"
}


static gboolean ___lambda249__rest_proxy_authenticate (RestProxy* _sender, RestProxyAuth* auth, gboolean retrying, gpointer self) {
	gboolean result;
	result = __lambda249_ ((BoxesOvirtBroker*) self, _sender, auth, retrying);
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return result;
#line 773 "ovirt-broker.c"
}


static void boxes_ovirt_broker_add_source_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOvirtBrokerAddSourceData* _data_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_ = _user_data_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_source_object_ = source_object;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_res_ = _res_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	boxes_ovirt_broker_real_add_source_co (_data_);
#line 787 "ovirt-broker.c"
}


static gboolean boxes_ovirt_broker_real_add_source_co (BoxesOvirtBrokerAddSourceData* _data_) {
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	switch (_data_->_state_) {
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		case 0:
#line 796 "ovirt-broker.c"
		goto _state_0;
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		case 1:
#line 800 "ovirt-broker.c"
		goto _state_1;
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		case 2:
#line 804 "ovirt-broker.c"
		goto _state_2;
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		case 3:
#line 808 "ovirt-broker.c"
		goto _state_3;
		default:
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_assert_not_reached ();
#line 813 "ovirt-broker.c"
	}
	_state_0:
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp0_ = _data_->self->priv->proxies;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp1_ = _data_->source;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp2_ = boxes_collection_source_get_name (_data_->_tmp1_);
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp3_ = _data_->_tmp2_;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp4_ = _data_->_tmp3_;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp5_ = g_hash_table_lookup (_data_->_tmp0_, _data_->_tmp4_);
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp6_ = ((OvirtProxy*) _data_->_tmp5_) != NULL;
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_free0 (_data_->_tmp4_);
#line 29 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_data_->_tmp6_) {
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		if (_data_->_state_ != 0) {
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
			while (g_task_get_completed (_data_->_async_result) != TRUE) {
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 842 "ovirt-broker.c"
			}
		}
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_object_unref (_data_->_async_result);
#line 30 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 849 "ovirt-broker.c"
	}
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp7_ = _data_->source;
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp8_ = boxes_collection_source_get_uri (_data_->_tmp7_);
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp9_ = _data_->_tmp8_;
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp10_ = _data_->_tmp9_;
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp11_ = ovirt_proxy_new (_data_->_tmp10_);
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp12_ = _data_->_tmp11_;
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_free0 (_data_->_tmp10_);
#line 32 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->proxy = _data_->_tmp12_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp13_ = _data_->proxy;
#line 34 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_signal_connect_object ((RestProxy*) _data_->_tmp13_, "authenticate", (GCallback) ___lambda249__rest_proxy_authenticate, _data_->self, 0);
#line 871 "ovirt-broker.c"
	{
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp14_ = _data_->proxy;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_state_ = 1;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		ovirt_proxy_fetch_ca_certificate_async (_data_->_tmp14_, NULL, boxes_ovirt_broker_add_source_ready, _data_);
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 881 "ovirt-broker.c"
		_state_1:
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp15_ = ovirt_proxy_fetch_ca_certificate_finish (_data_->_tmp14_, _data_->_res_, &_data_->_inner_error_);
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp16_ = _data_->_tmp15_;
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_byte_array_unref0 (_data_->_tmp16_);
#line 55 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 891 "ovirt-broker.c"
			goto __catch160_g_error;
		}
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp17_ = _data_->proxy;
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_state_ = 2;
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		ovirt_proxy_fetch_vms_async (_data_->_tmp17_, NULL, boxes_ovirt_broker_add_source_ready, _data_);
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 902 "ovirt-broker.c"
		_state_2:
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		ovirt_proxy_fetch_vms_finish (_data_->_tmp17_, _data_->_res_, &_data_->_inner_error_);
#line 56 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 908 "ovirt-broker.c"
			goto __catch160_g_error;
		}
	}
	goto __finally160;
	__catch160_g_error:
	{
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_inner_error_ = NULL;
#line 58 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp18_ = _data_->_error_;
#line 58 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp19_ = _data_->_tmp18_->message;
#line 58 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_debug ("ovirt-broker.vala:58: Failed to connect to broker: %s", _data_->_tmp19_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp20_ = boxes_app_app;
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp21_ = boxes_app_get_main_window (_data_->_tmp20_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp22_ = _data_->_tmp21_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp23_ = boxes_app_window_get_notificationbar (_data_->_tmp22_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp24_ = _data_->_tmp23_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp25_ = boxes_notificationbar_display_error (_data_->_tmp24_, _ ("Connection to oVirt broker failed"), BOXES_NOTIFICATIONBAR_DEFAULT_TIMEOUT);
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->_tmp26_ = _data_->_tmp25_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data_->_tmp26_);
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_error_free0 (_data_->_error_);
#line 943 "ovirt-broker.c"
	}
	__finally160:
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data_->proxy);
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_object_unref (_data_->_async_result);
#line 54 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 956 "ovirt-broker.c"
	}
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp27_ = _data_->self->priv->proxies;
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp28_ = _data_->source;
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp29_ = boxes_collection_source_get_name (_data_->_tmp28_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp30_ = _data_->_tmp29_;
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp31_ = _data_->proxy;
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp32_ = _g_object_ref0 (_data_->_tmp31_);
#line 61 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_hash_table_insert (_data_->_tmp27_, _data_->_tmp30_, _data_->_tmp32_);
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp33_ = _data_->proxy;
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp34_ = ovirt_proxy_get_vms (_data_->_tmp33_);
#line 976 "ovirt-broker.c"
	{
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_data_->vm_collection = _data_->_tmp34_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		for (_data_->vm_it = _data_->vm_collection; _data_->vm_it != NULL; _data_->vm_it = _data_->vm_it->next) {
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
			_data_->_tmp35_ = _g_object_ref0 ((OvirtVm*) _data_->vm_it->data);
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
			_data_->vm = _data_->_tmp35_;
#line 986 "ovirt-broker.c"
			{
#line 64 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				_data_->_tmp36_ = _data_->source;
#line 64 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				_data_->_tmp37_ = _data_->proxy;
#line 64 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				_data_->_tmp38_ = _data_->vm;
#line 64 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				boxes_ovirt_broker_add_vm (_data_->self, _data_->_tmp36_, _data_->_tmp37_, _data_->_tmp38_);
#line 63 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
				_g_object_unref0 (_data_->vm);
#line 998 "ovirt-broker.c"
			}
		}
	}
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_tmp39_ = _data_->source;
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_data_->_state_ = 3;
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	BOXES_BROKER_CLASS (boxes_ovirt_broker_parent_class)->add_source (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, BOXES_TYPE_BROKER, BoxesBroker), _data_->_tmp39_, boxes_ovirt_broker_add_source_ready, _data_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return FALSE;
#line 1010 "ovirt-broker.c"
	_state_3:
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	BOXES_BROKER_CLASS (boxes_ovirt_broker_parent_class)->add_source_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, BOXES_TYPE_BROKER, BoxesBroker), _data_->_res_, &_data_->_inner_error_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		_g_object_unref0 (_data_->proxy);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		g_object_unref (_data_->_async_result);
#line 67 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		return FALSE;
#line 1024 "ovirt-broker.c"
	}
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_object_unref0 (_data_->proxy);
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	if (_data_->_state_ != 0) {
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
		while (g_task_get_completed (_data_->_async_result) != TRUE) {
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1036 "ovirt-broker.c"
		}
	}
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_object_unref (_data_->_async_result);
#line 28 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	return FALSE;
#line 1043 "ovirt-broker.c"
}


static void boxes_ovirt_broker_class_init (BoxesOvirtBrokerClass * klass) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	boxes_ovirt_broker_parent_class = g_type_class_peek_parent (klass);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	g_type_class_add_private (klass, sizeof (BoxesOvirtBrokerPrivate));
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	((BoxesBrokerClass *) klass)->add_source = (void (*) (BoxesBroker *, BoxesCollectionSource*, GAsyncReadyCallback, gpointer)) boxes_ovirt_broker_real_add_source;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	((BoxesBrokerClass *) klass)->add_source_finish = (void (*) (BoxesBroker *, GAsyncResult*, GError**)) boxes_ovirt_broker_real_add_source_finish;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_ovirt_broker_finalize;
#line 1058 "ovirt-broker.c"
}


static void boxes_ovirt_broker_instance_init (BoxesOvirtBroker * self) {
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self->priv = BOXES_OVIRT_BROKER_GET_PRIVATE (self);
#line 1065 "ovirt-broker.c"
}


static void boxes_ovirt_broker_finalize (GObject * obj) {
	BoxesOvirtBroker * self;
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_OVIRT_BROKER, BoxesOvirtBroker);
#line 6 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	_g_hash_table_unref0 (self->priv->proxies);
#line 4 "/home/fborges/checkout/gnome-boxes/src/ovirt-broker.vala"
	G_OBJECT_CLASS (boxes_ovirt_broker_parent_class)->finalize (obj);
#line 1077 "ovirt-broker.c"
}


GType boxes_ovirt_broker_get_type (void) {
	static volatile gsize boxes_ovirt_broker_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_ovirt_broker_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesOvirtBrokerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_ovirt_broker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesOvirtBroker), 0, (GInstanceInitFunc) boxes_ovirt_broker_instance_init, NULL };
		GType boxes_ovirt_broker_type_id;
		boxes_ovirt_broker_type_id = g_type_register_static (BOXES_TYPE_BROKER, "BoxesOvirtBroker", &g_define_type_info, 0);
		g_once_init_leave (&boxes_ovirt_broker_type_id__volatile, boxes_ovirt_broker_type_id);
	}
	return boxes_ovirt_broker_type_id__volatile;
}



