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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * 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 3 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
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.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

enum  {
	OBJECTS_SOURCE_0_PROPERTY,
	OBJECTS_SOURCE_SOURCE_TYPE_PROPERTY,
	OBJECTS_SOURCE_ADDED_AT_PROPERTY,
	OBJECTS_SOURCE_UPDATED_AT_PROPERTY,
	OBJECTS_SOURCE_IS_VISIBLE_PROPERTY,
	OBJECTS_SOURCE_CHILD_ORDER_PROPERTY,
	OBJECTS_SOURCE_SYNC_SERVER_PROPERTY,
	OBJECTS_SOURCE_LAST_SYNC_PROPERTY,
	OBJECTS_SOURCE_DATA_PROPERTY,
	OBJECTS_SOURCE_DISPLAY_NAME_PROPERTY,
	OBJECTS_SOURCE_SYNC_STATUS_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_PROPERTY,
	OBJECTS_SOURCE_CALDAV_DATA_PROPERTY,
	OBJECTS_SOURCE_HEADER_TEXT_PROPERTY,
	OBJECTS_SOURCE_SUBHEADER_TEXT_PROPERTY,
	OBJECTS_SOURCE_AVATAR_PATH_PROPERTY,
	OBJECTS_SOURCE_USER_DISPLAYNAME_PROPERTY,
	OBJECTS_SOURCE_USER_EMAIL_PROPERTY,
	OBJECTS_SOURCE_NUM_PROPERTIES
};
static GParamSpec* objects_source_properties[OBJECTS_SOURCE_NUM_PROPERTIES];
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _ObjectsSourceDeleteSourceData ObjectsSourceDeleteSourceData;
enum  {
	OBJECTS_SOURCE_SYNC_STARTED_SIGNAL,
	OBJECTS_SOURCE_SYNC_FINISHED_SIGNAL,
	OBJECTS_SOURCE_SYNC_FAILED_SIGNAL,
	OBJECTS_SOURCE_NUM_SIGNALS
};
static guint objects_source_signals[OBJECTS_SOURCE_NUM_SIGNALS] = {0};
enum  {
	OBJECTS_SOURCE_DATA_0_PROPERTY,
	OBJECTS_SOURCE_DATA_BUILDER_PROPERTY,
	OBJECTS_SOURCE_DATA_NUM_PROPERTIES
};
static GParamSpec* objects_source_data_properties[OBJECTS_SOURCE_DATA_NUM_PROPERTIES];
enum  {
	OBJECTS_SOURCE_TODOIST_DATA_0_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_ACCESS_TOKEN_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_SYNC_TOKEN_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_USER_ID_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_USER_IMAGE_ID_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_USER_EMAIL_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_USER_NAME_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_USER_AVATAR_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_USER_IS_PREMIUM_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_API_VERSION_PROPERTY,
	OBJECTS_SOURCE_TODOIST_DATA_NUM_PROPERTIES
};
static GParamSpec* objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_NUM_PROPERTIES];
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
enum  {
	OBJECTS_SOURCE_CAL_DAV_DATA_0_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_SERVER_URL_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_USERNAME_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_PASSWORD_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_USER_DISPLAYNAME_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_USER_EMAIL_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_CALENDAR_HOME_URL_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_CALDAV_TYPE_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_IGNORE_SSL_PROPERTY,
	OBJECTS_SOURCE_CAL_DAV_DATA_NUM_PROPERTIES
};
static GParamSpec* objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_NUM_PROPERTIES];

struct _ObjectsSourcePrivate {
	SourceType _source_type;
	gchar* _added_at;
	gchar* _updated_at;
	gboolean _is_visible;
	gint _child_order;
	gboolean _sync_server;
	gchar* _last_sync;
	ObjectsSourceData* _data;
	gchar* _display_name;
	SyncStatus* _sync_status;
	ObjectsSourceTodoistData* _todoist_data;
	ObjectsSourceCalDAVData* _caldav_data;
	gchar* _subheader_text;
	guint server_timeout;
};

struct _ObjectsSourceDeleteSourceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ObjectsSource* self;
	ServicesStore* _tmp0_;
};

struct _ObjectsSourceDataPrivate {
	JsonBuilder* _builder;
};

struct _ObjectsSourceTodoistDataPrivate {
	gchar* _access_token;
	gchar* _sync_token;
	gchar* _user_id;
	gchar* _user_image_id;
	gchar* _user_email;
	gchar* _user_name;
	gchar* _user_avatar;
	gboolean _user_is_premium;
	gchar* _api_version;
};

struct _ObjectsSourceCalDAVDataPrivate {
	gchar* _server_url;
	gchar* _username;
	gchar* _password;
	gchar* _user_displayname;
	gchar* _user_email;
	gchar* _calendar_home_url;
	CalDAVType _caldav_type;
	gboolean _ignore_ssl;
};

static gint ObjectsSource_private_offset;
static gpointer objects_source_parent_class = NULL;
static gint ObjectsSourceData_private_offset;
static gpointer objects_source_data_parent_class = NULL;
static gint ObjectsSourceTodoistData_private_offset;
static gpointer objects_source_todoist_data_parent_class = NULL;
static gint ObjectsSourceCalDAVData_private_offset;
static gpointer objects_source_cal_dav_data_parent_class = NULL;

static void _objects_source_run_server (ObjectsSource* self);
static gboolean __lambda81_ (ObjectsSource* self);
static gboolean ___lambda81__gsource_func (gpointer self);
static void objects_source_delete_source_data_free (gpointer _data);
static gboolean objects_source_delete_source_co (ObjectsSourceDeleteSourceData* _data_);
static void objects_source_delete_source_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void objects_source_finalize (GObject * obj);
static GType objects_source_get_type_once (void);
static void _vala_objects_source_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec);
static void _vala_objects_source_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec);
static gchar* objects_source_data_real_to_json (ObjectsSourceData* self);
static void objects_source_data_finalize (GObject * obj);
static GType objects_source_data_get_type_once (void);
static void _vala_objects_source_data_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static gchar* objects_source_todoist_data_real_to_json (ObjectsSourceData* base);
static void _vala_JsonNode_free (JsonNode* self);
static void objects_source_todoist_data_finalize (GObject * obj);
static GType objects_source_todoist_data_get_type_once (void);
static void _vala_objects_source_todoist_data_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_objects_source_todoist_data_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static gchar* objects_source_cal_dav_data_real_to_json (ObjectsSourceData* base);
static void objects_source_cal_dav_data_finalize (GObject * obj);
static GType objects_source_cal_dav_data_get_type_once (void);
static void _vala_objects_source_cal_dav_data_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_objects_source_cal_dav_data_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 gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
objects_source_get_instance_private (ObjectsSource* self)
{
	return G_STRUCT_MEMBER_P (self, ObjectsSource_private_offset);
}

static gchar*
g_date_time_to_string (GDateTime* self)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_date_time_format (self, "%FT%H:%M:%S%z");
	result = _tmp0_;
	return result;
}

ObjectsSource*
objects_source_construct_from_import_json (GType object_type,
                                           JsonNode* node)
{
	ObjectsSource * self = NULL;
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	JsonObject* _tmp2_;
	const gchar* _tmp3_;
	JsonObject* _tmp4_;
	const gchar* _tmp5_;
	JsonObject* _tmp6_;
	const gchar* _tmp7_;
	JsonObject* _tmp8_;
	JsonObject* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	const gchar* _tmp12_;
	JsonObject* _tmp13_;
	const gchar* _tmp14_;
	SourceType _tmp15_;
	g_return_val_if_fail (node != NULL, NULL);
	self = (ObjectsSource*) objects_base_object_construct (object_type);
	_tmp0_ = json_node_get_object (node);
	_tmp1_ = json_object_get_string_member (_tmp0_, "id");
	objects_base_object_set_id ((ObjectsBaseObject*) self, _tmp1_);
	_tmp2_ = json_node_get_object (node);
	_tmp3_ = json_object_get_string_member (_tmp2_, "source_type");
	objects_source_set_source_type (self, source_type_parse (_tmp3_));
	_tmp4_ = json_node_get_object (node);
	_tmp5_ = json_object_get_string_member (_tmp4_, "added_at");
	objects_source_set_added_at (self, _tmp5_);
	_tmp6_ = json_node_get_object (node);
	_tmp7_ = json_object_get_string_member (_tmp6_, "updated_at");
	objects_source_set_updated_at (self, _tmp7_);
	_tmp8_ = json_node_get_object (node);
	objects_source_set_is_visible (self, json_object_get_boolean_member (_tmp8_, "is_visible"));
	_tmp9_ = json_node_get_object (node);
	objects_source_set_child_order (self, (gint) ((gint32) json_object_get_int_member (_tmp9_, "child_order")));
	_tmp10_ = json_node_get_object (node);
	objects_source_set_sync_server (self, json_object_get_boolean_member (_tmp10_, "sync_server"));
	_tmp11_ = json_node_get_object (node);
	_tmp12_ = json_object_get_string_member (_tmp11_, "last_sync");
	objects_source_set_last_sync (self, _tmp12_);
	_tmp13_ = json_node_get_object (node);
	_tmp14_ = json_object_get_string_member (_tmp13_, "display_name");
	objects_source_set_display_name (self, _tmp14_);
	_tmp15_ = self->priv->_source_type;
	if (_tmp15_ == SOURCE_TYPE_TODOIST) {
		JsonObject* _tmp16_;
		const gchar* _tmp17_;
		ObjectsSourceTodoistData* _tmp18_;
		ObjectsSourceTodoistData* _tmp19_;
		_tmp16_ = json_node_get_object (node);
		_tmp17_ = json_object_get_string_member (_tmp16_, "data");
		_tmp18_ = objects_source_todoist_data_new_from_json (_tmp17_);
		_tmp19_ = _tmp18_;
		objects_source_set_data (self, (ObjectsSourceData*) _tmp19_);
		_g_object_unref0 (_tmp19_);
	} else {
		SourceType _tmp20_;
		_tmp20_ = self->priv->_source_type;
		if (_tmp20_ == SOURCE_TYPE_CALDAV) {
			JsonObject* _tmp21_;
			const gchar* _tmp22_;
			ObjectsSourceCalDAVData* _tmp23_;
			ObjectsSourceCalDAVData* _tmp24_;
			_tmp21_ = json_node_get_object (node);
			_tmp22_ = json_object_get_string_member (_tmp21_, "data");
			_tmp23_ = objects_source_cal_dav_data_new_from_json (_tmp22_);
			_tmp24_ = _tmp23_;
			objects_source_set_data (self, (ObjectsSourceData*) _tmp24_);
			_g_object_unref0 (_tmp24_);
		}
	}
	return self;
}

ObjectsSource*
objects_source_new_from_import_json (JsonNode* node)
{
	return objects_source_construct_from_import_json (OBJECTS_TYPE_SOURCE, node);
}

