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

/*
 * Copyright © 2026 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 <glib.h>
#include <stdlib.h>
#include <string.h>
#include <json-glib/json-glib.h>
#include <gio/gio.h>
#include <gee.h>
#include <glib-object.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  {
	SERVICES_BACKUP_EXPORTER_0_PROPERTY,
	SERVICES_BACKUP_EXPORTER_NUM_PROPERTIES
};
static GParamSpec* services_backup_exporter_properties[SERVICES_BACKUP_EXPORTER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))

static gpointer services_backup_exporter_parent_class = NULL;
static ServicesBackupExporter* services_backup_exporter__instance;
static ServicesBackupExporter* services_backup_exporter__instance = NULL;

static gchar* services_backup_exporter_safe (ServicesBackupExporter* self,
                                      const gchar* val);
static void _vala_JsonNode_free (JsonNode* self);
static void services_backup_exporter_finalize (GObject * obj);
static GType services_backup_exporter_get_type_once (void);

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

ServicesBackupExporter*
services_backup_exporter_get_default (void)
{
	ServicesBackupExporter* _tmp0_;
	ServicesBackupExporter* _tmp2_;
	ServicesBackupExporter* _tmp3_;
	ServicesBackupExporter* result;
	_tmp0_ = services_backup_exporter__instance;
	if (_tmp0_ == NULL) {
		ServicesBackupExporter* _tmp1_;
		_tmp1_ = services_backup_exporter_new ();
		_g_object_unref0 (services_backup_exporter__instance);
		services_backup_exporter__instance = _tmp1_;
	}
	_tmp2_ = services_backup_exporter__instance;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}

static gchar*
services_backup_exporter_safe (ServicesBackupExporter* self,
                               const gchar* val)
{
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = val;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

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

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

gchar*
services_backup_exporter_export_to_json (ServicesBackupExporter* self)
{
	JsonBuilder* builder = NULL;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonBuilder* _tmp2_;
	JsonBuilder* _tmp3_;
	JsonBuilder* _tmp4_;
	JsonBuilder* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	JsonBuilder* _tmp10_;
	JsonBuilder* _tmp11_;
	JsonBuilder* _tmp12_;
	JsonBuilder* _tmp13_;
	ServicesSettings* _tmp14_;
	ServicesSettings* _tmp15_;
	GSettings* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	JsonBuilder* _tmp19_;
	JsonBuilder* _tmp20_;
	JsonBuilder* _tmp21_;
	JsonBuilder* _tmp92_;
	JsonBuilder* _tmp93_;
	JsonBuilder* _tmp94_;
	JsonBuilder* _tmp153_;
	JsonBuilder* _tmp154_;
	JsonBuilder* _tmp155_;
	JsonBuilder* _tmp317_;
	JsonBuilder* _tmp318_;
	JsonBuilder* _tmp319_;
	JsonBuilder* _tmp388_;
	JsonBuilder* _tmp389_;
	JsonBuilder* _tmp390_;
	JsonBuilder* _tmp551_;
	JsonBuilder* _tmp552_;
	JsonGenerator* generator = NULL;
	JsonGenerator* _tmp553_ = NULL;
	JsonBuilder* _tmp554_;
	JsonNode* _tmp555_;
	JsonNode* _tmp556_;
	gchar* _tmp557_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = json_builder_new ();
	builder = _tmp0_;
	_tmp1_ = builder;
	json_builder_begin_object (_tmp1_);
	_tmp2_ = builder;
	json_builder_set_member_name (_tmp2_, "version");
	_tmp3_ = builder;
	json_builder_add_string_value (_tmp3_, CONSTANTS_BACKUP_VERSION);
	_tmp4_ = builder;
	json_builder_set_member_name (_tmp4_, "date");
	_tmp5_ = builder;
	_tmp6_ = g_date_time_new_now_local ();
	_tmp7_ = _tmp6_;
	_tmp8_ = g_date_time_to_string (_tmp7_);
	_tmp9_ = _tmp8_;
	json_builder_add_string_value (_tmp5_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_date_time_unref0 (_tmp7_);
	_tmp10_ = builder;
	json_builder_set_member_name (_tmp10_, "settings");
	_tmp11_ = builder;
	json_builder_begin_object (_tmp11_);
	_tmp12_ = builder;
	json_builder_set_member_name (_tmp12_, "local-inbox-project-id");
	_tmp13_ = builder;
	_tmp14_ = services_settings_get_default ();
	_tmp15_ = _tmp14_;
	_tmp16_ = _tmp15_->settings;
	_tmp17_ = g_settings_get_string (_tmp16_, "local-inbox-project-id");
	_tmp18_ = _tmp17_;
	json_builder_add_string_value (_tmp13_, _tmp18_);
	_g_free0 (_tmp18_);
	_g_object_unref0 (_tmp15_);
	_tmp19_ = builder;
	json_builder_end_object (_tmp19_);
	_tmp20_ = builder;
	json_builder_set_member_name (_tmp20_, "sources");
	_tmp21_ = builder;
	json_builder_begin_array (_tmp21_);
	{
		GeeArrayList* _source_list = NULL;
		ServicesDatabase* _tmp22_;
		ServicesDatabase* _tmp23_;
		GeeArrayList* _tmp24_;
		GeeArrayList* _tmp25_;
		gint _source_size = 0;
		GeeArrayList* _tmp26_;
		gint _tmp27_;
		gint _tmp28_;
		gint _source_index = 0;
		_tmp22_ = services_database_get_default ();
		_tmp23_ = _tmp22_;
		_tmp24_ = services_database_get_sources_collection (_tmp23_);
		_tmp25_ = _tmp24_;
		_g_object_unref0 (_tmp23_);
		_source_list = _tmp25_;
		_tmp26_ = _source_list;
		_tmp27_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp26_);
		_tmp28_ = _tmp27_;
		_source_size = _tmp28_;
		_source_index = -1;
		while (TRUE) {
			gint _tmp29_;
			gint _tmp30_;
			ObjectsSource* source = NULL;
			GeeArrayList* _tmp31_;
			gpointer _tmp32_;
			JsonBuilder* _tmp33_;
			JsonBuilder* _tmp34_;
			JsonBuilder* _tmp35_;
			ObjectsSource* _tmp36_;
			const gchar* _tmp37_;
			const gchar* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			JsonBuilder* _tmp41_;
			JsonBuilder* _tmp42_;
			ObjectsSource* _tmp43_;
			const gchar* _tmp44_;
			const gchar* _tmp45_;
			gchar* _tmp46_;
			gchar* _tmp47_;
			JsonBuilder* _tmp48_;
			JsonBuilder* _tmp49_;
			ObjectsSource* _tmp50_;
			SourceType _tmp51_;
			SourceType _tmp52_;
			gchar* _tmp53_;
			gchar* _tmp54_;
			JsonBuilder* _tmp55_;
			JsonBuilder* _tmp56_;
			ObjectsSource* _tmp57_;
			const gchar* _tmp58_;
			const gchar* _tmp59_;
			gchar* _tmp60_;
			gchar* _tmp61_;
			JsonBuilder* _tmp62_;
			JsonBuilder* _tmp63_;
			ObjectsSource* _tmp64_;
			const gchar* _tmp65_;
			const gchar* _tmp66_;
			gchar* _tmp67_;
			gchar* _tmp68_;
			JsonBuilder* _tmp69_;
			JsonBuilder* _tmp70_;
			ObjectsSource* _tmp71_;
			gboolean _tmp72_;
			gboolean _tmp73_;
			JsonBuilder* _tmp74_;
			JsonBuilder* _tmp75_;
			ObjectsSource* _tmp76_;
			gint _tmp77_;
			gint _tmp78_;
			ObjectsSource* _tmp79_;
			ObjectsSourceData* _tmp80_;
			ObjectsSourceData* _tmp81_;
			JsonBuilder* _tmp91_;
			_source_index = _source_index + 1;
			_tmp29_ = _source_index;
			_tmp30_ = _source_size;
			if (!(_tmp29_ < _tmp30_)) {
				break;
			}
			_tmp31_ = _source_list;
			_tmp32_ = gee_abstract_list_get ((GeeAbstractList*) _tmp31_, _source_index);
			source = (ObjectsSource*) _tmp32_;
			_tmp33_ = builder;
			json_builder_begin_object (_tmp33_);
			_tmp34_ = builder;
			json_builder_set_member_name (_tmp34_, "id");
			_tmp35_ = builder;
			_tmp36_ = source;
			_tmp37_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp36_);
			_tmp38_ = _tmp37_;
			_tmp39_ = services_backup_exporter_safe (self, _tmp38_);
			_tmp40_ = _tmp39_;
			json_builder_add_string_value (_tmp35_, _tmp40_);
			_g_free0 (_tmp40_);
			_tmp41_ = builder;
			json_builder_set_member_name (_tmp41_, "display_name");
			_tmp42_ = builder;
			_tmp43_ = source;
			_tmp44_ = objects_source_get_display_name (_tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = services_backup_exporter_safe (self, _tmp45_);
			_tmp47_ = _tmp46_;
			json_builder_add_string_value (_tmp42_, _tmp47_);
			_g_free0 (_tmp47_);
			_tmp48_ = builder;
			json_builder_set_member_name (_tmp48_, "source_type");
			_tmp49_ = builder;
			_tmp50_ = source;
			_tmp51_ = objects_source_get_source_type (_tmp50_);
			_tmp52_ = _tmp51_;
			_tmp53_ = source_type_to_string (_tmp52_);
			_tmp54_ = _tmp53_;
			json_builder_add_string_value (_tmp49_, _tmp54_);
			_g_free0 (_tmp54_);
			_tmp55_ = builder;
			json_builder_set_member_name (_tmp55_, "added_at");
			_tmp56_ = builder;
			_tmp57_ = source;
			_tmp58_ = objects_source_get_added_at (_tmp57_);
			_tmp59_ = _tmp58_;
			_tmp60_ = services_backup_exporter_safe (self, _tmp59_);
			_tmp61_ = _tmp60_;
			json_builder_add_string_value (_tmp56_, _tmp61_);
			_g_free0 (_tmp61_);
			_tmp62_ = builder;
			json_builder_set_member_name (_tmp62_, "updated_at");
			_tmp63_ = builder;
			_tmp64_ = source;
			_tmp65_ = objects_source_get_updated_at (_tmp64_);
			_tmp66_ = _tmp65_;
			_tmp67_ = services_backup_exporter_safe (self, _tmp66_);
			_tmp68_ = _tmp67_;
			json_builder_add_string_value (_tmp63_, _tmp68_);
			_g_free0 (_tmp68_);
			_tmp69_ = builder;
			json_builder_set_member_name (_tmp69_, "is_visible");
			_tmp70_ = builder;
			_tmp71_ = source;
			_tmp72_ = objects_source_get_is_visible (_tmp71_);
			_tmp73_ = _tmp72_;
			json_builder_add_boolean_value (_tmp70_, _tmp73_);
			_tmp74_ = builder;
			json_builder_set_member_name (_tmp74_, "child_order");
			_tmp75_ = builder;
			_tmp76_ = source;
			_tmp77_ = objects_source_get_child_order (_tmp76_);
			_tmp78_ = _tmp77_;
			json_builder_add_int_value (_tmp75_, (gint64) _tmp78_);
			_tmp79_ = source;
			_tmp80_ = objects_source_get_data (_tmp79_);
			_tmp81_ = _tmp80_;
			if (_tmp81_ != NULL) {
				JsonBuilder* _tmp82_;
				JsonBuilder* _tmp83_;
				ObjectsSource* _tmp84_;
				ObjectsSourceData* _tmp85_;
				ObjectsSourceData* _tmp86_;
				gchar* _tmp87_;
				gchar* _tmp88_;
				gchar* _tmp89_;
				gchar* _tmp90_;
				_tmp82_ = builder;
				json_builder_set_member_name (_tmp82_, "data");
				_tmp83_ = builder;
				_tmp84_ = source;
				_tmp85_ = objects_source_get_data (_tmp84_);
				_tmp86_ = _tmp85_;
				_tmp87_ = objects_source_data_to_json (_tmp86_);
				_tmp88_ = _tmp87_;
				_tmp89_ = services_backup_exporter_safe (self, _tmp88_);
				_tmp90_ = _tmp89_;
				json_builder_add_string_value (_tmp83_, _tmp90_);
				_g_free0 (_tmp90_);
				_g_free0 (_tmp88_);
			}
			_tmp91_ = builder;
			json_builder_end_object (_tmp91_);
			_g_object_unref0 (source);
		}
		_g_object_unref0 (_source_list);
	}
	_tmp92_ = builder;
	json_builder_end_array (_tmp92_);
	_tmp93_ = builder;
	json_builder_set_member_name (_tmp93_, "labels");
	_tmp94_ = builder;
	json_builder_begin_array (_tmp94_);
	{
		GeeArrayList* _label_list = NULL;
		ServicesDatabase* _tmp95_;
		ServicesDatabase* _tmp96_;
		GeeArrayList* _tmp97_;
		GeeArrayList* _tmp98_;
		gint _label_size = 0;
		GeeArrayList* _tmp99_;
		gint _tmp100_;
		gint _tmp101_;
		gint _label_index = 0;
		_tmp95_ = services_database_get_default ();
		_tmp96_ = _tmp95_;
		_tmp97_ = services_database_get_labels_collection (_tmp96_);
		_tmp98_ = _tmp97_;
		_g_object_unref0 (_tmp96_);
		_label_list = _tmp98_;
		_tmp99_ = _label_list;
		_tmp100_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp99_);
		_tmp101_ = _tmp100_;
		_label_size = _tmp101_;
		_label_index = -1;
		while (TRUE) {
			gint _tmp102_;
			gint _tmp103_;
			ObjectsLabel* label = NULL;
			GeeArrayList* _tmp104_;
			gpointer _tmp105_;
			JsonBuilder* _tmp106_;
			JsonBuilder* _tmp107_;
			JsonBuilder* _tmp108_;
			ObjectsLabel* _tmp109_;
			const gchar* _tmp110_;
			const gchar* _tmp111_;
			gchar* _tmp112_;
			gchar* _tmp113_;
			JsonBuilder* _tmp114_;
			JsonBuilder* _tmp115_;
			ObjectsLabel* _tmp116_;
			const gchar* _tmp117_;
			const gchar* _tmp118_;
			gchar* _tmp119_;
			gchar* _tmp120_;
			JsonBuilder* _tmp121_;
			JsonBuilder* _tmp122_;
			ObjectsLabel* _tmp123_;
			const gchar* _tmp124_;
			const gchar* _tmp125_;
			gchar* _tmp126_;
			gchar* _tmp127_;
			JsonBuilder* _tmp128_;
			JsonBuilder* _tmp129_;
			ObjectsLabel* _tmp130_;
			SourceType _tmp131_;
			SourceType _tmp132_;
			gchar* _tmp133_;
			gchar* _tmp134_;
			JsonBuilder* _tmp135_;
			JsonBuilder* _tmp136_;
			ObjectsLabel* _tmp137_;
			gboolean _tmp138_;
			gboolean _tmp139_;
			JsonBuilder* _tmp140_;
			JsonBuilder* _tmp141_;
			ObjectsLabel* _tmp142_;
			gboolean _tmp143_;
			gboolean _tmp144_;
			JsonBuilder* _tmp145_;
			JsonBuilder* _tmp146_;
			ObjectsLabel* _tmp147_;
			const gchar* _tmp148_;
			const gchar* _tmp149_;
			gchar* _tmp150_;
			gchar* _tmp151_;
			JsonBuilder* _tmp152_;
			_label_index = _label_index + 1;
			_tmp102_ = _label_index;
			_tmp103_ = _label_size;
			if (!(_tmp102_ < _tmp103_)) {
				break;
			}
			_tmp104_ = _label_list;
			_tmp105_ = gee_abstract_list_get ((GeeAbstractList*) _tmp104_, _label_index);
			label = (ObjectsLabel*) _tmp105_;
			_tmp106_ = builder;
			json_builder_begin_object (_tmp106_);
			_tmp107_ = builder;
			json_builder_set_member_name (_tmp107_, "id");
			_tmp108_ = builder;
			_tmp109_ = label;
			_tmp110_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp109_);
			_tmp111_ = _tmp110_;
			_tmp112_ = services_backup_exporter_safe (self, _tmp111_);
			_tmp113_ = _tmp112_;
			json_builder_add_string_value (_tmp108_, _tmp113_);
			_g_free0 (_tmp113_);
			_tmp114_ = builder;
			json_builder_set_member_name (_tmp114_, "name");
			_tmp115_ = builder;
			_tmp116_ = label;
			_tmp117_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp116_);
			_tmp118_ = _tmp117_;
			_tmp119_ = services_backup_exporter_safe (self, _tmp118_);
			_tmp120_ = _tmp119_;
			json_builder_add_string_value (_tmp115_, _tmp120_);
			_g_free0 (_tmp120_);
			_tmp121_ = builder;
			json_builder_set_member_name (_tmp121_, "color");
			_tmp122_ = builder;
			_tmp123_ = label;
			_tmp124_ = objects_base_object_get_color ((ObjectsBaseObject*) _tmp123_);
			_tmp125_ = _tmp124_;
			_tmp126_ = services_backup_exporter_safe (self, _tmp125_);
			_tmp127_ = _tmp126_;
			json_builder_add_string_value (_tmp122_, _tmp127_);
			_g_free0 (_tmp127_);
			_tmp128_ = builder;
			json_builder_set_member_name (_tmp128_, "backend_type");
			_tmp129_ = builder;
			_tmp130_ = label;
			_tmp131_ = objects_label_get_backend_type (_tmp130_);
			_tmp132_ = _tmp131_;
			_tmp133_ = source_type_to_string (_tmp132_);
			_tmp134_ = _tmp133_;
			json_builder_add_string_value (_tmp129_, _tmp134_);
			_g_free0 (_tmp134_);
			_tmp135_ = builder;
			json_builder_set_member_name (_tmp135_, "is_deleted");
			_tmp136_ = builder;
			_tmp137_ = label;
			_tmp138_ = objects_label_get_is_deleted (_tmp137_);
			_tmp139_ = _tmp138_;
			json_builder_add_boolean_value (_tmp136_, _tmp139_);
			_tmp140_ = builder;
			json_builder_set_member_name (_tmp140_, "is_favorite");
			_tmp141_ = builder;
			_tmp142_ = label;
			_tmp143_ = objects_label_get_is_favorite (_tmp142_);
			_tmp144_ = _tmp143_;
			json_builder_add_boolean_value (_tmp141_, _tmp144_);
			_tmp145_ = builder;
			json_builder_set_member_name (_tmp145_, "source_id");
			_tmp146_ = builder;
			_tmp147_ = label;
			_tmp148_ = objects_label_get_source_id (_tmp147_);
			_tmp149_ = _tmp148_;
			_tmp150_ = services_backup_exporter_safe (self, _tmp149_);
			_tmp151_ = _tmp150_;
			json_builder_add_string_value (_tmp146_, _tmp151_);
			_g_free0 (_tmp151_);
			_tmp152_ = builder;
			json_builder_end_object (_tmp152_);
			_g_object_unref0 (label);
		}
		_g_object_unref0 (_label_list);
	}
	_tmp153_ = builder;
	json_builder_end_array (_tmp153_);
	_tmp154_ = builder;
	json_builder_set_member_name (_tmp154_, "projects");
	_tmp155_ = builder;
	json_builder_begin_array (_tmp155_);
	{
		GeeArrayList* _project_list = NULL;
		ServicesDatabase* _tmp156_;
		ServicesDatabase* _tmp157_;
		GeeArrayList* _tmp158_;
		GeeArrayList* _tmp159_;
		gint _project_size = 0;
		GeeArrayList* _tmp160_;
		gint _tmp161_;
		gint _tmp162_;
		gint _project_index = 0;
		_tmp156_ = services_database_get_default ();
		_tmp157_ = _tmp156_;
		_tmp158_ = services_database_get_projects_collection (_tmp157_);
		_tmp159_ = _tmp158_;
		_g_object_unref0 (_tmp157_);
		_project_list = _tmp159_;
		_tmp160_ = _project_list;
		_tmp161_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp160_);
		_tmp162_ = _tmp161_;
		_project_size = _tmp162_;
		_project_index = -1;
		while (TRUE) {
			gint _tmp163_;
			gint _tmp164_;
			ObjectsProject* project = NULL;
			GeeArrayList* _tmp165_;
			gpointer _tmp166_;
			JsonBuilder* _tmp167_;
			JsonBuilder* _tmp168_;
			JsonBuilder* _tmp169_;
			ObjectsProject* _tmp170_;
			const gchar* _tmp171_;
			const gchar* _tmp172_;
			gchar* _tmp173_;
			gchar* _tmp174_;
			JsonBuilder* _tmp175_;
			JsonBuilder* _tmp176_;
			ObjectsProject* _tmp177_;
			const gchar* _tmp178_;
			const gchar* _tmp179_;
			gchar* _tmp180_;
			gchar* _tmp181_;
			JsonBuilder* _tmp182_;
			JsonBuilder* _tmp183_;
			ObjectsProject* _tmp184_;
			const gchar* _tmp185_;
			const gchar* _tmp186_;
			gchar* _tmp187_;
			gchar* _tmp188_;
			JsonBuilder* _tmp189_;
			JsonBuilder* _tmp190_;
			ObjectsProject* _tmp191_;
			SourceType _tmp192_;
			SourceType _tmp193_;
			gchar* _tmp194_;
			gchar* _tmp195_;
			JsonBuilder* _tmp196_;
			JsonBuilder* _tmp197_;
			ObjectsProject* _tmp198_;
			gboolean _tmp199_;
			gboolean _tmp200_;
			JsonBuilder* _tmp201_;
			JsonBuilder* _tmp202_;
			ObjectsProject* _tmp203_;
			gboolean _tmp204_;
			gboolean _tmp205_;
			JsonBuilder* _tmp206_;
			JsonBuilder* _tmp207_;
			ObjectsProject* _tmp208_;
			gint _tmp209_;
			gint _tmp210_;
			JsonBuilder* _tmp211_;
			JsonBuilder* _tmp212_;
			ObjectsProject* _tmp213_;
			gboolean _tmp214_;
			gboolean _tmp215_;
			JsonBuilder* _tmp216_;
			JsonBuilder* _tmp217_;
			ObjectsProject* _tmp218_;
			gboolean _tmp219_;
			gboolean _tmp220_;
			JsonBuilder* _tmp221_;
			JsonBuilder* _tmp222_;
			ObjectsProject* _tmp223_;
			gboolean _tmp224_;
			gboolean _tmp225_;
			JsonBuilder* _tmp226_;
			JsonBuilder* _tmp227_;
			ObjectsProject* _tmp228_;
			gboolean _tmp229_;
			gboolean _tmp230_;
			JsonBuilder* _tmp231_;
			JsonBuilder* _tmp232_;
			ObjectsProject* _tmp233_;
			ProjectViewStyle _tmp234_;
			ProjectViewStyle _tmp235_;
			gchar* _tmp236_;
			gchar* _tmp237_;
			JsonBuilder* _tmp238_;
			JsonBuilder* _tmp239_;
			ObjectsProject* _tmp240_;
			SortOrderType _tmp241_;
			SortOrderType _tmp242_;
			JsonBuilder* _tmp243_;
			JsonBuilder* _tmp244_;
			ObjectsProject* _tmp245_;
			const gchar* _tmp246_;
			const gchar* _tmp247_;
			gchar* _tmp248_;
			gchar* _tmp249_;
			JsonBuilder* _tmp250_;
			JsonBuilder* _tmp251_;
			ObjectsProject* _tmp252_;
			gboolean _tmp253_;
			gboolean _tmp254_;
			JsonBuilder* _tmp255_;
			JsonBuilder* _tmp256_;
			ObjectsProject* _tmp257_;
			ProjectIconStyle _tmp258_;
			ProjectIconStyle _tmp259_;
			gchar* _tmp260_;
			gchar* _tmp261_;
			JsonBuilder* _tmp262_;
			JsonBuilder* _tmp263_;
			ObjectsProject* _tmp264_;
			const gchar* _tmp265_;
			const gchar* _tmp266_;
			gchar* _tmp267_;
			gchar* _tmp268_;
			JsonBuilder* _tmp269_;
			JsonBuilder* _tmp270_;
			ObjectsProject* _tmp271_;
			gboolean _tmp272_;
			gboolean _tmp273_;
			JsonBuilder* _tmp274_;
			JsonBuilder* _tmp275_;
			ObjectsProject* _tmp276_;
			const gchar* _tmp277_;
			const gchar* _tmp278_;
			gchar* _tmp279_;
			gchar* _tmp280_;
			JsonBuilder* _tmp281_;
			JsonBuilder* _tmp282_;
			ObjectsProject* _tmp283_;
			const gchar* _tmp284_;
			const gchar* _tmp285_;
			gchar* _tmp286_;
			gchar* _tmp287_;
			JsonBuilder* _tmp288_;
			JsonBuilder* _tmp289_;
			ObjectsProject* _tmp290_;
			const gchar* _tmp291_;
			const gchar* _tmp292_;
			gchar* _tmp293_;
			gchar* _tmp294_;
			JsonBuilder* _tmp295_;
			JsonBuilder* _tmp296_;
			ObjectsProject* _tmp297_;
			const gchar* _tmp298_;
			const gchar* _tmp299_;
			gchar* _tmp300_;
			gchar* _tmp301_;
			JsonBuilder* _tmp302_;
			JsonBuilder* _tmp303_;
			ObjectsProject* _tmp304_;
			const gchar* _tmp305_;
			const gchar* _tmp306_;
			gchar* _tmp307_;
			gchar* _tmp308_;
			JsonBuilder* _tmp309_;
			JsonBuilder* _tmp310_;
			ObjectsProject* _tmp311_;
			MarkdownSetting _tmp312_;
			MarkdownSetting _tmp313_;
			gchar* _tmp314_;
			gchar* _tmp315_;
			JsonBuilder* _tmp316_;
			_project_index = _project_index + 1;
			_tmp163_ = _project_index;
			_tmp164_ = _project_size;
			if (!(_tmp163_ < _tmp164_)) {
				break;
			}
			_tmp165_ = _project_list;
			_tmp166_ = gee_abstract_list_get ((GeeAbstractList*) _tmp165_, _project_index);
			project = (ObjectsProject*) _tmp166_;
			_tmp167_ = builder;
			json_builder_begin_object (_tmp167_);
			_tmp168_ = builder;
			json_builder_set_member_name (_tmp168_, "id");
			_tmp169_ = builder;
			_tmp170_ = project;
			_tmp171_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp170_);
			_tmp172_ = _tmp171_;
			_tmp173_ = services_backup_exporter_safe (self, _tmp172_);
			_tmp174_ = _tmp173_;
			json_builder_add_string_value (_tmp169_, _tmp174_);
			_g_free0 (_tmp174_);
			_tmp175_ = builder;
			json_builder_set_member_name (_tmp175_, "name");
			_tmp176_ = builder;
			_tmp177_ = project;
			_tmp178_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp177_);
			_tmp179_ = _tmp178_;
			_tmp180_ = services_backup_exporter_safe (self, _tmp179_);
			_tmp181_ = _tmp180_;
			json_builder_add_string_value (_tmp176_, _tmp181_);
			_g_free0 (_tmp181_);
			_tmp182_ = builder;
			json_builder_set_member_name (_tmp182_, "color");
			_tmp183_ = builder;
			_tmp184_ = project;
			_tmp185_ = objects_base_object_get_color ((ObjectsBaseObject*) _tmp184_);
			_tmp186_ = _tmp185_;
			_tmp187_ = services_backup_exporter_safe (self, _tmp186_);
			_tmp188_ = _tmp187_;
			json_builder_add_string_value (_tmp183_, _tmp188_);
			_g_free0 (_tmp188_);
			_tmp189_ = builder;
			json_builder_set_member_name (_tmp189_, "backend_type");
			_tmp190_ = builder;
			_tmp191_ = project;
			_tmp192_ = objects_project_get_backend_type (_tmp191_);
			_tmp193_ = _tmp192_;
			_tmp194_ = source_type_to_string (_tmp193_);
			_tmp195_ = _tmp194_;
			json_builder_add_string_value (_tmp190_, _tmp195_);
			_g_free0 (_tmp195_);
			_tmp196_ = builder;
			json_builder_set_member_name (_tmp196_, "inbox_project");
			_tmp197_ = builder;
			_tmp198_ = project;
			_tmp199_ = objects_project_get_inbox_project (_tmp198_);
			_tmp200_ = _tmp199_;
			json_builder_add_boolean_value (_tmp197_, _tmp200_);
			_tmp201_ = builder;
			json_builder_set_member_name (_tmp201_, "team_inbox");
			_tmp202_ = builder;
			_tmp203_ = project;
			_tmp204_ = objects_project_get_team_inbox (_tmp203_);
			_tmp205_ = _tmp204_;
			json_builder_add_boolean_value (_tmp202_, _tmp205_);
			_tmp206_ = builder;
			json_builder_set_member_name (_tmp206_, "child_order");
			_tmp207_ = builder;
			_tmp208_ = project;
			_tmp209_ = objects_project_get_child_order (_tmp208_);
			_tmp210_ = _tmp209_;
			json_builder_add_int_value (_tmp207_, (gint64) _tmp210_);
			_tmp211_ = builder;
			json_builder_set_member_name (_tmp211_, "is_deleted");
			_tmp212_ = builder;
			_tmp213_ = project;
			_tmp214_ = objects_project_get_is_deleted (_tmp213_);
			_tmp215_ = _tmp214_;
			json_builder_add_boolean_value (_tmp212_, _tmp215_);
			_tmp216_ = builder;
			json_builder_set_member_name (_tmp216_, "is_archived");
			_tmp217_ = builder;
			_tmp218_ = project;
			_tmp219_ = objects_project_get_is_archived (_tmp218_);
			_tmp220_ = _tmp219_;
			json_builder_add_boolean_value (_tmp217_, _tmp220_);
			_tmp221_ = builder;
			json_builder_set_member_name (_tmp221_, "is_favorite");
			_tmp222_ = builder;
			_tmp223_ = project;
			_tmp224_ = objects_project_get_is_favorite (_tmp223_);
			_tmp225_ = _tmp224_;
			json_builder_add_boolean_value (_tmp222_, _tmp225_);
			_tmp226_ = builder;
			json_builder_set_member_name (_tmp226_, "shared");
			_tmp227_ = builder;
			_tmp228_ = project;
			_tmp229_ = objects_project_get_shared (_tmp228_);
			_tmp230_ = _tmp229_;
			json_builder_add_boolean_value (_tmp227_, _tmp230_);
			_tmp231_ = builder;
			json_builder_set_member_name (_tmp231_, "view_style");
			_tmp232_ = builder;
			_tmp233_ = project;
			_tmp234_ = objects_project_get_view_style (_tmp233_);
			_tmp235_ = _tmp234_;
			_tmp236_ = project_view_style_to_string (_tmp235_);
			_tmp237_ = _tmp236_;
			json_builder_add_string_value (_tmp232_, _tmp237_);
			_g_free0 (_tmp237_);
			_tmp238_ = builder;
			json_builder_set_member_name (_tmp238_, "sort_order");
			_tmp239_ = builder;
			_tmp240_ = project;
			_tmp241_ = objects_project_get_sort_order (_tmp240_);
			_tmp242_ = _tmp241_;
			json_builder_add_int_value (_tmp239_, (gint64) _tmp242_);
			_tmp243_ = builder;
			json_builder_set_member_name (_tmp243_, "parent_id");
			_tmp244_ = builder;
			_tmp245_ = project;
			_tmp246_ = objects_project_get_parent_id (_tmp245_);
			_tmp247_ = _tmp246_;
			_tmp248_ = services_backup_exporter_safe (self, _tmp247_);
			_tmp249_ = _tmp248_;
			json_builder_add_string_value (_tmp244_, _tmp249_);
			_g_free0 (_tmp249_);
			_tmp250_ = builder;
			json_builder_set_member_name (_tmp250_, "collapsed");
			_tmp251_ = builder;
			_tmp252_ = project;
			_tmp253_ = objects_project_get_collapsed (_tmp252_);
			_tmp254_ = _tmp253_;
			json_builder_add_boolean_value (_tmp251_, _tmp254_);
			_tmp255_ = builder;
			json_builder_set_member_name (_tmp255_, "icon_style");
			_tmp256_ = builder;
			_tmp257_ = project;
			_tmp258_ = objects_project_get_icon_style (_tmp257_);
			_tmp259_ = _tmp258_;
			_tmp260_ = project_icon_style_to_string (_tmp259_);
			_tmp261_ = _tmp260_;
			json_builder_add_string_value (_tmp256_, _tmp261_);
			_g_free0 (_tmp261_);
			_tmp262_ = builder;
			json_builder_set_member_name (_tmp262_, "emoji");
			_tmp263_ = builder;
			_tmp264_ = project;
			_tmp265_ = objects_project_get_emoji (_tmp264_);
			_tmp266_ = _tmp265_;
			_tmp267_ = services_backup_exporter_safe (self, _tmp266_);
			_tmp268_ = _tmp267_;
			json_builder_add_string_value (_tmp263_, _tmp268_);
			_g_free0 (_tmp268_);
			_tmp269_ = builder;
			json_builder_set_member_name (_tmp269_, "show_completed");
			_tmp270_ = builder;
			_tmp271_ = project;
			_tmp272_ = objects_project_get_show_completed (_tmp271_);
			_tmp273_ = _tmp272_;
			json_builder_add_boolean_value (_tmp270_, _tmp273_);
			_tmp274_ = builder;
			json_builder_set_member_name (_tmp274_, "description");
			_tmp275_ = builder;
			_tmp276_ = project;
			_tmp277_ = objects_project_get_description (_tmp276_);
			_tmp278_ = _tmp277_;
			_tmp279_ = services_backup_exporter_safe (self, _tmp278_);
			_tmp280_ = _tmp279_;
			json_builder_add_string_value (_tmp275_, _tmp280_);
			_g_free0 (_tmp280_);
			_tmp281_ = builder;
			json_builder_set_member_name (_tmp281_, "due_date");
			_tmp282_ = builder;
			_tmp283_ = project;
			_tmp284_ = objects_project_get_due_date (_tmp283_);
			_tmp285_ = _tmp284_;
			_tmp286_ = services_backup_exporter_safe (self, _tmp285_);
			_tmp287_ = _tmp286_;
			json_builder_add_string_value (_tmp282_, _tmp287_);
			_g_free0 (_tmp287_);
			_tmp288_ = builder;
			json_builder_set_member_name (_tmp288_, "sync_id");
			_tmp289_ = builder;
			_tmp290_ = project;
			_tmp291_ = objects_project_get_sync_id (_tmp290_);
			_tmp292_ = _tmp291_;
			_tmp293_ = services_backup_exporter_safe (self, _tmp292_);
			_tmp294_ = _tmp293_;
			json_builder_add_string_value (_tmp289_, _tmp294_);
			_g_free0 (_tmp294_);
			_tmp295_ = builder;
			json_builder_set_member_name (_tmp295_, "source_id");
			_tmp296_ = builder;
			_tmp297_ = project;
			_tmp298_ = objects_project_get_source_id (_tmp297_);
			_tmp299_ = _tmp298_;
			_tmp300_ = services_backup_exporter_safe (self, _tmp299_);
			_tmp301_ = _tmp300_;
			json_builder_add_string_value (_tmp296_, _tmp301_);
			_g_free0 (_tmp301_);
			_tmp302_ = builder;
			json_builder_set_member_name (_tmp302_, "calendar_url");
			_tmp303_ = builder;
			_tmp304_ = project;
			_tmp305_ = objects_project_get_calendar_url (_tmp304_);
			_tmp306_ = _tmp305_;
			_tmp307_ = services_backup_exporter_safe (self, _tmp306_);
			_tmp308_ = _tmp307_;
			json_builder_add_string_value (_tmp303_, _tmp308_);
			_g_free0 (_tmp308_);
			_tmp309_ = builder;
			json_builder_set_member_name (_tmp309_, "markdown_setting");
			_tmp310_ = builder;
			_tmp311_ = project;
			_tmp312_ = objects_project_get_markdown_setting (_tmp311_);
			_tmp313_ = _tmp312_;
			_tmp314_ = markdown_setting_to_string (_tmp313_);
			_tmp315_ = _tmp314_;
			json_builder_add_string_value (_tmp310_, _tmp315_);
			_g_free0 (_tmp315_);
			_tmp316_ = builder;
			json_builder_end_object (_tmp316_);
			_g_object_unref0 (project);
		}
		_g_object_unref0 (_project_list);
	}
	_tmp317_ = builder;
	json_builder_end_array (_tmp317_);
	_tmp318_ = builder;
	json_builder_set_member_name (_tmp318_, "sections");
	_tmp319_ = builder;
	json_builder_begin_array (_tmp319_);
	{
		GeeArrayList* _section_list = NULL;
		ServicesDatabase* _tmp320_;
		ServicesDatabase* _tmp321_;
		GeeArrayList* _tmp322_;
		GeeArrayList* _tmp323_;
		gint _section_size = 0;
		GeeArrayList* _tmp324_;
		gint _tmp325_;
		gint _tmp326_;
		gint _section_index = 0;
		_tmp320_ = services_database_get_default ();
		_tmp321_ = _tmp320_;
		_tmp322_ = services_database_get_sections_collection (_tmp321_);
		_tmp323_ = _tmp322_;
		_g_object_unref0 (_tmp321_);
		_section_list = _tmp323_;
		_tmp324_ = _section_list;
		_tmp325_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp324_);
		_tmp326_ = _tmp325_;
		_section_size = _tmp326_;
		_section_index = -1;
		while (TRUE) {
			gint _tmp327_;
			gint _tmp328_;
			ObjectsSection* section = NULL;
			GeeArrayList* _tmp329_;
			gpointer _tmp330_;
			JsonBuilder* _tmp331_;
			JsonBuilder* _tmp332_;
			JsonBuilder* _tmp333_;
			ObjectsSection* _tmp334_;
			const gchar* _tmp335_;
			const gchar* _tmp336_;
			gchar* _tmp337_;
			gchar* _tmp338_;
			JsonBuilder* _tmp339_;
			JsonBuilder* _tmp340_;
			ObjectsSection* _tmp341_;
			const gchar* _tmp342_;
			const gchar* _tmp343_;
			gchar* _tmp344_;
			gchar* _tmp345_;
			JsonBuilder* _tmp346_;
			JsonBuilder* _tmp347_;
			ObjectsSection* _tmp348_;
			const gchar* _tmp349_;
			const gchar* _tmp350_;
			gchar* _tmp351_;
			gchar* _tmp352_;
			JsonBuilder* _tmp353_;
			JsonBuilder* _tmp354_;
			ObjectsSection* _tmp355_;
			const gchar* _tmp356_;
			const gchar* _tmp357_;
			gchar* _tmp358_;
			gchar* _tmp359_;
			JsonBuilder* _tmp360_;
			JsonBuilder* _tmp361_;
			ObjectsSection* _tmp362_;
			const gchar* _tmp363_;
			const gchar* _tmp364_;
			gchar* _tmp365_;
			gchar* _tmp366_;
			JsonBuilder* _tmp367_;
			JsonBuilder* _tmp368_;
			ObjectsSection* _tmp369_;
			gint _tmp370_;
			gint _tmp371_;
			JsonBuilder* _tmp372_;
			JsonBuilder* _tmp373_;
			ObjectsSection* _tmp374_;
			gboolean _tmp375_;
			gboolean _tmp376_;
			JsonBuilder* _tmp377_;
			JsonBuilder* _tmp378_;
			ObjectsSection* _tmp379_;
			gboolean _tmp380_;
			gboolean _tmp381_;
			JsonBuilder* _tmp382_;
			JsonBuilder* _tmp383_;
			ObjectsSection* _tmp384_;
			gboolean _tmp385_;
			gboolean _tmp386_;
			JsonBuilder* _tmp387_;
			_section_index = _section_index + 1;
			_tmp327_ = _section_index;
			_tmp328_ = _section_size;
			if (!(_tmp327_ < _tmp328_)) {
				break;
			}
			_tmp329_ = _section_list;
			_tmp330_ = gee_abstract_list_get ((GeeAbstractList*) _tmp329_, _section_index);
			section = (ObjectsSection*) _tmp330_;
			_tmp331_ = builder;
			json_builder_begin_object (_tmp331_);
			_tmp332_ = builder;
			json_builder_set_member_name (_tmp332_, "id");
			_tmp333_ = builder;
			_tmp334_ = section;
			_tmp335_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp334_);
			_tmp336_ = _tmp335_;
			_tmp337_ = services_backup_exporter_safe (self, _tmp336_);
			_tmp338_ = _tmp337_;
			json_builder_add_string_value (_tmp333_, _tmp338_);
			_g_free0 (_tmp338_);
			_tmp339_ = builder;
			json_builder_set_member_name (_tmp339_, "name");
			_tmp340_ = builder;
			_tmp341_ = section;
			_tmp342_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp341_);
			_tmp343_ = _tmp342_;
			_tmp344_ = services_backup_exporter_safe (self, _tmp343_);
			_tmp345_ = _tmp344_;
			json_builder_add_string_value (_tmp340_, _tmp345_);
			_g_free0 (_tmp345_);
			_tmp346_ = builder;
			json_builder_set_member_name (_tmp346_, "archived_at");
			_tmp347_ = builder;
			_tmp348_ = section;
			_tmp349_ = objects_section_get_archived_at (_tmp348_);
			_tmp350_ = _tmp349_;
			_tmp351_ = services_backup_exporter_safe (self, _tmp350_);
			_tmp352_ = _tmp351_;
			json_builder_add_string_value (_tmp347_, _tmp352_);
			_g_free0 (_tmp352_);
			_tmp353_ = builder;
			json_builder_set_member_name (_tmp353_, "added_at");
			_tmp354_ = builder;
			_tmp355_ = section;
			_tmp356_ = objects_section_get_added_at (_tmp355_);
			_tmp357_ = _tmp356_;
			_tmp358_ = services_backup_exporter_safe (self, _tmp357_);
			_tmp359_ = _tmp358_;
			json_builder_add_string_value (_tmp354_, _tmp359_);
			_g_free0 (_tmp359_);
			_tmp360_ = builder;
			json_builder_set_member_name (_tmp360_, "project_id");
			_tmp361_ = builder;
			_tmp362_ = section;
			_tmp363_ = objects_section_get_project_id (_tmp362_);
			_tmp364_ = _tmp363_;
			_tmp365_ = services_backup_exporter_safe (self, _tmp364_);
			_tmp366_ = _tmp365_;
			json_builder_add_string_value (_tmp361_, _tmp366_);
			_g_free0 (_tmp366_);
			_tmp367_ = builder;
			json_builder_set_member_name (_tmp367_, "section_order");
			_tmp368_ = builder;
			_tmp369_ = section;
			_tmp370_ = objects_section_get_section_order (_tmp369_);
			_tmp371_ = _tmp370_;
			json_builder_add_int_value (_tmp368_, (gint64) _tmp371_);
			_tmp372_ = builder;
			json_builder_set_member_name (_tmp372_, "collapsed");
			_tmp373_ = builder;
			_tmp374_ = section;
			_tmp375_ = objects_section_get_collapsed (_tmp374_);
			_tmp376_ = _tmp375_;
			json_builder_add_boolean_value (_tmp373_, _tmp376_);
			_tmp377_ = builder;
			json_builder_set_member_name (_tmp377_, "is_deleted");
			_tmp378_ = builder;
			_tmp379_ = section;
			_tmp380_ = objects_section_get_is_deleted (_tmp379_);
			_tmp381_ = _tmp380_;
			json_builder_add_boolean_value (_tmp378_, _tmp381_);
			_tmp382_ = builder;
			json_builder_set_member_name (_tmp382_, "is_archived");
			_tmp383_ = builder;
			_tmp384_ = section;
			_tmp385_ = objects_section_get_is_archived (_tmp384_);
			_tmp386_ = _tmp385_;
			json_builder_add_boolean_value (_tmp383_, _tmp386_);
			_tmp387_ = builder;
			json_builder_end_object (_tmp387_);
			_g_object_unref0 (section);
		}
		_g_object_unref0 (_section_list);
	}
	_tmp388_ = builder;
	json_builder_end_array (_tmp388_);
	_tmp389_ = builder;
	json_builder_set_member_name (_tmp389_, "items");
	_tmp390_ = builder;
	json_builder_begin_array (_tmp390_);
	{
		GeeArrayList* _item_list = NULL;
		ServicesDatabase* _tmp391_;
		ServicesDatabase* _tmp392_;
		GeeArrayList* _tmp393_;
		GeeArrayList* _tmp394_;
		gint _item_size = 0;
		GeeArrayList* _tmp395_;
		gint _tmp396_;
		gint _tmp397_;
		gint _item_index = 0;
		_tmp391_ = services_database_get_default ();
		_tmp392_ = _tmp391_;
		_tmp393_ = services_database_get_items_collection (_tmp392_);
		_tmp394_ = _tmp393_;
		_g_object_unref0 (_tmp392_);
		_item_list = _tmp394_;
		_tmp395_ = _item_list;
		_tmp396_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp395_);
		_tmp397_ = _tmp396_;
		_item_size = _tmp397_;
		_item_index = -1;
		while (TRUE) {
			gint _tmp398_;
			gint _tmp399_;
			ObjectsItem* item = NULL;
			GeeArrayList* _tmp400_;
			gpointer _tmp401_;
			JsonBuilder* _tmp402_;
			JsonBuilder* _tmp403_;
			JsonBuilder* _tmp404_;
			ObjectsItem* _tmp405_;
			const gchar* _tmp406_;
			const gchar* _tmp407_;
			gchar* _tmp408_;
			gchar* _tmp409_;
			JsonBuilder* _tmp410_;
			JsonBuilder* _tmp411_;
			ObjectsItem* _tmp412_;
			const gchar* _tmp413_;
			const gchar* _tmp414_;
			gchar* _tmp415_;
			gchar* _tmp416_;
			JsonBuilder* _tmp417_;
			JsonBuilder* _tmp418_;
			ObjectsItem* _tmp419_;
			const gchar* _tmp420_;
			const gchar* _tmp421_;
			gchar* _tmp422_;
			gchar* _tmp423_;
			JsonBuilder* _tmp424_;
			JsonBuilder* _tmp425_;
			ObjectsItem* _tmp426_;
			ObjectsDueDate* _tmp427_;
			ObjectsDueDate* _tmp428_;
			gchar* _tmp429_;
			gchar* _tmp430_;
			gchar* _tmp431_;
			gchar* _tmp432_;
			JsonBuilder* _tmp433_;
			JsonBuilder* _tmp434_;
			ObjectsItem* _tmp435_;
			const gchar* _tmp436_;
			const gchar* _tmp437_;
			gchar* _tmp438_;
			gchar* _tmp439_;
			JsonBuilder* _tmp440_;
			JsonBuilder* _tmp441_;
			ObjectsItem* _tmp442_;
			const gchar* _tmp443_;
			const gchar* _tmp444_;
			gchar* _tmp445_;
			gchar* _tmp446_;
			JsonBuilder* _tmp447_;
			JsonBuilder* _tmp448_;
			ObjectsItem* _tmp449_;
			const gchar* _tmp450_;
			const gchar* _tmp451_;
			gchar* _tmp452_;
			gchar* _tmp453_;
			JsonBuilder* _tmp454_;
			JsonBuilder* _tmp455_;
			ObjectsItem* _tmp456_;
			const gchar* _tmp457_;
			const gchar* _tmp458_;
			gchar* _tmp459_;
			gchar* _tmp460_;
			JsonBuilder* _tmp461_;
			JsonBuilder* _tmp462_;
			ObjectsItem* _tmp463_;
			const gchar* _tmp464_;
			const gchar* _tmp465_;
			gchar* _tmp466_;
			gchar* _tmp467_;
			JsonBuilder* _tmp468_;
			JsonBuilder* _tmp469_;
			ObjectsItem* _tmp470_;
			const gchar* _tmp471_;
			const gchar* _tmp472_;
			gchar* _tmp473_;
			gchar* _tmp474_;
			JsonBuilder* _tmp475_;
			JsonBuilder* _tmp476_;
			ObjectsItem* _tmp477_;
			gint _tmp478_;
			gint _tmp479_;
			JsonBuilder* _tmp480_;
			JsonBuilder* _tmp481_;
			ObjectsItem* _tmp482_;
			gint _tmp483_;
			gint _tmp484_;
			JsonBuilder* _tmp485_;
			JsonBuilder* _tmp486_;
			ObjectsItem* _tmp487_;
			gboolean _tmp488_;
			gboolean _tmp489_;
			JsonBuilder* _tmp490_;
			JsonBuilder* _tmp491_;
			ObjectsItem* _tmp492_;
			gboolean _tmp493_;
			gboolean _tmp494_;
			JsonBuilder* _tmp495_;
			JsonBuilder* _tmp496_;
			ObjectsItem* _tmp497_;
			gint _tmp498_;
			gint _tmp499_;
			JsonBuilder* _tmp500_;
			JsonBuilder* _tmp501_;
			ObjectsItem* _tmp502_;
			gboolean _tmp503_;
			gboolean _tmp504_;
			JsonBuilder* _tmp505_;
			JsonBuilder* _tmp506_;
			ObjectsItem* _tmp507_;
			gboolean _tmp508_;
			gboolean _tmp509_;
			JsonBuilder* _tmp510_;
			JsonBuilder* _tmp511_;
			JsonBuilder* _tmp528_;
			JsonBuilder* _tmp529_;
			JsonBuilder* _tmp530_;
			ObjectsItem* _tmp531_;
			const gchar* _tmp532_;
			const gchar* _tmp533_;
			gchar* _tmp534_;
			gchar* _tmp535_;
			JsonBuilder* _tmp536_;
			JsonBuilder* _tmp537_;
			ObjectsItem* _tmp538_;
			const gchar* _tmp539_;
			const gchar* _tmp540_;
			gchar* _tmp541_;
			gchar* _tmp542_;
			JsonBuilder* _tmp543_;
			JsonBuilder* _tmp544_;
			ObjectsItem* _tmp545_;
			ItemType _tmp546_;
			ItemType _tmp547_;
			gchar* _tmp548_;
			gchar* _tmp549_;
			JsonBuilder* _tmp550_;
			_item_index = _item_index + 1;
			_tmp398_ = _item_index;
			_tmp399_ = _item_size;
			if (!(_tmp398_ < _tmp399_)) {
				break;
			}
			_tmp400_ = _item_list;
			_tmp401_ = gee_abstract_list_get ((GeeAbstractList*) _tmp400_, _item_index);
			item = (ObjectsItem*) _tmp401_;
			_tmp402_ = builder;
			json_builder_begin_object (_tmp402_);
			_tmp403_ = builder;
			json_builder_set_member_name (_tmp403_, "id");
			_tmp404_ = builder;
			_tmp405_ = item;
			_tmp406_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp405_);
			_tmp407_ = _tmp406_;
			_tmp408_ = services_backup_exporter_safe (self, _tmp407_);
			_tmp409_ = _tmp408_;
			json_builder_add_string_value (_tmp404_, _tmp409_);
			_g_free0 (_tmp409_);
			_tmp410_ = builder;
			json_builder_set_member_name (_tmp410_, "content");
			_tmp411_ = builder;
			_tmp412_ = item;
			_tmp413_ = objects_item_get_content (_tmp412_);
			_tmp414_ = _tmp413_;
			_tmp415_ = services_backup_exporter_safe (self, _tmp414_);
			_tmp416_ = _tmp415_;
			json_builder_add_string_value (_tmp411_, _tmp416_);
			_g_free0 (_tmp416_);
			_tmp417_ = builder;
			json_builder_set_member_name (_tmp417_, "description");
			_tmp418_ = builder;
			_tmp419_ = item;
			_tmp420_ = objects_item_get_description (_tmp419_);
			_tmp421_ = _tmp420_;
			_tmp422_ = services_backup_exporter_safe (self, _tmp421_);
			_tmp423_ = _tmp422_;
			json_builder_add_string_value (_tmp418_, _tmp423_);
			_g_free0 (_tmp423_);
			_tmp424_ = builder;
			json_builder_set_member_name (_tmp424_, "due");
			_tmp425_ = builder;
			_tmp426_ = item;
			_tmp427_ = objects_item_get_due (_tmp426_);
			_tmp428_ = _tmp427_;
			_tmp429_ = objects_due_date_to_string (_tmp428_);
			_tmp430_ = _tmp429_;
			_tmp431_ = services_backup_exporter_safe (self, _tmp430_);
			_tmp432_ = _tmp431_;
			json_builder_add_string_value (_tmp425_, _tmp432_);
			_g_free0 (_tmp432_);
			_g_free0 (_tmp430_);
			_tmp433_ = builder;
			json_builder_set_member_name (_tmp433_, "added_at");
			_tmp434_ = builder;
			_tmp435_ = item;
			_tmp436_ = objects_item_get_added_at (_tmp435_);
			_tmp437_ = _tmp436_;
			_tmp438_ = services_backup_exporter_safe (self, _tmp437_);
			_tmp439_ = _tmp438_;
			json_builder_add_string_value (_tmp434_, _tmp439_);
			_g_free0 (_tmp439_);
			_tmp440_ = builder;
			json_builder_set_member_name (_tmp440_, "completed_at");
			_tmp441_ = builder;
			_tmp442_ = item;
			_tmp443_ = objects_item_get_completed_at (_tmp442_);
			_tmp444_ = _tmp443_;
			_tmp445_ = services_backup_exporter_safe (self, _tmp444_);
			_tmp446_ = _tmp445_;
			json_builder_add_string_value (_tmp441_, _tmp446_);
			_g_free0 (_tmp446_);
			_tmp447_ = builder;
			json_builder_set_member_name (_tmp447_, "updated_at");
			_tmp448_ = builder;
			_tmp449_ = item;
			_tmp450_ = objects_item_get_updated_at (_tmp449_);
			_tmp451_ = _tmp450_;
			_tmp452_ = services_backup_exporter_safe (self, _tmp451_);
			_tmp453_ = _tmp452_;
			json_builder_add_string_value (_tmp448_, _tmp453_);
			_g_free0 (_tmp453_);
			_tmp454_ = builder;
			json_builder_set_member_name (_tmp454_, "section_id");
			_tmp455_ = builder;
			_tmp456_ = item;
			_tmp457_ = objects_item_get_section_id (_tmp456_);
			_tmp458_ = _tmp457_;
			_tmp459_ = services_backup_exporter_safe (self, _tmp458_);
			_tmp460_ = _tmp459_;
			json_builder_add_string_value (_tmp455_, _tmp460_);
			_g_free0 (_tmp460_);
			_tmp461_ = builder;
			json_builder_set_member_name (_tmp461_, "project_id");
			_tmp462_ = builder;
			_tmp463_ = item;
			_tmp464_ = objects_item_get_project_id (_tmp463_);
			_tmp465_ = _tmp464_;
			_tmp466_ = services_backup_exporter_safe (self, _tmp465_);
			_tmp467_ = _tmp466_;
			json_builder_add_string_value (_tmp462_, _tmp467_);
			_g_free0 (_tmp467_);
			_tmp468_ = builder;
			json_builder_set_member_name (_tmp468_, "parent_id");
			_tmp469_ = builder;
			_tmp470_ = item;
			_tmp471_ = objects_item_get_parent_id (_tmp470_);
			_tmp472_ = _tmp471_;
			_tmp473_ = services_backup_exporter_safe (self, _tmp472_);
			_tmp474_ = _tmp473_;
			json_builder_add_string_value (_tmp469_, _tmp474_);
			_g_free0 (_tmp474_);
			_tmp475_ = builder;
			json_builder_set_member_name (_tmp475_, "priority");
			_tmp476_ = builder;
			_tmp477_ = item;
			_tmp478_ = objects_item_get_priority (_tmp477_);
			_tmp479_ = _tmp478_;
			json_builder_add_int_value (_tmp476_, (gint64) _tmp479_);
			_tmp480_ = builder;
			json_builder_set_member_name (_tmp480_, "child_order");
			_tmp481_ = builder;
			_tmp482_ = item;
			_tmp483_ = objects_item_get_child_order (_tmp482_);
			_tmp484_ = _tmp483_;
			json_builder_add_int_value (_tmp481_, (gint64) _tmp484_);
			_tmp485_ = builder;
			json_builder_set_member_name (_tmp485_, "checked");
			_tmp486_ = builder;
			_tmp487_ = item;
			_tmp488_ = objects_item_get_checked (_tmp487_);
			_tmp489_ = _tmp488_;
			json_builder_add_boolean_value (_tmp486_, _tmp489_);
			_tmp490_ = builder;
			json_builder_set_member_name (_tmp490_, "is_deleted");
			_tmp491_ = builder;
			_tmp492_ = item;
			_tmp493_ = objects_item_get_is_deleted (_tmp492_);
			_tmp494_ = _tmp493_;
			json_builder_add_boolean_value (_tmp491_, _tmp494_);
			_tmp495_ = builder;
			json_builder_set_member_name (_tmp495_, "day_order");
			_tmp496_ = builder;
			_tmp497_ = item;
			_tmp498_ = objects_item_get_day_order (_tmp497_);
			_tmp499_ = _tmp498_;
			json_builder_add_int_value (_tmp496_, (gint64) _tmp499_);
			_tmp500_ = builder;
			json_builder_set_member_name (_tmp500_, "collapsed");
			_tmp501_ = builder;
			_tmp502_ = item;
			_tmp503_ = objects_item_get_collapsed (_tmp502_);
			_tmp504_ = _tmp503_;
			json_builder_add_boolean_value (_tmp501_, _tmp504_);
			_tmp505_ = builder;
			json_builder_set_member_name (_tmp505_, "pinned");
			_tmp506_ = builder;
			_tmp507_ = item;
			_tmp508_ = objects_item_get_pinned (_tmp507_);
			_tmp509_ = _tmp508_;
			json_builder_add_boolean_value (_tmp506_, _tmp509_);
			_tmp510_ = builder;
			json_builder_set_member_name (_tmp510_, "labels");
			_tmp511_ = builder;
			json_builder_begin_array (_tmp511_);
			{
				GeeArrayList* _label_list = NULL;
				ObjectsItem* _tmp512_;
				GeeArrayList* _tmp513_;
				GeeArrayList* _tmp514_;
				gint _label_size = 0;
				GeeArrayList* _tmp515_;
				gint _tmp516_;
				gint _tmp517_;
				gint _label_index = 0;
				_tmp512_ = item;
				_tmp513_ = objects_item_get_labels (_tmp512_);
				_tmp514_ = _tmp513_;
				_label_list = _tmp514_;
				_tmp515_ = _label_list;
				_tmp516_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp515_);
				_tmp517_ = _tmp516_;
				_label_size = _tmp517_;
				_label_index = -1;
				while (TRUE) {
					gint _tmp518_;
					gint _tmp519_;
					ObjectsLabel* label = NULL;
					GeeArrayList* _tmp520_;
					gpointer _tmp521_;
					JsonBuilder* _tmp522_;
					ObjectsLabel* _tmp523_;
					const gchar* _tmp524_;
					const gchar* _tmp525_;
					gchar* _tmp526_;
					gchar* _tmp527_;
					_label_index = _label_index + 1;
					_tmp518_ = _label_index;
					_tmp519_ = _label_size;
					if (!(_tmp518_ < _tmp519_)) {
						break;
					}
					_tmp520_ = _label_list;
					_tmp521_ = gee_abstract_list_get ((GeeAbstractList*) _tmp520_, _label_index);
					label = (ObjectsLabel*) _tmp521_;
					_tmp522_ = builder;
					_tmp523_ = label;
					_tmp524_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp523_);
					_tmp525_ = _tmp524_;
					_tmp526_ = services_backup_exporter_safe (self, _tmp525_);
					_tmp527_ = _tmp526_;
					json_builder_add_string_value (_tmp522_, _tmp527_);
					_g_free0 (_tmp527_);
					_g_object_unref0 (label);
				}
			}
			_tmp528_ = builder;
			json_builder_end_array (_tmp528_);
			_tmp529_ = builder;
			json_builder_set_member_name (_tmp529_, "extra_data");
			_tmp530_ = builder;
			_tmp531_ = item;
			_tmp532_ = objects_item_get_extra_data (_tmp531_);
			_tmp533_ = _tmp532_;
			_tmp534_ = services_backup_exporter_safe (self, _tmp533_);
			_tmp535_ = _tmp534_;
			json_builder_add_string_value (_tmp530_, _tmp535_);
			_g_free0 (_tmp535_);
			_tmp536_ = builder;
			json_builder_set_member_name (_tmp536_, "deadline_date");
			_tmp537_ = builder;
			_tmp538_ = item;
			_tmp539_ = objects_item_get_deadline_date (_tmp538_);
			_tmp540_ = _tmp539_;
			_tmp541_ = services_backup_exporter_safe (self, _tmp540_);
			_tmp542_ = _tmp541_;
			json_builder_add_string_value (_tmp537_, _tmp542_);
			_g_free0 (_tmp542_);
			_tmp543_ = builder;
			json_builder_set_member_name (_tmp543_, "item_type");
			_tmp544_ = builder;
			_tmp545_ = item;
			_tmp546_ = objects_item_get_item_type (_tmp545_);
			_tmp547_ = _tmp546_;
			_tmp548_ = item_type_to_string (_tmp547_);
			_tmp549_ = _tmp548_;
			json_builder_add_string_value (_tmp544_, _tmp549_);
			_g_free0 (_tmp549_);
			_tmp550_ = builder;
			json_builder_end_object (_tmp550_);
			_g_object_unref0 (item);
		}
		_g_object_unref0 (_item_list);
	}
	_tmp551_ = builder;
	json_builder_end_array (_tmp551_);
	_tmp552_ = builder;
	json_builder_end_object (_tmp552_);
	_tmp553_ = json_generator_new ();
	json_generator_set_pretty (_tmp553_, TRUE);
	generator = _tmp553_;
	_tmp554_ = builder;
	_tmp555_ = json_builder_get_root (_tmp554_);
	_tmp556_ = _tmp555_;
	json_generator_set_root (generator, _tmp556_);
	__vala_JsonNode_free0 (_tmp556_);
	_tmp557_ = json_generator_to_data (generator, NULL);
	result = _tmp557_;
	_g_object_unref0 (generator);
	_g_object_unref0 (builder);
	return result;
}

ServicesBackupExporter*
services_backup_exporter_construct (GType object_type)
{
	ServicesBackupExporter * self = NULL;
	self = (ServicesBackupExporter*) g_object_new (object_type, NULL);
	return self;
}

ServicesBackupExporter*
services_backup_exporter_new (void)
{
	return services_backup_exporter_construct (SERVICES_TYPE_BACKUP_EXPORTER);
}

static void
services_backup_exporter_class_init (ServicesBackupExporterClass * klass,
                                     gpointer klass_data)
{
	services_backup_exporter_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = services_backup_exporter_finalize;
}

static void
services_backup_exporter_instance_init (ServicesBackupExporter * self,
                                        gpointer klass)
{
}

static void
services_backup_exporter_finalize (GObject * obj)
{
	ServicesBackupExporter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, SERVICES_TYPE_BACKUP_EXPORTER, ServicesBackupExporter);
	G_OBJECT_CLASS (services_backup_exporter_parent_class)->finalize (obj);
}

static GType
services_backup_exporter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ServicesBackupExporterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) services_backup_exporter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ServicesBackupExporter), 0, (GInstanceInitFunc) services_backup_exporter_instance_init, NULL };
	GType services_backup_exporter_type_id;
	services_backup_exporter_type_id = g_type_register_static (G_TYPE_OBJECT, "ServicesBackupExporter", &g_define_type_info, 0);
	return services_backup_exporter_type_id;
}

GType
services_backup_exporter_get_type (void)
{
	static volatile gsize services_backup_exporter_type_id__once = 0;
	if (g_once_init_enter (&services_backup_exporter_type_id__once)) {
		GType services_backup_exporter_type_id;
		services_backup_exporter_type_id = services_backup_exporter_get_type_once ();
		g_once_init_leave (&services_backup_exporter_type_id__once, services_backup_exporter_type_id);
	}
	return services_backup_exporter_type_id__once;
}