static gboolean
__lambda81_ (ObjectsSource* self)
{
	gboolean _tmp0_;
	ServicesLogService* _tmp6_;
	ServicesLogService* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gboolean result;
	_tmp0_ = self->priv->_sync_server;
	if (_tmp0_) {
		ServicesLogService* _tmp1_;
		ServicesLogService* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp1_ = services_log_service_get_default ();
		_tmp2_ = _tmp1_;
		_tmp3_ = self->priv->_display_name;
		_tmp4_ = g_strdup_printf ("Periodic sync for source: %s", _tmp3_);
		_tmp5_ = _tmp4_;
		services_log_service_info (_tmp2_, "Source", _tmp5_);
		_g_free0 (_tmp5_);
		_g_object_unref0 (_tmp2_);
		_objects_source_run_server (self);
		result = TRUE;
		return result;
	}
	_tmp6_ = services_log_service_get_default ();
	_tmp7_ = _tmp6_;
	_tmp8_ = self->priv->_display_name;
	_tmp9_ = g_strdup_printf ("Sync server stopped for source: %s", _tmp8_);
	_tmp10_ = _tmp9_;
	services_log_service_info (_tmp7_, "Source", _tmp10_);
	_g_free0 (_tmp10_);
	_g_object_unref0 (_tmp7_);
	result = FALSE;
	return result;
}

static gboolean
___lambda81__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda81_ ((ObjectsSource*) self);
	return result;
}

void
objects_source_run_server (ObjectsSource* self,
                           gboolean skip_first_sync)
{
	SourceType _tmp0_;
	ServicesLogService* _tmp1_;
	ServicesLogService* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_source_type;
	if (_tmp0_ == SOURCE_TYPE_LOCAL) {
		return;
	}
	_tmp1_ = services_log_service_get_default ();
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->_display_name;
	_tmp4_ = g_strdup_printf ("Starting sync server for source: %s", _tmp3_);
	_tmp5_ = _tmp4_;
	services_log_service_info (_tmp2_, "Source", _tmp5_);
	_g_free0 (_tmp5_);
	_g_object_unref0 (_tmp2_);
	if (!skip_first_sync) {
		_objects_source_run_server (self);
	}
	self->priv->server_timeout = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) (15 * 60), ___lambda81__gsource_func, g_object_ref (self), g_object_unref);
}

static void
_objects_source_run_server (ObjectsSource* self)
{
	gboolean _tmp0_;
	SourceType _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_is_visible;
	if (!_tmp0_) {
		ServicesLogService* _tmp1_;
		ServicesLogService* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp1_ = services_log_service_get_default ();
		_tmp2_ = _tmp1_;
		_tmp3_ = self->priv->_display_name;
		_tmp4_ = g_strdup_printf ("Skipping sync for disabled source: %s", _tmp3_);
		_tmp5_ = _tmp4_;
		services_log_service_info (_tmp2_, "Source", _tmp5_);
		_g_free0 (_tmp5_);
		_g_object_unref0 (_tmp2_);
		return;
	}
	_tmp6_ = self->priv->_source_type;
	if (_tmp6_ == SOURCE_TYPE_TODOIST) {
		ServicesTodoist* _tmp7_;
		ServicesTodoist* _tmp8_;
		_tmp7_ = services_todoist_get_default ();
		_tmp8_ = _tmp7_;
		services_todoist_sync (_tmp8_, self, NULL, NULL);
		_g_object_unref0 (_tmp8_);
	} else {
		SourceType _tmp9_;
		_tmp9_ = self->priv->_source_type;
		if (_tmp9_ == SOURCE_TYPE_CALDAV) {
			ServicesCalDAVCore* _tmp10_;
			ServicesCalDAVCore* _tmp11_;
			_tmp10_ = services_cal_dav_core_get_default ();
			_tmp11_ = _tmp10_;
			services_cal_dav_core_sync (_tmp11_, self, NULL, NULL);
			_g_object_unref0 (_tmp11_);
		}
	}
}

void
objects_source_remove_sync_server (ObjectsSource* self)
{
	g_return_if_fail (self != NULL);
	g_source_remove (self->priv->server_timeout);
	self->priv->server_timeout = (guint) 0;
}

void
objects_source_save (ObjectsSource* self)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	ServicesStore* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_to_string (_tmp1_);
	_tmp3_ = _tmp2_;
	objects_source_set_updated_at (self, _tmp3_);
	_g_free0 (_tmp3_);
	_g_date_time_unref0 (_tmp1_);
	_tmp4_ = services_store_instance ();
	services_store_update_source (_tmp4_, self);
}

static void
objects_source_delete_source_data_free (gpointer _data)
{
	ObjectsSourceDeleteSourceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (ObjectsSourceDeleteSourceData, _data_);
}

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

void
objects_source_delete_source (ObjectsSource* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	ObjectsSourceDeleteSourceData* _data_;
	ObjectsSource* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (ObjectsSourceDeleteSourceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, objects_source_delete_source_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	objects_source_delete_source_co (_data_);
}

void
objects_source_delete_source_finish (ObjectsSource* self,
                                     GAsyncResult* _res_)
{
	ObjectsSourceDeleteSourceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
objects_source_delete_source_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	ObjectsSourceDeleteSourceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	objects_source_delete_source_co (_data_);
}

static gboolean
objects_source_delete_source_co (ObjectsSourceDeleteSourceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	objects_source_remove_sync_server (_data_->self);
	_data_->_tmp0_ = services_store_instance ();
	_data_->_state_ = 1;
	services_store_delete_source (_data_->_tmp0_, _data_->self, objects_source_delete_source_ready, _data_);
	return FALSE;
	_state_1:
	services_store_delete_source_finish (_data_->_tmp0_, _data_->_res_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

gchar*
objects_source_to_string (ObjectsSource* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	ObjectsSourceData* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	SourceType _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gboolean _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	gboolean _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gint _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = objects_base_object_get_id ((ObjectsBaseObject*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_data;
	_tmp3_ = objects_source_data_to_json (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = self->priv->_source_type;
	_tmp6_ = source_type_to_string (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = self->priv->_sync_server;
	_tmp9_ = bool_to_string (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = self->priv->_display_name;
	_tmp12_ = self->priv->_updated_at;
	_tmp13_ = self->priv->_is_visible;
	_tmp14_ = bool_to_string (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = self->priv->_child_order;
	_tmp17_ = self->priv->_last_sync;
	_tmp18_ = g_strdup_printf ("\n" \
"        _________________________________\n" \
"            ID: %s\n" \
"            DATA: %s\n" \
"            TYPE: %s\n" \
"            SYNC_SERVER: %s\n" \
"            DISPLAY_NAME: %s\n" \
"            UPDATED_AT: %s\n" \
"            IS_VISIBLE: %s\n" \
"            CHILD_ORDER: %d\n" \
"            LAST_SYNC: %s\n" \
"        ---------------------------------\n" \
"        ", _tmp1_, _tmp4_, _tmp7_, _tmp10_, _tmp11_, _tmp12_, _tmp15_, _tmp16_, _tmp17_);
	_tmp19_ = _tmp18_;
	_g_free0 (_tmp15_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp4_);
	result = _tmp19_;
	return result;
}

gboolean
objects_source_needs_migration (ObjectsSource* self)
{
	SourceType _tmp0_;
	gboolean _tmp1_ = FALSE;
	ObjectsSourceTodoistData* _tmp2_;
	ObjectsSourceTodoistData* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_source_type;
	if (_tmp0_ != SOURCE_TYPE_TODOIST) {
		result = FALSE;
		return result;
	}
	_tmp2_ = objects_source_get_todoist_data (self);
	_tmp3_ = _tmp2_;
	_tmp4_ = objects_source_todoist_data_get_api_version (_tmp3_);
	_tmp5_ = _tmp4_;
	if (g_strcmp0 (_tmp5_, "") == 0) {
		_tmp1_ = TRUE;
	} else {
		ObjectsSourceTodoistData* _tmp6_;
		ObjectsSourceTodoistData* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp6_ = objects_source_get_todoist_data (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = objects_source_todoist_data_get_api_version (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp1_ = g_strcmp0 (_tmp9_, "v9") == 0;
	}
	result = _tmp1_;
	return result;
}

ObjectsSource*
objects_source_construct (GType object_type)
{
	ObjectsSource * self = NULL;
	self = (ObjectsSource*) objects_base_object_construct (object_type);
	return self;
}

ObjectsSource*
objects_source_new (void)
{
	return objects_source_construct (OBJECTS_TYPE_SOURCE);
}

SourceType
objects_source_get_source_type (ObjectsSource* self)
{
	SourceType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_source_type;
	return result;
}

void
objects_source_set_source_type (ObjectsSource* self,
                                SourceType value)
{
	SourceType old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_source_type (self);
	if (old_value != value) {
		self->priv->_source_type = value;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_SOURCE_TYPE_PROPERTY]);
	}
}

const gchar*
objects_source_get_added_at (ObjectsSource* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_added_at;
	result = _tmp0_;
	return result;
}

void
objects_source_set_added_at (ObjectsSource* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_added_at (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_added_at);
		self->priv->_added_at = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_ADDED_AT_PROPERTY]);
	}
}

const gchar*
objects_source_get_updated_at (ObjectsSource* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_updated_at;
	result = _tmp0_;
	return result;
}

void
objects_source_set_updated_at (ObjectsSource* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_updated_at (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_updated_at);
		self->priv->_updated_at = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_UPDATED_AT_PROPERTY]);
	}
}

gboolean
objects_source_get_is_visible (ObjectsSource* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_visible;
	return result;
}

void
objects_source_set_is_visible (ObjectsSource* self,
                               gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_is_visible (self);
	if (old_value != value) {
		self->priv->_is_visible = value;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_IS_VISIBLE_PROPERTY]);
	}
}

gint
objects_source_get_child_order (ObjectsSource* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_child_order;
	return result;
}

void
objects_source_set_child_order (ObjectsSource* self,
                                gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_child_order (self);
	if (old_value != value) {
		self->priv->_child_order = value;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_CHILD_ORDER_PROPERTY]);
	}
}

gboolean
objects_source_get_sync_server (ObjectsSource* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_sync_server;
	return result;
}

void
objects_source_set_sync_server (ObjectsSource* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_sync_server (self);
	if (old_value != value) {
		self->priv->_sync_server = value;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_SYNC_SERVER_PROPERTY]);
	}
}

const gchar*
objects_source_get_last_sync (ObjectsSource* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_last_sync;
	result = _tmp0_;
	return result;
}

void
objects_source_set_last_sync (ObjectsSource* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_last_sync (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_last_sync);
		self->priv->_last_sync = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_LAST_SYNC_PROPERTY]);
	}
}

ObjectsSourceData*
objects_source_get_data (ObjectsSource* self)
{
	ObjectsSourceData* result;
	ObjectsSourceData* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_data;
	result = _tmp0_;
	return result;
}

void
objects_source_set_data (ObjectsSource* self,
                         ObjectsSourceData* value)
{
	ObjectsSourceData* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_data (self);
	if (old_value != value) {
		ObjectsSourceData* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_data);
		self->priv->_data = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_DATA_PROPERTY]);
	}
}

const gchar*
objects_source_get_display_name (ObjectsSource* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_name;
	result = _tmp0_;
	return result;
}

void
objects_source_set_display_name (ObjectsSource* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_display_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_display_name);
		self->priv->_display_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_DISPLAY_NAME_PROPERTY]);
	}
}

SyncStatus*
objects_source_get_sync_status (ObjectsSource* self)
{
	SyncStatus* result;
	SyncStatus* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sync_status;
	result = _tmp0_;
	return result;
}

void
objects_source_set_sync_status (ObjectsSource* self,
                                SyncStatus* value)
{
	SyncStatus* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_get_sync_status (self);
	if (old_value != value) {
		SyncStatus* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_sync_status);
		self->priv->_sync_status = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_properties[OBJECTS_SOURCE_SYNC_STATUS_PROPERTY]);
	}
}

ObjectsSourceTodoistData*
objects_source_get_todoist_data (ObjectsSource* self)
{
	ObjectsSourceTodoistData* result;
	ObjectsSourceData* _tmp0_;
	ObjectsSourceTodoistData* _tmp1_;
	ObjectsSourceTodoistData* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_data;
	_tmp1_ = _g_object_ref0 (OBJECTS_IS_SOURCE_TODOIST_DATA (_tmp0_) ? ((ObjectsSourceTodoistData*) _tmp0_) : NULL);
	_g_object_unref0 (self->priv->_todoist_data);
	self->priv->_todoist_data = _tmp1_;
	_tmp2_ = self->priv->_todoist_data;
	result = _tmp2_;
	return result;
}

ObjectsSourceCalDAVData*
objects_source_get_caldav_data (ObjectsSource* self)
{
	ObjectsSourceCalDAVData* result;
	ObjectsSourceData* _tmp0_;
	ObjectsSourceCalDAVData* _tmp1_;
	ObjectsSourceCalDAVData* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_data;
	_tmp1_ = _g_object_ref0 (OBJECTS_IS_SOURCE_CAL_DAV_DATA (_tmp0_) ? ((ObjectsSourceCalDAVData*) _tmp0_) : NULL);
	_g_object_unref0 (self->priv->_caldav_data);
	self->priv->_caldav_data = _tmp1_;
	_tmp2_ = self->priv->_caldav_data;
	result = _tmp2_;
	return result;
}

const gchar*
objects_source_get_header_text (ObjectsSource* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_display_name;
	result = _tmp0_;
	return result;
}

const gchar*
objects_source_get_subheader_text (ObjectsSource* self)
{
	const gchar* result;
	SourceType _tmp0_;
	SourceType _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source_type;
	if (_tmp0_ == SOURCE_TYPE_TODOIST) {
		result = _ ("Todoist");
		return result;
	}
	_tmp1_ = self->priv->_source_type;
	if (_tmp1_ == SOURCE_TYPE_CALDAV) {
		ObjectsSourceCalDAVData* _tmp2_;
		ObjectsSourceCalDAVData* _tmp3_;
		CalDAVType _tmp4_;
		CalDAVType _tmp5_;
		gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp2_ = objects_source_get_caldav_data (self);
		_tmp3_ = _tmp2_;
		_tmp4_ = objects_source_cal_dav_data_get_caldav_type (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = cal_dav_type_title (_tmp5_);
		_g_free0 (self->priv->_subheader_text);
		self->priv->_subheader_text = _tmp6_;
		_tmp7_ = self->priv->_subheader_text;
		result = _tmp7_;
		return result;
	}
	result = "";
	return result;
}

const gchar*
objects_source_get_avatar_path (ObjectsSource* self)
{
	const gchar* result;
	ObjectsSourceTodoistData* _tmp0_;
	ObjectsSourceTodoistData* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = objects_source_get_todoist_data (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = objects_source_todoist_data_get_user_image_id (_tmp1_);
	_tmp3_ = _tmp2_;
	result = _tmp3_;
	return result;
}

const gchar*
objects_source_get_user_displayname (ObjectsSource* self)
{
	const gchar* result;
	SourceType _tmp0_;
	SourceType _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source_type;
	if (_tmp0_ == SOURCE_TYPE_TODOIST) {
		ObjectsSourceTodoistData* _tmp1_;
		ObjectsSourceTodoistData* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp1_ = objects_source_get_todoist_data (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = objects_source_todoist_data_get_user_name (_tmp2_);
		_tmp4_ = _tmp3_;
		result = _tmp4_;
		return result;
	}
	_tmp5_ = self->priv->_source_type;
	if (_tmp5_ == SOURCE_TYPE_CALDAV) {
		ObjectsSourceCalDAVData* _tmp6_;
		ObjectsSourceCalDAVData* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp6_ = objects_source_get_caldav_data (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = objects_source_cal_dav_data_get_user_displayname (_tmp7_);
		_tmp9_ = _tmp8_;
		result = _tmp9_;
		return result;
	}
	result = "";
	return result;
}

const gchar*
objects_source_get_user_email (ObjectsSource* self)
{
	const gchar* result;
	SourceType _tmp0_;
	SourceType _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source_type;
	if (_tmp0_ == SOURCE_TYPE_TODOIST) {
		ObjectsSourceTodoistData* _tmp1_;
		ObjectsSourceTodoistData* _tmp2_;
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		_tmp1_ = objects_source_get_todoist_data (self);
		_tmp2_ = _tmp1_;
		_tmp3_ = objects_source_todoist_data_get_user_email (_tmp2_);
		_tmp4_ = _tmp3_;
		result = _tmp4_;
		return result;
	}
	_tmp5_ = self->priv->_source_type;
	if (_tmp5_ == SOURCE_TYPE_CALDAV) {
		ObjectsSourceCalDAVData* _tmp6_;
		ObjectsSourceCalDAVData* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp6_ = objects_source_get_caldav_data (self);
		_tmp7_ = _tmp6_;
		_tmp8_ = objects_source_cal_dav_data_get_user_email (_tmp7_);
		_tmp9_ = _tmp8_;
		result = _tmp9_;
		return result;
	}
	result = "";
	return result;
}

static void
objects_source_class_init (ObjectsSourceClass * klass,
                           gpointer klass_data)
{
	objects_source_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ObjectsSource_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_objects_source_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_objects_source_set_property;
	G_OBJECT_CLASS (klass)->finalize = objects_source_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_SOURCE_TYPE_PROPERTY, objects_source_properties[OBJECTS_SOURCE_SOURCE_TYPE_PROPERTY] = g_param_spec_enum ("source-type", "source-type", "source-type", TYPE_SOURCE_TYPE, SOURCE_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_ADDED_AT_PROPERTY, objects_source_properties[OBJECTS_SOURCE_ADDED_AT_PROPERTY] = g_param_spec_string ("added-at", "added-at", "added-at", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_UPDATED_AT_PROPERTY, objects_source_properties[OBJECTS_SOURCE_UPDATED_AT_PROPERTY] = g_param_spec_string ("updated-at", "updated-at", "updated-at", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_IS_VISIBLE_PROPERTY, objects_source_properties[OBJECTS_SOURCE_IS_VISIBLE_PROPERTY] = g_param_spec_boolean ("is-visible", "is-visible", "is-visible", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CHILD_ORDER_PROPERTY, objects_source_properties[OBJECTS_SOURCE_CHILD_ORDER_PROPERTY] = g_param_spec_int ("child-order", "child-order", "child-order", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_SYNC_SERVER_PROPERTY, objects_source_properties[OBJECTS_SOURCE_SYNC_SERVER_PROPERTY] = g_param_spec_boolean ("sync-server", "sync-server", "sync-server", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_LAST_SYNC_PROPERTY, objects_source_properties[OBJECTS_SOURCE_LAST_SYNC_PROPERTY] = g_param_spec_string ("last-sync", "last-sync", "last-sync", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_DATA_PROPERTY, objects_source_properties[OBJECTS_SOURCE_DATA_PROPERTY] = g_param_spec_object ("data", "data", "data", OBJECTS_TYPE_SOURCE_DATA, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_DISPLAY_NAME_PROPERTY, objects_source_properties[OBJECTS_SOURCE_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_SYNC_STATUS_PROPERTY, objects_source_properties[OBJECTS_SOURCE_SYNC_STATUS_PROPERTY] = g_param_spec_object ("sync-status", "sync-status", "sync-status", TYPE_SYNC_STATUS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_PROPERTY, objects_source_properties[OBJECTS_SOURCE_TODOIST_DATA_PROPERTY] = g_param_spec_object ("todoist-data", "todoist-data", "todoist-data", OBJECTS_TYPE_SOURCE_TODOIST_DATA, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CALDAV_DATA_PROPERTY, objects_source_properties[OBJECTS_SOURCE_CALDAV_DATA_PROPERTY] = g_param_spec_object ("caldav-data", "caldav-data", "caldav-data", OBJECTS_TYPE_SOURCE_CAL_DAV_DATA, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_HEADER_TEXT_PROPERTY, objects_source_properties[OBJECTS_SOURCE_HEADER_TEXT_PROPERTY] = g_param_spec_string ("header-text", "header-text", "header-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_SUBHEADER_TEXT_PROPERTY, objects_source_properties[OBJECTS_SOURCE_SUBHEADER_TEXT_PROPERTY] = g_param_spec_string ("subheader-text", "subheader-text", "subheader-text", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_AVATAR_PATH_PROPERTY, objects_source_properties[OBJECTS_SOURCE_AVATAR_PATH_PROPERTY] = g_param_spec_string ("avatar-path", "avatar-path", "avatar-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_USER_DISPLAYNAME_PROPERTY, objects_source_properties[OBJECTS_SOURCE_USER_DISPLAYNAME_PROPERTY] = g_param_spec_string ("user-displayname", "user-displayname", "user-displayname", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_USER_EMAIL_PROPERTY, objects_source_properties[OBJECTS_SOURCE_USER_EMAIL_PROPERTY] = g_param_spec_string ("user-email", "user-email", "user-email", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	objects_source_signals[OBJECTS_SOURCE_SYNC_STARTED_SIGNAL] = g_signal_new ("sync-started", OBJECTS_TYPE_SOURCE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_source_signals[OBJECTS_SOURCE_SYNC_FINISHED_SIGNAL] = g_signal_new ("sync-finished", OBJECTS_TYPE_SOURCE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	objects_source_signals[OBJECTS_SOURCE_SYNC_FAILED_SIGNAL] = g_signal_new ("sync-failed", OBJECTS_TYPE_SOURCE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, TYPE_SYNC_STATUS);
}

static void
objects_source_instance_init (ObjectsSource * self,
                              gpointer klass)
{
	GDateTime* _tmp0_;
	GDateTime* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	self->priv = objects_source_get_instance_private (self);
	self->priv->_source_type = SOURCE_TYPE_NONE;
	_tmp0_ = g_date_time_new_now_local ();
	_tmp1_ = _tmp0_;
	_tmp2_ = g_date_time_to_string (_tmp1_);
	self->priv->_added_at = _tmp2_;
	_g_date_time_unref0 (_tmp1_);
	_tmp3_ = g_strdup ("");
	self->priv->_updated_at = _tmp3_;
	self->priv->_is_visible = TRUE;
	self->priv->_child_order = 0;
	self->priv->_sync_server = FALSE;
	_tmp4_ = g_strdup ("");
	self->priv->_last_sync = _tmp4_;
	_tmp5_ = g_strdup ("");
	self->priv->_display_name = _tmp5_;
	self->priv->_sync_status = NULL;
	self->priv->server_timeout = (guint) 0;
}

static void
objects_source_finalize (GObject * obj)
{
	ObjectsSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_SOURCE, ObjectsSource);
	_g_free0 (self->priv->_added_at);
	_g_free0 (self->priv->_updated_at);
	_g_free0 (self->priv->_last_sync);
	_g_object_unref0 (self->priv->_data);
	_g_free0 (self->priv->_display_name);
	_g_object_unref0 (self->priv->_sync_status);
	_g_object_unref0 (self->priv->_todoist_data);
	_g_object_unref0 (self->priv->_caldav_data);
	_g_free0 (self->priv->_subheader_text);
	G_OBJECT_CLASS (objects_source_parent_class)->finalize (obj);
}

static GType
objects_source_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ObjectsSourceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) objects_source_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectsSource), 0, (GInstanceInitFunc) objects_source_instance_init, NULL };
	GType objects_source_type_id;
	objects_source_type_id = g_type_register_static (OBJECTS_TYPE_BASE_OBJECT, "ObjectsSource", &g_define_type_info, 0);
	ObjectsSource_private_offset = g_type_add_instance_private (objects_source_type_id, sizeof (ObjectsSourcePrivate));
	return objects_source_type_id;
}

GType
objects_source_get_type (void)
{
	static volatile gsize objects_source_type_id__once = 0;
	if (g_once_init_enter (&objects_source_type_id__once)) {
		GType objects_source_type_id;
		objects_source_type_id = objects_source_get_type_once ();
		g_once_init_leave (&objects_source_type_id__once, objects_source_type_id);
	}
	return objects_source_type_id__once;
}

static void
_vala_objects_source_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec)
{
	ObjectsSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SOURCE, ObjectsSource);
	switch (property_id) {
		case OBJECTS_SOURCE_SOURCE_TYPE_PROPERTY:
		g_value_set_enum (value, objects_source_get_source_type (self));
		break;
		case OBJECTS_SOURCE_ADDED_AT_PROPERTY:
		g_value_set_string (value, objects_source_get_added_at (self));
		break;
		case OBJECTS_SOURCE_UPDATED_AT_PROPERTY:
		g_value_set_string (value, objects_source_get_updated_at (self));
		break;
		case OBJECTS_SOURCE_IS_VISIBLE_PROPERTY:
		g_value_set_boolean (value, objects_source_get_is_visible (self));
		break;
		case OBJECTS_SOURCE_CHILD_ORDER_PROPERTY:
		g_value_set_int (value, objects_source_get_child_order (self));
		break;
		case OBJECTS_SOURCE_SYNC_SERVER_PROPERTY:
		g_value_set_boolean (value, objects_source_get_sync_server (self));
		break;
		case OBJECTS_SOURCE_LAST_SYNC_PROPERTY:
		g_value_set_string (value, objects_source_get_last_sync (self));
		break;
		case OBJECTS_SOURCE_DATA_PROPERTY:
		g_value_set_object (value, objects_source_get_data (self));
		break;
		case OBJECTS_SOURCE_DISPLAY_NAME_PROPERTY:
		g_value_set_string (value, objects_source_get_display_name (self));
		break;
		case OBJECTS_SOURCE_SYNC_STATUS_PROPERTY:
		g_value_set_object (value, objects_source_get_sync_status (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_PROPERTY:
		g_value_set_object (value, objects_source_get_todoist_data (self));
		break;
		case OBJECTS_SOURCE_CALDAV_DATA_PROPERTY:
		g_value_set_object (value, objects_source_get_caldav_data (self));
		break;
		case OBJECTS_SOURCE_HEADER_TEXT_PROPERTY:
		g_value_set_string (value, objects_source_get_header_text (self));
		break;
		case OBJECTS_SOURCE_SUBHEADER_TEXT_PROPERTY:
		g_value_set_string (value, objects_source_get_subheader_text (self));
		break;
		case OBJECTS_SOURCE_AVATAR_PATH_PROPERTY:
		g_value_set_string (value, objects_source_get_avatar_path (self));
		break;
		case OBJECTS_SOURCE_USER_DISPLAYNAME_PROPERTY:
		g_value_set_string (value, objects_source_get_user_displayname (self));
		break;
		case OBJECTS_SOURCE_USER_EMAIL_PROPERTY:
		g_value_set_string (value, objects_source_get_user_email (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_objects_source_set_property (GObject * object,
                                   guint property_id,
                                   const GValue * value,
                                   GParamSpec * pspec)
{
	ObjectsSource * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SOURCE, ObjectsSource);
	switch (property_id) {
		case OBJECTS_SOURCE_SOURCE_TYPE_PROPERTY:
		objects_source_set_source_type (self, g_value_get_enum (value));
		break;
		case OBJECTS_SOURCE_ADDED_AT_PROPERTY:
		objects_source_set_added_at (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_UPDATED_AT_PROPERTY:
		objects_source_set_updated_at (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_IS_VISIBLE_PROPERTY:
		objects_source_set_is_visible (self, g_value_get_boolean (value));
		break;
		case OBJECTS_SOURCE_CHILD_ORDER_PROPERTY:
		objects_source_set_child_order (self, g_value_get_int (value));
		break;
		case OBJECTS_SOURCE_SYNC_SERVER_PROPERTY:
		objects_source_set_sync_server (self, g_value_get_boolean (value));
		break;
		case OBJECTS_SOURCE_LAST_SYNC_PROPERTY:
		objects_source_set_last_sync (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_DATA_PROPERTY:
		objects_source_set_data (self, g_value_get_object (value));
		break;
		case OBJECTS_SOURCE_DISPLAY_NAME_PROPERTY:
		objects_source_set_display_name (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_SYNC_STATUS_PROPERTY:
		objects_source_set_sync_status (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
objects_source_data_get_instance_private (ObjectsSourceData* self)
{
	return G_STRUCT_MEMBER_P (self, ObjectsSourceData_private_offset);
}

static gchar*
objects_source_data_real_to_json (ObjectsSourceData* self)
{
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_strdup ("");
	result = _tmp0_;
	return result;
}

gchar*
objects_source_data_to_json (ObjectsSourceData* self)
{
	ObjectsSourceDataClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = OBJECTS_SOURCE_DATA_GET_CLASS (self);
	if (_klass_->to_json) {
		return _klass_->to_json (self);
	}
	return NULL;
}

ObjectsSourceData*
objects_source_data_construct (GType object_type)
{
	ObjectsSourceData * self = NULL;
	self = (ObjectsSourceData*) g_object_new (object_type, NULL);
	return self;
}

ObjectsSourceData*
objects_source_data_new (void)
{
	return objects_source_data_construct (OBJECTS_TYPE_SOURCE_DATA);
}

JsonBuilder*
objects_source_data_get_builder (ObjectsSourceData* self)
{
	JsonBuilder* result;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_builder;
	if (_tmp0_ == NULL) {
		JsonBuilder* _tmp1_;
		_tmp1_ = json_builder_new ();
		_g_object_unref0 (self->priv->_builder);
		self->priv->_builder = _tmp1_;
	}
	_tmp2_ = self->priv->_builder;
	result = _tmp2_;
	return result;
}

static void
objects_source_data_class_init (ObjectsSourceDataClass * klass,
                                gpointer klass_data)
{
	objects_source_data_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ObjectsSourceData_private_offset);
	((ObjectsSourceDataClass *) klass)->to_json = (gchar* (*) (ObjectsSourceData*)) objects_source_data_real_to_json;
	G_OBJECT_CLASS (klass)->get_property = _vala_objects_source_data_get_property;
	G_OBJECT_CLASS (klass)->finalize = objects_source_data_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_DATA_BUILDER_PROPERTY, objects_source_data_properties[OBJECTS_SOURCE_DATA_BUILDER_PROPERTY] = g_param_spec_object ("builder", "builder", "builder", json_builder_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
objects_source_data_instance_init (ObjectsSourceData * self,
                                   gpointer klass)
{
	self->priv = objects_source_data_get_instance_private (self);
}

static void
objects_source_data_finalize (GObject * obj)
{
	ObjectsSourceData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_SOURCE_DATA, ObjectsSourceData);
	_g_object_unref0 (self->priv->_builder);
	G_OBJECT_CLASS (objects_source_data_parent_class)->finalize (obj);
}

static GType
objects_source_data_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ObjectsSourceDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) objects_source_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectsSourceData), 0, (GInstanceInitFunc) objects_source_data_instance_init, NULL };
	GType objects_source_data_type_id;
	objects_source_data_type_id = g_type_register_static (G_TYPE_OBJECT, "ObjectsSourceData", &g_define_type_info, 0);
	ObjectsSourceData_private_offset = g_type_add_instance_private (objects_source_data_type_id, sizeof (ObjectsSourceDataPrivate));
	return objects_source_data_type_id;
}

GType
objects_source_data_get_type (void)
{
	static volatile gsize objects_source_data_type_id__once = 0;
	if (g_once_init_enter (&objects_source_data_type_id__once)) {
		GType objects_source_data_type_id;
		objects_source_data_type_id = objects_source_data_get_type_once ();
		g_once_init_leave (&objects_source_data_type_id__once, objects_source_data_type_id);
	}
	return objects_source_data_type_id__once;
}

static void
_vala_objects_source_data_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	ObjectsSourceData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SOURCE_DATA, ObjectsSourceData);
	switch (property_id) {
		case OBJECTS_SOURCE_DATA_BUILDER_PROPERTY:
		g_value_set_object (value, objects_source_data_get_builder (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
objects_source_todoist_data_get_instance_private (ObjectsSourceTodoistData* self)
{
	return G_STRUCT_MEMBER_P (self, ObjectsSourceTodoistData_private_offset);
}

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

ObjectsSourceTodoistData*
objects_source_todoist_data_construct_from_json (GType object_type,
                                                 const gchar* json)
{
	ObjectsSourceTodoistData * self = NULL;
	JsonParser* parser = NULL;
	JsonParser* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (json != NULL, NULL);
	self = (ObjectsSourceTodoistData*) objects_source_data_construct (object_type);
	_tmp0_ = json_parser_new ();
	parser = _tmp0_;
	{
		JsonObject* object = NULL;
		JsonNode* _tmp1_;
		JsonObject* _tmp2_;
		JsonObject* _tmp3_;
		JsonObject* _tmp4_;
		JsonObject* _tmp7_;
		JsonObject* _tmp10_;
		JsonObject* _tmp13_;
		JsonObject* _tmp16_;
		JsonObject* _tmp19_;
		JsonObject* _tmp22_;
		JsonObject* _tmp25_;
		JsonObject* _tmp27_;
		json_parser_load_from_data (parser, json, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = json_parser_get_root (parser);
		_tmp2_ = json_node_get_object (_tmp1_);
		_tmp3_ = _json_object_ref0 (_tmp2_);
		object = _tmp3_;
		_tmp4_ = object;
		if (json_object_has_member (_tmp4_, "access_token")) {
			JsonObject* _tmp5_;
			const gchar* _tmp6_;
			_tmp5_ = object;
			_tmp6_ = json_object_get_string_member (_tmp5_, "access_token");
			objects_source_todoist_data_set_access_token (self, _tmp6_);
		}
		_tmp7_ = object;
		if (json_object_has_member (_tmp7_, "sync_token")) {
			JsonObject* _tmp8_;
			const gchar* _tmp9_;
			_tmp8_ = object;
			_tmp9_ = json_object_get_string_member (_tmp8_, "sync_token");
			objects_source_todoist_data_set_sync_token (self, _tmp9_);
		}
		_tmp10_ = object;
		if (json_object_has_member (_tmp10_, "user_id")) {
			JsonObject* _tmp11_;
			const gchar* _tmp12_;
			_tmp11_ = object;
			_tmp12_ = json_object_get_string_member (_tmp11_, "user_id");
			objects_source_todoist_data_set_user_id (self, _tmp12_);
		}
		_tmp13_ = object;
		if (json_object_has_member (_tmp13_, "user_image_id")) {
			JsonObject* _tmp14_;
			const gchar* _tmp15_;
			_tmp14_ = object;
			_tmp15_ = json_object_get_string_member (_tmp14_, "user_image_id");
			objects_source_todoist_data_set_user_image_id (self, _tmp15_);
		}
		_tmp16_ = object;
		if (json_object_has_member (_tmp16_, "user_email")) {
			JsonObject* _tmp17_;
			const gchar* _tmp18_;
			_tmp17_ = object;
			_tmp18_ = json_object_get_string_member (_tmp17_, "user_email");
			objects_source_todoist_data_set_user_email (self, _tmp18_);
		}
		_tmp19_ = object;
		if (json_object_has_member (_tmp19_, "user_name")) {
			JsonObject* _tmp20_;
			const gchar* _tmp21_;
			_tmp20_ = object;
			_tmp21_ = json_object_get_string_member (_tmp20_, "user_name");
			objects_source_todoist_data_set_user_name (self, _tmp21_);
		}
		_tmp22_ = object;
		if (json_object_has_member (_tmp22_, "user_avatar")) {
			JsonObject* _tmp23_;
			const gchar* _tmp24_;
			_tmp23_ = object;
			_tmp24_ = json_object_get_string_member (_tmp23_, "user_avatar");
			objects_source_todoist_data_set_user_avatar (self, _tmp24_);
		}
		_tmp25_ = object;
		if (json_object_has_member (_tmp25_, "user_is_premium")) {
			JsonObject* _tmp26_;
			_tmp26_ = object;
			objects_source_todoist_data_set_user_is_premium (self, json_object_get_boolean_member (_tmp26_, "user_is_premium"));
		}
		_tmp27_ = object;
		if (json_object_has_member (_tmp27_, "api_version")) {
			JsonObject* _tmp28_;
			const gchar* _tmp29_;
			_tmp28_ = object;
			_tmp29_ = json_object_get_string_member (_tmp28_, "api_version");
			objects_source_todoist_data_set_api_version (self, _tmp29_);
		}
		_json_object_unref0 (object);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp30_;
		const gchar* _tmp31_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp30_ = e;
		_tmp31_ = _tmp30_->message;
		g_debug ("Source.vala:292: %s", _tmp31_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (parser);
		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 NULL;
	}
	_g_object_unref0 (parser);
	return self;
}

ObjectsSourceTodoistData*
objects_source_todoist_data_new_from_json (const gchar* json)
{
	return objects_source_todoist_data_construct_from_json (OBJECTS_TYPE_SOURCE_TODOIST_DATA, json);
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static gchar*
objects_source_todoist_data_real_to_json (ObjectsSourceData* base)
{
	ObjectsSourceTodoistData * self;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonBuilder* _tmp2_;
	JsonBuilder* _tmp3_;
	JsonBuilder* _tmp4_;
	JsonBuilder* _tmp5_;
	JsonBuilder* _tmp6_;
	JsonBuilder* _tmp7_;
	const gchar* _tmp8_;
	JsonBuilder* _tmp9_;
	JsonBuilder* _tmp10_;
	JsonBuilder* _tmp11_;
	JsonBuilder* _tmp12_;
	const gchar* _tmp13_;
	JsonBuilder* _tmp14_;
	JsonBuilder* _tmp15_;
	JsonBuilder* _tmp16_;
	JsonBuilder* _tmp17_;
	const gchar* _tmp18_;
	JsonBuilder* _tmp19_;
	JsonBuilder* _tmp20_;
	JsonBuilder* _tmp21_;
	JsonBuilder* _tmp22_;
	const gchar* _tmp23_;
	JsonBuilder* _tmp24_;
	JsonBuilder* _tmp25_;
	JsonBuilder* _tmp26_;
	JsonBuilder* _tmp27_;
	const gchar* _tmp28_;
	JsonBuilder* _tmp29_;
	JsonBuilder* _tmp30_;
	JsonBuilder* _tmp31_;
	JsonBuilder* _tmp32_;
	const gchar* _tmp33_;
	JsonBuilder* _tmp34_;
	JsonBuilder* _tmp35_;
	JsonBuilder* _tmp36_;
	JsonBuilder* _tmp37_;
	const gchar* _tmp38_;
	JsonBuilder* _tmp39_;
	JsonBuilder* _tmp40_;
	JsonBuilder* _tmp41_;
	JsonBuilder* _tmp42_;
	gboolean _tmp43_;
	JsonBuilder* _tmp44_;
	JsonBuilder* _tmp45_;
	JsonBuilder* _tmp46_;
	JsonBuilder* _tmp47_;
	const gchar* _tmp48_;
	JsonBuilder* _tmp49_;
	JsonBuilder* _tmp50_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp51_;
	JsonNode* root = NULL;
	JsonBuilder* _tmp52_;
	JsonBuilder* _tmp53_;
	JsonNode* _tmp54_;
	gchar* _tmp55_;
	gchar* result;
	self = (ObjectsSourceTodoistData*) base;
	_tmp0_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp1_ = _tmp0_;
	json_builder_reset (_tmp1_);
	_tmp2_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp3_ = _tmp2_;
	json_builder_begin_object (_tmp3_);
	_tmp4_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp5_ = _tmp4_;
	json_builder_set_member_name (_tmp5_, "access_token");
	_tmp6_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = self->priv->_access_token;
	json_builder_add_string_value (_tmp7_, _tmp8_);
	_tmp9_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp10_ = _tmp9_;
	json_builder_set_member_name (_tmp10_, "sync_token");
	_tmp11_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp12_ = _tmp11_;
	_tmp13_ = self->priv->_sync_token;
	json_builder_add_string_value (_tmp12_, _tmp13_);
	_tmp14_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp15_ = _tmp14_;
	json_builder_set_member_name (_tmp15_, "user_id");
	_tmp16_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp17_ = _tmp16_;
	_tmp18_ = self->priv->_user_id;
	json_builder_add_string_value (_tmp17_, _tmp18_);
	_tmp19_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp20_ = _tmp19_;
	json_builder_set_member_name (_tmp20_, "user_image_id");
	_tmp21_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp22_ = _tmp21_;
	_tmp23_ = self->priv->_user_image_id;
	json_builder_add_string_value (_tmp22_, _tmp23_);
	_tmp24_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp25_ = _tmp24_;
	json_builder_set_member_name (_tmp25_, "user_email");
	_tmp26_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp27_ = _tmp26_;
	_tmp28_ = self->priv->_user_email;
	json_builder_add_string_value (_tmp27_, _tmp28_);
	_tmp29_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp30_ = _tmp29_;
	json_builder_set_member_name (_tmp30_, "user_name");
	_tmp31_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp32_ = _tmp31_;
	_tmp33_ = self->priv->_user_name;
	json_builder_add_string_value (_tmp32_, _tmp33_);
	_tmp34_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp35_ = _tmp34_;
	json_builder_set_member_name (_tmp35_, "user_avatar");
	_tmp36_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp37_ = _tmp36_;
	_tmp38_ = self->priv->_user_avatar;
	json_builder_add_string_value (_tmp37_, _tmp38_);
	_tmp39_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp40_ = _tmp39_;
	json_builder_set_member_name (_tmp40_, "user_is_premium");
	_tmp41_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp42_ = _tmp41_;
	_tmp43_ = self->priv->_user_is_premium;
	json_builder_add_boolean_value (_tmp42_, _tmp43_);
	_tmp44_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp45_ = _tmp44_;
	json_builder_set_member_name (_tmp45_, "api_version");
	_tmp46_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp47_ = _tmp46_;
	_tmp48_ = self->priv->_api_version;
	json_builder_add_string_value (_tmp47_, _tmp48_);
	_tmp49_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp50_ = _tmp49_;
	json_builder_end_object (_tmp50_);
	_tmp51_ = json_generator_new ();
	generator = _tmp51_;
	_tmp52_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp53_ = _tmp52_;
	_tmp54_ = json_builder_get_root (_tmp53_);
	root = _tmp54_;
	json_generator_set_root (generator, root);
	_tmp55_ = json_generator_to_data (generator, NULL);
	result = _tmp55_;
	__vala_JsonNode_free0 (root);
	_g_object_unref0 (generator);
	return result;
}

ObjectsSourceTodoistData*
objects_source_todoist_data_construct (GType object_type)
{
	ObjectsSourceTodoistData * self = NULL;
	self = (ObjectsSourceTodoistData*) objects_source_data_construct (object_type);
	return self;
}

ObjectsSourceTodoistData*
objects_source_todoist_data_new (void)
{
	return objects_source_todoist_data_construct (OBJECTS_TYPE_SOURCE_TODOIST_DATA);
}

const gchar*
objects_source_todoist_data_get_access_token (ObjectsSourceTodoistData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_access_token;
	result = _tmp0_;
	return result;
}

void
objects_source_todoist_data_set_access_token (ObjectsSourceTodoistData* self,
                                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_access_token (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_access_token);
		self->priv->_access_token = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_ACCESS_TOKEN_PROPERTY]);
	}
}

const gchar*
objects_source_todoist_data_get_sync_token (ObjectsSourceTodoistData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_sync_token;
	result = _tmp0_;
	return result;
}

void
objects_source_todoist_data_set_sync_token (ObjectsSourceTodoistData* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_sync_token (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_sync_token);
		self->priv->_sync_token = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_SYNC_TOKEN_PROPERTY]);
	}
}

const gchar*
objects_source_todoist_data_get_user_id (ObjectsSourceTodoistData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_id;
	result = _tmp0_;
	return result;
}

void
objects_source_todoist_data_set_user_id (ObjectsSourceTodoistData* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_user_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_user_id);
		self->priv->_user_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_ID_PROPERTY]);
	}
}

const gchar*
objects_source_todoist_data_get_user_image_id (ObjectsSourceTodoistData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_image_id;
	result = _tmp0_;
	return result;
}

void
objects_source_todoist_data_set_user_image_id (ObjectsSourceTodoistData* self,
                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_user_image_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_user_image_id);
		self->priv->_user_image_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_IMAGE_ID_PROPERTY]);
	}
}

const gchar*
objects_source_todoist_data_get_user_email (ObjectsSourceTodoistData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_email;
	result = _tmp0_;
	return result;
}

void
objects_source_todoist_data_set_user_email (ObjectsSourceTodoistData* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_user_email (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_user_email);
		self->priv->_user_email = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_EMAIL_PROPERTY]);
	}
}

const gchar*
objects_source_todoist_data_get_user_name (ObjectsSourceTodoistData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_name;
	result = _tmp0_;
	return result;
}

void
objects_source_todoist_data_set_user_name (ObjectsSourceTodoistData* self,
                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_user_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_user_name);
		self->priv->_user_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_NAME_PROPERTY]);
	}
}

const gchar*
objects_source_todoist_data_get_user_avatar (ObjectsSourceTodoistData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_avatar;
	result = _tmp0_;
	return result;
}

void
objects_source_todoist_data_set_user_avatar (ObjectsSourceTodoistData* self,
                                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_user_avatar (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_user_avatar);
		self->priv->_user_avatar = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_AVATAR_PROPERTY]);
	}
}

gboolean
objects_source_todoist_data_get_user_is_premium (ObjectsSourceTodoistData* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_user_is_premium;
	return result;
}

void
objects_source_todoist_data_set_user_is_premium (ObjectsSourceTodoistData* self,
                                                 gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_user_is_premium (self);
	if (old_value != value) {
		self->priv->_user_is_premium = value;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_IS_PREMIUM_PROPERTY]);
	}
}

const gchar*
objects_source_todoist_data_get_api_version (ObjectsSourceTodoistData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_api_version;
	result = _tmp0_;
	return result;
}

void
objects_source_todoist_data_set_api_version (ObjectsSourceTodoistData* self,
                                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_todoist_data_get_api_version (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_api_version);
		self->priv->_api_version = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_API_VERSION_PROPERTY]);
	}
}

static void
objects_source_todoist_data_class_init (ObjectsSourceTodoistDataClass * klass,
                                        gpointer klass_data)
{
	objects_source_todoist_data_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ObjectsSourceTodoistData_private_offset);
	((ObjectsSourceDataClass *) klass)->to_json = (gchar* (*) (ObjectsSourceData*)) objects_source_todoist_data_real_to_json;
	G_OBJECT_CLASS (klass)->get_property = _vala_objects_source_todoist_data_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_objects_source_todoist_data_set_property;
	G_OBJECT_CLASS (klass)->finalize = objects_source_todoist_data_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_ACCESS_TOKEN_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_ACCESS_TOKEN_PROPERTY] = g_param_spec_string ("access-token", "access-token", "access-token", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_SYNC_TOKEN_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_SYNC_TOKEN_PROPERTY] = g_param_spec_string ("sync-token", "sync-token", "sync-token", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_USER_ID_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_ID_PROPERTY] = g_param_spec_string ("user-id", "user-id", "user-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_USER_IMAGE_ID_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_IMAGE_ID_PROPERTY] = g_param_spec_string ("user-image-id", "user-image-id", "user-image-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_USER_EMAIL_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_EMAIL_PROPERTY] = g_param_spec_string ("user-email", "user-email", "user-email", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_USER_NAME_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_NAME_PROPERTY] = g_param_spec_string ("user-name", "user-name", "user-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_USER_AVATAR_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_AVATAR_PROPERTY] = g_param_spec_string ("user-avatar", "user-avatar", "user-avatar", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_USER_IS_PREMIUM_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_USER_IS_PREMIUM_PROPERTY] = g_param_spec_boolean ("user-is-premium", "user-is-premium", "user-is-premium", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_TODOIST_DATA_API_VERSION_PROPERTY, objects_source_todoist_data_properties[OBJECTS_SOURCE_TODOIST_DATA_API_VERSION_PROPERTY] = g_param_spec_string ("api-version", "api-version", "api-version", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
objects_source_todoist_data_instance_init (ObjectsSourceTodoistData * self,
                                           gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	self->priv = objects_source_todoist_data_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_access_token = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_sync_token = _tmp1_;
	_tmp2_ = g_strdup ("");
	self->priv->_user_id = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_user_image_id = _tmp3_;
	_tmp4_ = g_strdup ("");
	self->priv->_user_email = _tmp4_;
	_tmp5_ = g_strdup ("");
	self->priv->_user_name = _tmp5_;
	_tmp6_ = g_strdup ("");
	self->priv->_user_avatar = _tmp6_;
	self->priv->_user_is_premium = FALSE;
	_tmp7_ = g_strdup ("v9");
	self->priv->_api_version = _tmp7_;
}

static void
objects_source_todoist_data_finalize (GObject * obj)
{
	ObjectsSourceTodoistData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_SOURCE_TODOIST_DATA, ObjectsSourceTodoistData);
	_g_free0 (self->priv->_access_token);
	_g_free0 (self->priv->_sync_token);
	_g_free0 (self->priv->_user_id);
	_g_free0 (self->priv->_user_image_id);
	_g_free0 (self->priv->_user_email);
	_g_free0 (self->priv->_user_name);
	_g_free0 (self->priv->_user_avatar);
	_g_free0 (self->priv->_api_version);
	G_OBJECT_CLASS (objects_source_todoist_data_parent_class)->finalize (obj);
}

static GType
objects_source_todoist_data_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ObjectsSourceTodoistDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) objects_source_todoist_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectsSourceTodoistData), 0, (GInstanceInitFunc) objects_source_todoist_data_instance_init, NULL };
	GType objects_source_todoist_data_type_id;
	objects_source_todoist_data_type_id = g_type_register_static (OBJECTS_TYPE_SOURCE_DATA, "ObjectsSourceTodoistData", &g_define_type_info, 0);
	ObjectsSourceTodoistData_private_offset = g_type_add_instance_private (objects_source_todoist_data_type_id, sizeof (ObjectsSourceTodoistDataPrivate));
	return objects_source_todoist_data_type_id;
}

GType
objects_source_todoist_data_get_type (void)
{
	static volatile gsize objects_source_todoist_data_type_id__once = 0;
	if (g_once_init_enter (&objects_source_todoist_data_type_id__once)) {
		GType objects_source_todoist_data_type_id;
		objects_source_todoist_data_type_id = objects_source_todoist_data_get_type_once ();
		g_once_init_leave (&objects_source_todoist_data_type_id__once, objects_source_todoist_data_type_id);
	}
	return objects_source_todoist_data_type_id__once;
}

static void
_vala_objects_source_todoist_data_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	ObjectsSourceTodoistData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SOURCE_TODOIST_DATA, ObjectsSourceTodoistData);
	switch (property_id) {
		case OBJECTS_SOURCE_TODOIST_DATA_ACCESS_TOKEN_PROPERTY:
		g_value_set_string (value, objects_source_todoist_data_get_access_token (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_SYNC_TOKEN_PROPERTY:
		g_value_set_string (value, objects_source_todoist_data_get_sync_token (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_ID_PROPERTY:
		g_value_set_string (value, objects_source_todoist_data_get_user_id (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_IMAGE_ID_PROPERTY:
		g_value_set_string (value, objects_source_todoist_data_get_user_image_id (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_EMAIL_PROPERTY:
		g_value_set_string (value, objects_source_todoist_data_get_user_email (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_NAME_PROPERTY:
		g_value_set_string (value, objects_source_todoist_data_get_user_name (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_AVATAR_PROPERTY:
		g_value_set_string (value, objects_source_todoist_data_get_user_avatar (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_IS_PREMIUM_PROPERTY:
		g_value_set_boolean (value, objects_source_todoist_data_get_user_is_premium (self));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_API_VERSION_PROPERTY:
		g_value_set_string (value, objects_source_todoist_data_get_api_version (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_objects_source_todoist_data_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	ObjectsSourceTodoistData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SOURCE_TODOIST_DATA, ObjectsSourceTodoistData);
	switch (property_id) {
		case OBJECTS_SOURCE_TODOIST_DATA_ACCESS_TOKEN_PROPERTY:
		objects_source_todoist_data_set_access_token (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_SYNC_TOKEN_PROPERTY:
		objects_source_todoist_data_set_sync_token (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_ID_PROPERTY:
		objects_source_todoist_data_set_user_id (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_IMAGE_ID_PROPERTY:
		objects_source_todoist_data_set_user_image_id (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_EMAIL_PROPERTY:
		objects_source_todoist_data_set_user_email (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_NAME_PROPERTY:
		objects_source_todoist_data_set_user_name (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_AVATAR_PROPERTY:
		objects_source_todoist_data_set_user_avatar (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_USER_IS_PREMIUM_PROPERTY:
		objects_source_todoist_data_set_user_is_premium (self, g_value_get_boolean (value));
		break;
		case OBJECTS_SOURCE_TODOIST_DATA_API_VERSION_PROPERTY:
		objects_source_todoist_data_set_api_version (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
objects_source_cal_dav_data_get_instance_private (ObjectsSourceCalDAVData* self)
{
	return G_STRUCT_MEMBER_P (self, ObjectsSourceCalDAVData_private_offset);
}

ObjectsSourceCalDAVData*
objects_source_cal_dav_data_construct_from_json (GType object_type,
                                                 const gchar* json)
{
	ObjectsSourceCalDAVData * self = NULL;
	JsonParser* parser = NULL;
	JsonParser* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_val_if_fail (json != NULL, NULL);
	self = (ObjectsSourceCalDAVData*) objects_source_data_construct (object_type);
	_tmp0_ = json_parser_new ();
	parser = _tmp0_;
	{
		JsonObject* object = NULL;
		JsonNode* _tmp1_;
		JsonObject* _tmp2_;
		JsonObject* _tmp3_;
		JsonObject* _tmp4_;
		JsonObject* _tmp7_;
		JsonObject* _tmp10_;
		JsonObject* _tmp13_;
		JsonObject* _tmp16_;
		JsonObject* _tmp19_;
		JsonObject* _tmp22_;
		JsonObject* _tmp25_;
		JsonObject* _tmp27_;
		json_parser_load_from_data (parser, json, (gssize) -1, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = json_parser_get_root (parser);
		_tmp2_ = json_node_get_object (_tmp1_);
		_tmp3_ = _json_object_ref0 (_tmp2_);
		object = _tmp3_;
		_tmp4_ = object;
		if (json_object_has_member (_tmp4_, "server_url")) {
			JsonObject* _tmp5_;
			const gchar* _tmp6_;
			_tmp5_ = object;
			_tmp6_ = json_object_get_string_member (_tmp5_, "server_url");
			objects_source_cal_dav_data_set_server_url (self, _tmp6_);
		}
		_tmp7_ = object;
		if (json_object_has_member (_tmp7_, "username")) {
			JsonObject* _tmp8_;
			const gchar* _tmp9_;
			_tmp8_ = object;
			_tmp9_ = json_object_get_string_member (_tmp8_, "username");
			objects_source_cal_dav_data_set_username (self, _tmp9_);
		}
		_tmp10_ = object;
		if (json_object_has_member (_tmp10_, "password")) {
			JsonObject* _tmp11_;
			const gchar* _tmp12_;
			_tmp11_ = object;
			_tmp12_ = json_object_get_string_member (_tmp11_, "password");
			objects_source_cal_dav_data_set_password (self, _tmp12_);
		}
		_tmp13_ = object;
		if (json_object_has_member (_tmp13_, "user_displayname")) {
			JsonObject* _tmp14_;
			const gchar* _tmp15_;
			_tmp14_ = object;
			_tmp15_ = json_object_get_string_member (_tmp14_, "user_displayname");
			objects_source_cal_dav_data_set_user_displayname (self, _tmp15_);
		}
		_tmp16_ = object;
		if (json_object_has_member (_tmp16_, "user_email")) {
			JsonObject* _tmp17_;
			const gchar* _tmp18_;
			_tmp17_ = object;
			_tmp18_ = json_object_get_string_member (_tmp17_, "user_email");
			objects_source_cal_dav_data_set_user_email (self, _tmp18_);
		}
		_tmp19_ = object;
		if (json_object_has_member (_tmp19_, "calendar_home_url")) {
			JsonObject* _tmp20_;
			const gchar* _tmp21_;
			_tmp20_ = object;
			_tmp21_ = json_object_get_string_member (_tmp20_, "calendar_home_url");
			objects_source_cal_dav_data_set_calendar_home_url (self, _tmp21_);
		}
		_tmp22_ = object;
		if (json_object_has_member (_tmp22_, "caldav_type")) {
			JsonObject* _tmp23_;
			const gchar* _tmp24_;
			_tmp23_ = object;
			_tmp24_ = json_object_get_string_member (_tmp23_, "caldav_type");
			objects_source_cal_dav_data_set_caldav_type (self, cal_dav_type_parse (_tmp24_));
		}
		_tmp25_ = object;
		if (json_object_has_member (_tmp25_, "ignore_ssl")) {
			JsonObject* _tmp26_;
			_tmp26_ = object;
			objects_source_cal_dav_data_set_ignore_ssl (self, json_object_get_boolean_member (_tmp26_, "ignore_ssl"));
		}
		_tmp27_ = object;
		if (json_object_has_member (_tmp27_, "credentials")) {
			gchar* decoded = NULL;
			JsonObject* _tmp28_;
			const gchar* _tmp29_;
			gsize _tmp30_ = 0;
			guchar* _tmp31_;
			gchar** parts = NULL;
			const gchar* _tmp32_;
			gchar** _tmp33_;
			gchar** _tmp34_;
			gint parts_length1;
			gint _parts_size_;
			gchar** _tmp35_;
			gint _tmp35__length1;
			_tmp28_ = object;
			_tmp29_ = json_object_get_string_member (_tmp28_, "credentials");
			_tmp31_ = g_base64_decode (_tmp29_, &_tmp30_);
			decoded = (gchar*) _tmp31_;
			_tmp32_ = decoded;
			_tmp34_ = _tmp33_ = g_strsplit (_tmp32_, ":", 2);
			parts = _tmp34_;
			parts_length1 = _vala_array_length (_tmp33_);
			_parts_size_ = parts_length1;
			_tmp35_ = parts;
			_tmp35__length1 = parts_length1;
			if (_tmp35__length1 == 2) {
				gchar** _tmp36_;
				gint _tmp36__length1;
				const gchar* _tmp37_;
				_tmp36_ = parts;
				_tmp36__length1 = parts_length1;
				_tmp37_ = _tmp36_[1];
				objects_source_cal_dav_data_set_password (self, _tmp37_);
			}
			parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (decoded);
		}
		_json_object_unref0 (object);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp38_;
		const gchar* _tmp39_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp38_ = e;
		_tmp39_ = _tmp38_->message;
		g_debug ("Source.vala:427: %s", _tmp39_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		_g_object_unref0 (parser);
		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 NULL;
	}
	_g_object_unref0 (parser);
	return self;
}

ObjectsSourceCalDAVData*
objects_source_cal_dav_data_new_from_json (const gchar* json)
{
	return objects_source_cal_dav_data_construct_from_json (OBJECTS_TYPE_SOURCE_CAL_DAV_DATA, json);
}

static gchar*
objects_source_cal_dav_data_real_to_json (ObjectsSourceData* base)
{
	ObjectsSourceCalDAVData * self;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonBuilder* _tmp2_;
	JsonBuilder* _tmp3_;
	JsonBuilder* _tmp4_;
	JsonBuilder* _tmp5_;
	JsonBuilder* _tmp6_;
	JsonBuilder* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	JsonBuilder* _tmp10_;
	JsonBuilder* _tmp11_;
	JsonBuilder* _tmp12_;
	JsonBuilder* _tmp13_;
	const gchar* _tmp14_;
	JsonBuilder* _tmp15_;
	JsonBuilder* _tmp16_;
	JsonBuilder* _tmp17_;
	JsonBuilder* _tmp18_;
	const gchar* _tmp19_;
	JsonBuilder* _tmp20_;
	JsonBuilder* _tmp21_;
	JsonBuilder* _tmp22_;
	JsonBuilder* _tmp23_;
	CalDAVType _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	JsonBuilder* _tmp27_;
	JsonBuilder* _tmp28_;
	JsonBuilder* _tmp29_;
	JsonBuilder* _tmp30_;
	const gchar* _tmp31_;
	JsonBuilder* _tmp32_;
	JsonBuilder* _tmp33_;
	JsonBuilder* _tmp34_;
	JsonBuilder* _tmp35_;
	const gchar* _tmp36_;
	JsonBuilder* _tmp37_;
	JsonBuilder* _tmp38_;
	JsonBuilder* _tmp39_;
	JsonBuilder* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	JsonBuilder* _tmp43_;
	JsonBuilder* _tmp44_;
	JsonBuilder* _tmp45_;
	JsonBuilder* _tmp46_;
	gboolean _tmp47_;
	JsonBuilder* _tmp48_;
	JsonBuilder* _tmp49_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp50_;
	JsonNode* root = NULL;
	JsonBuilder* _tmp51_;
	JsonBuilder* _tmp52_;
	JsonNode* _tmp53_;
	gchar* _tmp54_;
	gchar* result;
	self = (ObjectsSourceCalDAVData*) base;
	_tmp0_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp1_ = _tmp0_;
	json_builder_reset (_tmp1_);
	_tmp2_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp3_ = _tmp2_;
	json_builder_begin_object (_tmp3_);
	_tmp4_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp5_ = _tmp4_;
	json_builder_set_member_name (_tmp5_, "server_url");
	_tmp6_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = objects_source_cal_dav_data_get_server_url (self);
	_tmp9_ = _tmp8_;
	json_builder_add_string_value (_tmp7_, _tmp9_);
	_tmp10_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp11_ = _tmp10_;
	json_builder_set_member_name (_tmp11_, "username");
	_tmp12_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp13_ = _tmp12_;
	_tmp14_ = self->priv->_username;
	json_builder_add_string_value (_tmp13_, _tmp14_);
	_tmp15_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp16_ = _tmp15_;
	json_builder_set_member_name (_tmp16_, "password");
	_tmp17_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp18_ = _tmp17_;
	_tmp19_ = self->priv->_password;
	json_builder_add_string_value (_tmp18_, _tmp19_);
	_tmp20_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp21_ = _tmp20_;
	json_builder_set_member_name (_tmp21_, "caldav_type");
	_tmp22_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp23_ = _tmp22_;
	_tmp24_ = self->priv->_caldav_type;
	_tmp25_ = cal_dav_type_to_string (_tmp24_);
	_tmp26_ = _tmp25_;
	json_builder_add_string_value (_tmp23_, _tmp26_);
	_g_free0 (_tmp26_);
	_tmp27_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp28_ = _tmp27_;
	json_builder_set_member_name (_tmp28_, "user_displayname");
	_tmp29_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp30_ = _tmp29_;
	_tmp31_ = self->priv->_user_displayname;
	json_builder_add_string_value (_tmp30_, _tmp31_);
	_tmp32_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp33_ = _tmp32_;
	json_builder_set_member_name (_tmp33_, "user_email");
	_tmp34_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp35_ = _tmp34_;
	_tmp36_ = self->priv->_user_email;
	json_builder_add_string_value (_tmp35_, _tmp36_);
	_tmp37_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp38_ = _tmp37_;
	json_builder_set_member_name (_tmp38_, "calendar_home_url");
	_tmp39_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp40_ = _tmp39_;
	_tmp41_ = objects_source_cal_dav_data_get_calendar_home_url (self);
	_tmp42_ = _tmp41_;
	json_builder_add_string_value (_tmp40_, _tmp42_);
	_tmp43_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp44_ = _tmp43_;
	json_builder_set_member_name (_tmp44_, "ignore_ssl");
	_tmp45_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp46_ = _tmp45_;
	_tmp47_ = self->priv->_ignore_ssl;
	json_builder_add_boolean_value (_tmp46_, _tmp47_);
	_tmp48_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp49_ = _tmp48_;
	json_builder_end_object (_tmp49_);
	_tmp50_ = json_generator_new ();
	generator = _tmp50_;
	_tmp51_ = objects_source_data_get_builder ((ObjectsSourceData*) self);
	_tmp52_ = _tmp51_;
	_tmp53_ = json_builder_get_root (_tmp52_);
	root = _tmp53_;
	json_generator_set_root (generator, root);
	_tmp54_ = json_generator_to_data (generator, NULL);
	result = _tmp54_;
	__vala_JsonNode_free0 (root);
	_g_object_unref0 (generator);
	return result;
}

ObjectsSourceCalDAVData*
objects_source_cal_dav_data_construct (GType object_type)
{
	ObjectsSourceCalDAVData * self = NULL;
	self = (ObjectsSourceCalDAVData*) objects_source_data_construct (object_type);
	return self;
}

ObjectsSourceCalDAVData*
objects_source_cal_dav_data_new (void)
{
	return objects_source_cal_dav_data_construct (OBJECTS_TYPE_SOURCE_CAL_DAV_DATA);
}

const gchar*
objects_source_cal_dav_data_get_server_url (ObjectsSourceCalDAVData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	const gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_server_url;
	if (!g_str_has_suffix (_tmp0_, "/")) {
		const gchar* _tmp1_;
		gchar* _tmp2_;
		_tmp1_ = self->priv->_server_url;
		_tmp2_ = g_strconcat (_tmp1_, "/", NULL);
		_g_free0 (self->priv->_server_url);
		self->priv->_server_url = _tmp2_;
	}
	_tmp3_ = self->priv->_server_url;
	result = _tmp3_;
	return result;
}

void
objects_source_cal_dav_data_set_server_url (ObjectsSourceCalDAVData* self,
                                            const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_server_url);
	self->priv->_server_url = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_SERVER_URL_PROPERTY]);
}

const gchar*
objects_source_cal_dav_data_get_username (ObjectsSourceCalDAVData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_username;
	result = _tmp0_;
	return result;
}

void
objects_source_cal_dav_data_set_username (ObjectsSourceCalDAVData* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_cal_dav_data_get_username (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_username);
		self->priv->_username = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_USERNAME_PROPERTY]);
	}
}

const gchar*
objects_source_cal_dav_data_get_password (ObjectsSourceCalDAVData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_password;
	result = _tmp0_;
	return result;
}

void
objects_source_cal_dav_data_set_password (ObjectsSourceCalDAVData* self,
                                          const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_cal_dav_data_get_password (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_password);
		self->priv->_password = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_PASSWORD_PROPERTY]);
	}
}

const gchar*
objects_source_cal_dav_data_get_user_displayname (ObjectsSourceCalDAVData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_displayname;
	result = _tmp0_;
	return result;
}

void
objects_source_cal_dav_data_set_user_displayname (ObjectsSourceCalDAVData* self,
                                                  const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_cal_dav_data_get_user_displayname (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_user_displayname);
		self->priv->_user_displayname = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_USER_DISPLAYNAME_PROPERTY]);
	}
}

const gchar*
objects_source_cal_dav_data_get_user_email (ObjectsSourceCalDAVData* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_user_email;
	result = _tmp0_;
	return result;
}

void
objects_source_cal_dav_data_set_user_email (ObjectsSourceCalDAVData* self,
                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_cal_dav_data_get_user_email (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_user_email);
		self->priv->_user_email = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_USER_EMAIL_PROPERTY]);
	}
}

const gchar*
objects_source_cal_dav_data_get_calendar_home_url (ObjectsSourceCalDAVData* self)
{
	const gchar* result;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	const gchar* _tmp10_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->_calendar_home_url;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		const gchar* _tmp2_;
		_tmp2_ = self->priv->_calendar_home_url;
		_tmp0_ = g_strcmp0 (_tmp2_, "") == 0;
	}
	if (_tmp0_) {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp3_ = objects_source_cal_dav_data_get_server_url (self);
		_tmp4_ = _tmp3_;
		_tmp5_ = self->priv->_username;
		_tmp6_ = g_build_filename (_tmp4_, "calendars", _tmp5_, NULL);
		_g_free0 (self->priv->_calendar_home_url);
		self->priv->_calendar_home_url = _tmp6_;
		_tmp7_ = self->priv->_calendar_home_url;
		if (!g_str_has_suffix (_tmp7_, "/")) {
			const gchar* _tmp8_;
			gchar* _tmp9_;
			_tmp8_ = self->priv->_calendar_home_url;
			_tmp9_ = g_strconcat (_tmp8_, "/", NULL);
			_g_free0 (self->priv->_calendar_home_url);
			self->priv->_calendar_home_url = _tmp9_;
		}
	}
	_tmp10_ = self->priv->_calendar_home_url;
	result = _tmp10_;
	return result;
}

void
objects_source_cal_dav_data_set_calendar_home_url (ObjectsSourceCalDAVData* self,
                                                   const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_calendar_home_url);
	self->priv->_calendar_home_url = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_CALENDAR_HOME_URL_PROPERTY]);
}

CalDAVType
objects_source_cal_dav_data_get_caldav_type (ObjectsSourceCalDAVData* self)
{
	CalDAVType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_caldav_type;
	return result;
}

void
objects_source_cal_dav_data_set_caldav_type (ObjectsSourceCalDAVData* self,
                                             CalDAVType value)
{
	CalDAVType old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_cal_dav_data_get_caldav_type (self);
	if (old_value != value) {
		self->priv->_caldav_type = value;
		g_object_notify_by_pspec ((GObject *) self, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_CALDAV_TYPE_PROPERTY]);
	}
}

gboolean
objects_source_cal_dav_data_get_ignore_ssl (ObjectsSourceCalDAVData* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_ignore_ssl;
	return result;
}

void
objects_source_cal_dav_data_set_ignore_ssl (ObjectsSourceCalDAVData* self,
                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_source_cal_dav_data_get_ignore_ssl (self);
	if (old_value != value) {
		self->priv->_ignore_ssl = value;
		g_object_notify_by_pspec ((GObject *) self, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_IGNORE_SSL_PROPERTY]);
	}
}

static void
objects_source_cal_dav_data_class_init (ObjectsSourceCalDAVDataClass * klass,
                                        gpointer klass_data)
{
	objects_source_cal_dav_data_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ObjectsSourceCalDAVData_private_offset);
	((ObjectsSourceDataClass *) klass)->to_json = (gchar* (*) (ObjectsSourceData*)) objects_source_cal_dav_data_real_to_json;
	G_OBJECT_CLASS (klass)->get_property = _vala_objects_source_cal_dav_data_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_objects_source_cal_dav_data_set_property;
	G_OBJECT_CLASS (klass)->finalize = objects_source_cal_dav_data_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CAL_DAV_DATA_SERVER_URL_PROPERTY, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_SERVER_URL_PROPERTY] = g_param_spec_string ("server-url", "server-url", "server-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CAL_DAV_DATA_USERNAME_PROPERTY, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_USERNAME_PROPERTY] = g_param_spec_string ("username", "username", "username", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CAL_DAV_DATA_PASSWORD_PROPERTY, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_PASSWORD_PROPERTY] = g_param_spec_string ("password", "password", "password", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CAL_DAV_DATA_USER_DISPLAYNAME_PROPERTY, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_USER_DISPLAYNAME_PROPERTY] = g_param_spec_string ("user-displayname", "user-displayname", "user-displayname", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CAL_DAV_DATA_USER_EMAIL_PROPERTY, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_USER_EMAIL_PROPERTY] = g_param_spec_string ("user-email", "user-email", "user-email", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CAL_DAV_DATA_CALENDAR_HOME_URL_PROPERTY, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_CALENDAR_HOME_URL_PROPERTY] = g_param_spec_string ("calendar-home-url", "calendar-home-url", "calendar-home-url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CAL_DAV_DATA_CALDAV_TYPE_PROPERTY, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_CALDAV_TYPE_PROPERTY] = g_param_spec_enum ("caldav-type", "caldav-type", "caldav-type", TYPE_CAL_DAV_TYPE, CAL_DAV_TYPE_GENERIC, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_SOURCE_CAL_DAV_DATA_IGNORE_SSL_PROPERTY, objects_source_cal_dav_data_properties[OBJECTS_SOURCE_CAL_DAV_DATA_IGNORE_SSL_PROPERTY] = g_param_spec_boolean ("ignore-ssl", "ignore-ssl", "ignore-ssl", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
objects_source_cal_dav_data_instance_init (ObjectsSourceCalDAVData * self,
                                           gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	self->priv = objects_source_cal_dav_data_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_username = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_password = _tmp1_;
	_tmp2_ = g_strdup ("");
	self->priv->_user_displayname = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_user_email = _tmp3_;
	self->priv->_caldav_type = CAL_DAV_TYPE_GENERIC;
	self->priv->_ignore_ssl = FALSE;
}

static void
objects_source_cal_dav_data_finalize (GObject * obj)
{
	ObjectsSourceCalDAVData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_SOURCE_CAL_DAV_DATA, ObjectsSourceCalDAVData);
	_g_free0 (self->priv->_server_url);
	_g_free0 (self->priv->_username);
	_g_free0 (self->priv->_password);
	_g_free0 (self->priv->_user_displayname);
	_g_free0 (self->priv->_user_email);
	_g_free0 (self->priv->_calendar_home_url);
	G_OBJECT_CLASS (objects_source_cal_dav_data_parent_class)->finalize (obj);
}

static GType
objects_source_cal_dav_data_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ObjectsSourceCalDAVDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) objects_source_cal_dav_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectsSourceCalDAVData), 0, (GInstanceInitFunc) objects_source_cal_dav_data_instance_init, NULL };
	GType objects_source_cal_dav_data_type_id;
	objects_source_cal_dav_data_type_id = g_type_register_static (OBJECTS_TYPE_SOURCE_DATA, "ObjectsSourceCalDAVData", &g_define_type_info, 0);
	ObjectsSourceCalDAVData_private_offset = g_type_add_instance_private (objects_source_cal_dav_data_type_id, sizeof (ObjectsSourceCalDAVDataPrivate));
	return objects_source_cal_dav_data_type_id;
}

GType
objects_source_cal_dav_data_get_type (void)
{
	static volatile gsize objects_source_cal_dav_data_type_id__once = 0;
	if (g_once_init_enter (&objects_source_cal_dav_data_type_id__once)) {
		GType objects_source_cal_dav_data_type_id;
		objects_source_cal_dav_data_type_id = objects_source_cal_dav_data_get_type_once ();
		g_once_init_leave (&objects_source_cal_dav_data_type_id__once, objects_source_cal_dav_data_type_id);
	}
	return objects_source_cal_dav_data_type_id__once;
}

static void
_vala_objects_source_cal_dav_data_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	ObjectsSourceCalDAVData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SOURCE_CAL_DAV_DATA, ObjectsSourceCalDAVData);
	switch (property_id) {
		case OBJECTS_SOURCE_CAL_DAV_DATA_SERVER_URL_PROPERTY:
		g_value_set_string (value, objects_source_cal_dav_data_get_server_url (self));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_USERNAME_PROPERTY:
		g_value_set_string (value, objects_source_cal_dav_data_get_username (self));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_PASSWORD_PROPERTY:
		g_value_set_string (value, objects_source_cal_dav_data_get_password (self));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_USER_DISPLAYNAME_PROPERTY:
		g_value_set_string (value, objects_source_cal_dav_data_get_user_displayname (self));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_USER_EMAIL_PROPERTY:
		g_value_set_string (value, objects_source_cal_dav_data_get_user_email (self));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_CALENDAR_HOME_URL_PROPERTY:
		g_value_set_string (value, objects_source_cal_dav_data_get_calendar_home_url (self));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_CALDAV_TYPE_PROPERTY:
		g_value_set_enum (value, objects_source_cal_dav_data_get_caldav_type (self));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_IGNORE_SSL_PROPERTY:
		g_value_set_boolean (value, objects_source_cal_dav_data_get_ignore_ssl (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_objects_source_cal_dav_data_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	ObjectsSourceCalDAVData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_SOURCE_CAL_DAV_DATA, ObjectsSourceCalDAVData);
	switch (property_id) {
		case OBJECTS_SOURCE_CAL_DAV_DATA_SERVER_URL_PROPERTY:
		objects_source_cal_dav_data_set_server_url (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_USERNAME_PROPERTY:
		objects_source_cal_dav_data_set_username (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_PASSWORD_PROPERTY:
		objects_source_cal_dav_data_set_password (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_USER_DISPLAYNAME_PROPERTY:
		objects_source_cal_dav_data_set_user_displayname (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_USER_EMAIL_PROPERTY:
		objects_source_cal_dav_data_set_user_email (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_CALENDAR_HOME_URL_PROPERTY:
		objects_source_cal_dav_data_set_calendar_home_url (self, g_value_get_string (value));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_CALDAV_TYPE_PROPERTY:
		objects_source_cal_dav_data_set_caldav_type (self, g_value_get_enum (value));
		break;
		case OBJECTS_SOURCE_CAL_DAV_DATA_IGNORE_SSL_PROPERTY:
		objects_source_cal_dav_data_set_ignore_ssl (self, g_value_get_boolean (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);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

