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

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <json-glib/json-glib.h>
#include <gobject/gvaluecollector.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define DC_TYPE_RPC_CLIENT (dc_rpc_client_get_type ())
#define DC_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_RPC_CLIENT, DcRpcClient))
#define DC_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_RPC_CLIENT, DcRpcClientClass))
#define DC_IS_RPC_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_RPC_CLIENT))
#define DC_IS_RPC_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_RPC_CLIENT))
#define DC_RPC_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_RPC_CLIENT, DcRpcClientClass))

typedef struct _DcRpcClient DcRpcClient;
typedef struct _DcRpcClientClass DcRpcClientClass;
typedef struct _DcRpcClientPrivate DcRpcClientPrivate;

#define DC_TYPE_PENDING_CALL (dc_pending_call_get_type ())
#define DC_PENDING_CALL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_PENDING_CALL, DcPendingCall))
#define DC_PENDING_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_PENDING_CALL, DcPendingCallClass))
#define DC_IS_PENDING_CALL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_PENDING_CALL))
#define DC_IS_PENDING_CALL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_PENDING_CALL))
#define DC_PENDING_CALL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_PENDING_CALL, DcPendingCallClass))

typedef struct _DcPendingCall DcPendingCall;
typedef struct _DcPendingCallClass DcPendingCallClass;
enum  {
	DC_RPC_CLIENT_0_PROPERTY,
	DC_RPC_CLIENT_IS_CONNECTED_PROPERTY,
	DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY,
	DC_RPC_CLIENT_SELF_EMAIL_PROPERTY,
	DC_RPC_CLIENT_NUM_PROPERTIES
};
static GParamSpec* dc_rpc_client_properties[DC_RPC_CLIENT_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define DC_TYPE_PARAMS (dc_params_get_type ())
#define DC_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_PARAMS, DcParams))
#define DC_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_PARAMS, DcParamsClass))
#define DC_IS_PARAMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_PARAMS))
#define DC_IS_PARAMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_PARAMS))
#define DC_PARAMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_PARAMS, DcParamsClass))

typedef struct _DcParams DcParams;
typedef struct _DcParamsClass DcParamsClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _DcRpcClientStartData DcRpcClientStartData;
typedef struct _DcRpcClientDrainStderrData DcRpcClientDrainStderrData;
typedef struct _DcRpcClientNapData DcRpcClientNapData;
typedef struct _DcPendingCallPrivate DcPendingCallPrivate;
#define _dc_pending_call_unref0(var) ((var == NULL) ? NULL : (var = (dc_pending_call_unref (var), NULL)))
typedef struct _DcRpcClientCallData DcRpcClientCallData;
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
typedef struct _DcRpcClientReadLoopData DcRpcClientReadLoopData;
typedef struct _DcRpcClientGetAllAccountsData DcRpcClientGetAllAccountsData;
typedef struct _DcRpcClientAddAccountData DcRpcClientAddAccountData;
typedef struct _DcRpcClientSelectAccountData DcRpcClientSelectAccountData;
typedef struct _DcRpcClientIsConfiguredData DcRpcClientIsConfiguredData;
typedef struct _DcRpcClientRemoveAccountData DcRpcClientRemoveAccountData;
typedef struct _DcRpcClientStartIoData DcRpcClientStartIoData;
typedef struct _DcRpcClientStopIoData DcRpcClientStopIoData;
typedef struct _DcRpcClientGetConnectivityData DcRpcClientGetConnectivityData;
typedef struct _DcRpcClientGetConnectivityHtmlData DcRpcClientGetConnectivityHtmlData;
typedef struct _DcRpcClientGetAccountFileSizeData DcRpcClientGetAccountFileSizeData;
typedef struct _DcRpcClientGetBlobDirData DcRpcClientGetBlobDirData;
typedef struct _DcRpcClientAddTransportFromQrData DcRpcClientAddTransportFromQrData;
typedef struct _DcRpcClientGetBackupData DcRpcClientGetBackupData;
typedef struct _DcRpcClientProvideBackupData DcRpcClientProvideBackupData;
typedef struct _DcRpcClientGetBackupQrData DcRpcClientGetBackupQrData;
typedef struct _DcRpcClientCreateQrSvgData DcRpcClientCreateQrSvgData;
typedef struct _DcRpcClientGetChatSecurejoinQrCodeData DcRpcClientGetChatSecurejoinQrCodeData;
typedef struct _DcRpcClientStopOngoingProcessData DcRpcClientStopOngoingProcessData;
typedef struct _DcRpcClientCheckQrData DcRpcClientCheckQrData;
typedef struct _DcRpcClientSecureJoinData DcRpcClientSecureJoinData;
typedef struct _DcRpcClientAddOrUpdateTransportData DcRpcClientAddOrUpdateTransportData;
typedef struct _DcRpcClientListTransportsData DcRpcClientListTransportsData;
typedef struct _DcRpcClientDeleteTransportData DcRpcClientDeleteTransportData;
typedef struct _DcRpcClientBatchSetConfigData DcRpcClientBatchSetConfigData;
typedef struct _DcRpcClientGetConfigData DcRpcClientGetConfigData;
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
typedef struct _DcRpcClientGetChatlistEntriesData DcRpcClientGetChatlistEntriesData;
typedef struct _DcRpcClientGetChatlistEntriesForData DcRpcClientGetChatlistEntriesForData;
typedef struct _DcRpcClientGetChatlistItemsByEntriesData DcRpcClientGetChatlistItemsByEntriesData;
typedef struct _DcRpcClientGetChatlistItemsByEntriesForData DcRpcClientGetChatlistItemsByEntriesForData;
typedef struct _DcRpcClientGetFullChatByIdData DcRpcClientGetFullChatByIdData;
typedef struct _DcRpcClientGetMessageIdsData DcRpcClientGetMessageIdsData;
typedef struct _DcRpcClientGetMessageIdsForData DcRpcClientGetMessageIdsForData;
typedef struct _DcRpcClientGetMessageData DcRpcClientGetMessageData;

#define DC_TYPE_MESSAGE (dc_message_get_type ())
#define DC_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_MESSAGE, DcMessage))
#define DC_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_MESSAGE, DcMessageClass))
#define DC_IS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_MESSAGE))
#define DC_IS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_MESSAGE))
#define DC_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_MESSAGE, DcMessageClass))

typedef struct _DcMessage DcMessage;
typedef struct _DcMessageClass DcMessageClass;
typedef struct _DcRpcClientFetchMessageData DcRpcClientFetchMessageData;
typedef struct _DcRpcClientGetMessagesData DcRpcClientGetMessagesData;
typedef struct _DcRpcClientGetMessagesForData DcRpcClientGetMessagesForData;
typedef struct _DcRpcClientSendMsgData DcRpcClientSendMsgData;
typedef struct _DcRpcClientSendEditRequestData DcRpcClientSendEditRequestData;
typedef struct _DcRpcClientSendReactionData DcRpcClientSendReactionData;
typedef struct _DcRpcClientMarknoticedChatData DcRpcClientMarknoticedChatData;
typedef struct _DcRpcClientMarkSeenMsgsData DcRpcClientMarkSeenMsgsData;
typedef struct _DcRpcClientGetNextEventData DcRpcClientGetNextEventData;
typedef struct _DcRpcClientGetContactIdsData DcRpcClientGetContactIdsData;
typedef struct _DcRpcClientGetContactIdsForData DcRpcClientGetContactIdsForData;
typedef struct _DcRpcClientCreateContactData DcRpcClientCreateContactData;
typedef struct _DcRpcClientLookupContactData DcRpcClientLookupContactData;
typedef struct _DcRpcClientGetOrCreateContactData DcRpcClientGetOrCreateContactData;
typedef struct _DcRpcClientGetOrCreateChatByContactData DcRpcClientGetOrCreateChatByContactData;
typedef struct _DcRpcClientCreateGroupData DcRpcClientCreateGroupData;
typedef struct _DcRpcClientLeaveGroupData DcRpcClientLeaveGroupData;
typedef struct _DcRpcClientDeleteChatData DcRpcClientDeleteChatData;
typedef struct _DcRpcClientSetChatVisibilityData DcRpcClientSetChatVisibilityData;
typedef struct _DcRpcClientDeleteMessagesData DcRpcClientDeleteMessagesData;
typedef struct _DcRpcClientForwardMessagesData DcRpcClientForwardMessagesData;
typedef struct _DcRpcClientDeleteMessagesForAllData DcRpcClientDeleteMessagesForAllData;
typedef struct _DcRpcClientGetContactForData DcRpcClientGetContactForData;
typedef struct _DcRpcClientGetContactData DcRpcClientGetContactData;
typedef struct _DcRpcClientAddContactToChatData DcRpcClientAddContactToChatData;
typedef struct _DcRpcClientRemoveContactFromChatData DcRpcClientRemoveContactFromChatData;
typedef struct _DcRpcClientSetChatProfileImageData DcRpcClientSetChatProfileImageData;
typedef struct _DcRpcClientSetChatEphemeralTimerData DcRpcClientSetChatEphemeralTimerData;

#define DC_TYPE_CONTACT (dc_contact_get_type ())
#define DC_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_CONTACT, DcContact))
#define DC_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_CONTACT, DcContactClass))
#define DC_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_CONTACT))
#define DC_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_CONTACT))
#define DC_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_CONTACT, DcContactClass))

typedef struct _DcContact DcContact;
typedef struct _DcContactClass DcContactClass;
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

#define DC_TYPE_CHAT_ENTRY (dc_chat_entry_get_type ())
#define DC_CHAT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DC_TYPE_CHAT_ENTRY, DcChatEntry))
#define DC_CHAT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DC_TYPE_CHAT_ENTRY, DcChatEntryClass))
#define DC_IS_CHAT_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DC_TYPE_CHAT_ENTRY))
#define DC_IS_CHAT_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DC_TYPE_CHAT_ENTRY))
#define DC_CHAT_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DC_TYPE_CHAT_ENTRY, DcChatEntryClass))

typedef struct _DcChatEntry DcChatEntry;
typedef struct _DcChatEntryClass DcChatEntryClass;
enum  {
	DC_RPC_CLIENT_DISCONNECTED_SIGNAL,
	DC_RPC_CLIENT_NUM_SIGNALS
};
static guint dc_rpc_client_signals[DC_RPC_CLIENT_NUM_SIGNALS] = {0};
typedef struct _DcParamSpecPendingCall DcParamSpecPendingCall;
typedef struct _DcParamsPrivate DcParamsPrivate;
enum  {
	DC_PARAMS_0_PROPERTY,
	DC_PARAMS_NUM_PROPERTIES
};
static GParamSpec* dc_params_properties[DC_PARAMS_NUM_PROPERTIES];

struct _DcRpcClient {
	GObject parent_instance;
	DcRpcClientPrivate * priv;
};

struct _DcRpcClientClass {
	GObjectClass parent_class;
};

struct _DcRpcClientPrivate {
	GSubprocess* process;
	GDataInputStream* reader;
	GOutputStream* writer;
	gint next_id;
	GPtrArray* pending;
	gchar* last_stderr;
	gboolean _is_connected;
	gint _account_id;
	gchar* _self_email;
};

struct _DcRpcClientStartData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar** argv;
	gint argv_length1;
	gchar* cwd;
	gchar* accounts_path;
	GSubprocessFlags flags;
	GSubprocessLauncher* launcher;
	GSubprocessLauncher* _tmp0_;
	GSubprocessLauncher* _tmp1_;
	GSubprocessLauncher* _tmp2_;
	GSubprocess* _tmp3_;
	GSubprocessLauncher* _tmp4_;
	GSubprocess* _tmp5_;
	GSubprocess* _tmp6_;
	GSubprocess* _tmp7_;
	GOutputStream* _tmp8_;
	GOutputStream* _tmp9_;
	GSubprocess* _tmp10_;
	GInputStream* _tmp11_;
	GDataInputStream* _tmp12_;
	GDataInputStream* _tmp13_;
	DcParams* _tmp14_;
	DcParams* _tmp15_;
	JsonNode* _tmp16_;
	JsonNode* _tmp17_;
	JsonNode* _tmp18_;
	JsonNode* _tmp19_;
	GError* e;
	const gchar* _tmp20_;
	gint _tmp21_;
	gint _tmp22_;
	const gchar* _tmp23_;
	GError* _tmp24_;
	GError* _tmp25_;
	GError* _tmp26_;
	GError* _inner_error0_;
};

struct _DcRpcClientDrainStderrData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	GSubprocess* _tmp0_;
	GDataInputStream* err_stream;
	GSubprocess* _tmp1_;
	GInputStream* _tmp2_;
	GDataInputStream* _tmp3_;
	gchar* line;
	gsize len;
	gchar* _tmp4_;
	GDataInputStream* _tmp5_;
	gsize _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientNapData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	guint ms;
};

struct _DcPendingCall {
	GTypeInstance parent_instance;
	volatile int ref_count;
	DcPendingCallPrivate * priv;
	gint id;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	JsonNode* result;
	gchar* error_msg;
};

struct _DcPendingCallClass {
	GTypeClass parent_class;
	void (*finalize) (DcPendingCall *self);
};

struct _DcRpcClientCallData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* method;
	JsonNode* params;
	JsonNode* result;
	gboolean _tmp0_;
	GOutputStream* _tmp1_;
	GDataInputStream* _tmp2_;
	GError* _tmp3_;
	gint id;
	gint _tmp4_;
	DcPendingCall* pc;
	DcPendingCall* _tmp5_;
	DcPendingCall* _tmp6_;
	GPtrArray* _tmp7_;
	DcPendingCall* _tmp8_;
	DcPendingCall* _tmp9_;
	DcPendingCall* _tmp10_;
	const gchar* _tmp11_;
	DcPendingCall* _tmp12_;
	const gchar* _tmp13_;
	GError* _tmp14_;
	DcPendingCall* _tmp15_;
	JsonNode* _tmp16_;
	JsonNode* _tmp17_;
	GError* _inner_error0_;
};

struct _DcRpcClientReadLoopData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gsize len;
	gchar* line;
	GDataInputStream* _tmp0_;
	gsize _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	gboolean _tmp9_;
	JsonParser* parser;
	JsonParser* _tmp10_;
	JsonParser* _tmp11_;
	const gchar* _tmp12_;
	JsonNode* root;
	JsonParser* _tmp13_;
	JsonNode* _tmp14_;
	JsonNode* _tmp15_;
	gboolean _tmp16_;
	JsonNode* _tmp17_;
	JsonNode* _tmp18_;
	JsonObject* obj;
	JsonNode* _tmp19_;
	JsonObject* _tmp20_;
	JsonObject* _tmp21_;
	JsonObject* _tmp22_;
	gint resp_id;
	JsonObject* _tmp23_;
	DcPendingCall* pc;
	DcPendingCall* _tmp24_;
	DcPendingCall* _tmp25_;
	gboolean _tmp26_;
	JsonObject* _tmp27_;
	JsonObject* _tmp28_;
	JsonNode* _tmp29_;
	JsonObject* err;
	JsonObject* _tmp30_;
	JsonObject* _tmp31_;
	JsonObject* _tmp32_;
	const gchar* _tmp33_;
	JsonObject* _tmp34_;
	JsonObject* _tmp35_;
	const gchar* _tmp36_;
	DcPendingCall* _tmp37_;
	gchar* _tmp38_;
	JsonObject* _tmp39_;
	JsonNode* result_member;
	JsonObject* _tmp40_;
	JsonNode* _tmp41_;
	JsonNode* _tmp42_;
	JsonNode* _tmp43_;
	JsonNode* _tmp44_;
	JsonNode* _tmp45_;
	JsonNode* _tmp46_;
	DcPendingCall* _tmp47_;
	JsonNode* _tmp48_;
	DcPendingCall* _tmp49_;
	GSourceFunc _tmp50_;
	gpointer _tmp50__target;
	GSourceFunc cb;
	DcPendingCall* _tmp51_;
	GSourceFunc _tmp52_;
	gpointer _tmp52__target;
	GDestroyNotify _tmp52__target_destroy_notify;
	gpointer cb_target;
	GDestroyNotify cb_target_destroy_notify;
	DcPendingCall* _tmp53_;
	GSourceFunc _tmp54_;
	gpointer _tmp54__target;
	GDestroyNotify _tmp54__target_destroy_notify;
	GError* e;
	GError* _tmp55_;
	const gchar* _tmp56_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetAllAccountsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	JsonNode* result;
	JsonNode* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientAddAccountData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	GError* _inner_error0_;
};

struct _DcRpcClientSelectAccountData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientIsConfiguredData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gboolean result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientRemoveAccountData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientStartIoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientStopIoData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetConnectivityData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint result;
	gint _tmp0_;
	gint _tmp1_;
	gint id;
	JsonNode* _result_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetConnectivityHtmlData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* result;
	gint _tmp0_;
	gint _tmp1_;
	gint id;
	JsonNode* _result_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetAccountFileSizeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint64 result;
	gint _tmp0_;
	gint _tmp1_;
	gint id;
	JsonNode* _result_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetBlobDirData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* result;
	gint _tmp0_;
	gint _tmp1_;
	gint id;
	JsonNode* _result_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientAddTransportFromQrData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetBackupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientProvideBackupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetBackupQrData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientCreateQrSvgData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* text;
	gchar* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatSecurejoinQrCodeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint chat_id;
	gchar* result;
	DcParams* p;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	JsonNode* _result_;
	DcParams* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	JsonNode* _tmp13_;
	JsonNode* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	GError* _inner_error0_;
};

struct _DcRpcClientStopOngoingProcessData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	GError* _inner_error0_;
};

struct _DcRpcClientCheckQrData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	gboolean _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSecureJoinData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* qr_text;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientAddOrUpdateTransportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* email;
	gchar* password;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	DcParams* _tmp10_;
	DcParams* _tmp11_;
	DcParams* _tmp12_;
	DcParams* _tmp13_;
	DcParams* _tmp14_;
	DcParams* _tmp15_;
	DcParams* _tmp16_;
	DcParams* _tmp17_;
	DcParams* _tmp18_;
	DcParams* _tmp19_;
	DcParams* _tmp20_;
	DcParams* _tmp21_;
	DcParams* _tmp22_;
	DcParams* _tmp23_;
	DcParams* _tmp24_;
	DcParams* _tmp25_;
	DcParams* _tmp26_;
	DcParams* _tmp27_;
	DcParams* _tmp28_;
	DcParams* _tmp29_;
	DcParams* _tmp30_;
	DcParams* _tmp31_;
	DcParams* _tmp32_;
	DcParams* _tmp33_;
	JsonNode* _tmp34_;
	JsonNode* _tmp35_;
	JsonNode* _tmp36_;
	JsonNode* _tmp37_;
	GError* _inner_error0_;
};

struct _DcRpcClientListTransportsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	JsonNode* result;
	JsonNode* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	JsonNode* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientDeleteTransportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* addr;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	GError* _inner_error0_;
};

struct _DcRpcClientBatchSetConfigData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* key;
	gchar* val;
	gint acct_id;
	gint _tmp0_;
	gint _tmp1_;
	gint id;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	DcParams* _tmp10_;
	DcParams* _tmp11_;
	JsonNode* _tmp12_;
	JsonNode* _tmp13_;
	JsonNode* _tmp14_;
	JsonNode* _tmp15_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetConfigData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* key;
	gint acct_id;
	gchar* result;
	gint _tmp0_;
	gint _tmp1_;
	gint id;
	JsonNode* _result_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	gboolean _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatlistEntriesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* query;
	JsonArray* result;
	JsonArray* _tmp0_;
	gint _tmp1_;
	JsonArray* _tmp2_;
	JsonArray* _tmp3_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatlistEntriesForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* query;
	JsonArray* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	JsonNode* _tmp13_;
	JsonArray* _tmp14_;
	JsonArray* _tmp15_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatlistItemsByEntriesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	JsonArray* entries;
	JsonObject* result;
	JsonObject* _tmp0_;
	gint _tmp1_;
	JsonObject* _tmp2_;
	JsonObject* _tmp3_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetChatlistItemsByEntriesForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	JsonArray* entries;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetFullChatByIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessageIdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gboolean info_only;
	JsonArray* result;
	JsonArray* _tmp0_;
	gint _tmp1_;
	JsonArray* _tmp2_;
	JsonArray* _tmp3_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessageIdsForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint chat_id;
	gboolean info_only;
	JsonArray* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	JsonNode* _tmp13_;
	JsonArray* _tmp14_;
	JsonArray* _tmp15_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientFetchMessageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	DcMessage* result;
	JsonObject* obj;
	JsonObject* _tmp0_;
	const gchar* _tmp1_;
	DcMessage* _tmp2_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessagesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	JsonObject* result;
	JsonObject* _tmp0_;
	gint _tmp1_;
	JsonObject* _tmp2_;
	JsonObject* _tmp3_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetMessagesForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint* msg_ids;
	gint msg_ids_length1;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonObject* _tmp10_;
	JsonObject* _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientSendMsgData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar* text;
	gchar* file_path;
	gchar* file_name;
	gint quoted_msg_id;
	gint result;
	DcParams* p;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	DcParams* _tmp9_;
	DcParams* _tmp10_;
	DcParams* _tmp11_;
	DcParams* _tmp12_;
	DcParams* _tmp13_;
	DcParams* _tmp14_;
	DcParams* _tmp15_;
	DcParams* _tmp16_;
	DcParams* _tmp17_;
	DcParams* _tmp18_;
	DcParams* _tmp19_;
	DcParams* _tmp20_;
	JsonNode* _result_;
	DcParams* _tmp21_;
	JsonNode* _tmp22_;
	JsonNode* _tmp23_;
	JsonNode* _tmp24_;
	JsonNode* _tmp25_;
	gboolean _tmp26_;
	JsonNode* _tmp27_;
	JsonNode* _tmp28_;
	JsonArray* arr;
	JsonNode* _tmp29_;
	JsonArray* _tmp30_;
	JsonArray* _tmp31_;
	JsonArray* _tmp32_;
	JsonArray* _tmp33_;
	GError* _inner_error0_;
};

struct _DcRpcClientSendEditRequestData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	gchar* new_text;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSendReactionData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint msg_id;
	gchar** emojis;
	gint emojis_length1;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientMarknoticedChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientMarkSeenMsgsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetNextEventData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* _tmp5_;
	gboolean _tmp6_;
	JsonObject* _tmp7_;
	JsonObject* _tmp8_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetContactIdsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* query;
	JsonArray* result;
	JsonArray* _tmp0_;
	gint _tmp1_;
	JsonArray* _tmp2_;
	JsonArray* _tmp3_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetContactIdsForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gchar* query;
	JsonArray* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	gboolean _tmp12_;
	JsonArray* _tmp13_;
	JsonArray* _tmp14_;
	GError* _inner_error0_;
};

struct _DcRpcClientCreateContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* email;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientLookupContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* email;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	gboolean _tmp11_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetOrCreateContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* email;
	gint result;
	gint contact_id;
	gint _tmp0_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetOrCreateChatByContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint contact_id;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	JsonNode* _tmp13_;
	JsonNode* _tmp14_;
	JsonNode* _tmp15_;
	JsonNode* _tmp16_;
	JsonNode* _tmp17_;
	DcParams* _tmp18_;
	DcParams* _tmp19_;
	gint _tmp20_;
	DcParams* _tmp21_;
	DcParams* _tmp22_;
	DcParams* _tmp23_;
	DcParams* _tmp24_;
	JsonNode* _tmp25_;
	JsonNode* _tmp26_;
	JsonNode* _tmp27_;
	JsonNode* _tmp28_;
	JsonNode* _tmp29_;
	JsonNode* _tmp30_;
	GError* _inner_error0_;
};

struct _DcRpcClientCreateGroupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gchar* name;
	gboolean protect;
	gint result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientLeaveGroupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientDeleteChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetChatVisibilityData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar* visibility;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientDeleteMessagesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientForwardMessagesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	gint chat_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientDeleteMessagesForAllData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint* msg_ids;
	gint msg_ids_length1;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetContactForData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint acct_id;
	gint contact_id;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	DcParams* _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	gboolean _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientGetContactData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint contact_id;
	JsonObject* result;
	JsonNode* _result_;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	JsonNode* _tmp7_;
	JsonNode* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonObject* _tmp11_;
	JsonObject* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientAddContactToChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gint contact_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientRemoveContactFromChatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gint contact_id;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetChatProfileImageData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gchar* image_path;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcRpcClientSetChatEphemeralTimerData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	DcRpcClient* self;
	gint chat_id;
	gint timer;
	DcParams* _tmp0_;
	DcParams* _tmp1_;
	gint _tmp2_;
	DcParams* _tmp3_;
	DcParams* _tmp4_;
	DcParams* _tmp5_;
	DcParams* _tmp6_;
	DcParams* _tmp7_;
	DcParams* _tmp8_;
	JsonNode* _tmp9_;
	JsonNode* _tmp10_;
	JsonNode* _tmp11_;
	JsonNode* _tmp12_;
	GError* _inner_error0_;
};

struct _DcParamSpecPendingCall {
	GParamSpec parent_instance;
};

struct _DcParams {
	GObject parent_instance;
	DcParamsPrivate * priv;
};

struct _DcParamsClass {
	GObjectClass parent_class;
};

struct _DcParamsPrivate {
	JsonBuilder* b;
};

static gint DcRpcClient_private_offset;
static gpointer dc_rpc_client_parent_class = NULL;
static gpointer dc_pending_call_parent_class = NULL;
static gint DcParams_private_offset;
static gpointer dc_params_parent_class = NULL;

VALA_EXTERN GType dc_rpc_client_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcRpcClient, g_object_unref)
VALA_EXTERN gpointer dc_pending_call_ref (gpointer instance);
VALA_EXTERN void dc_pending_call_unref (gpointer instance);
VALA_EXTERN GParamSpec* dc_param_spec_pending_call (const gchar* name,
                                        const gchar* nick,
                                        const gchar* blurb,
                                        GType object_type,
                                        GParamFlags flags);
VALA_EXTERN void dc_value_set_pending_call (GValue* value,
                                gpointer v_object);
VALA_EXTERN void dc_value_take_pending_call (GValue* value,
                                 gpointer v_object);
VALA_EXTERN gpointer dc_value_get_pending_call (const GValue* value);
VALA_EXTERN GType dc_pending_call_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcPendingCall, dc_pending_call_unref)
static void _dc_pending_call_unref0_ (gpointer var);
static void dc_rpc_client_start_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_start (DcRpcClient* self,
                          gchar** argv,
                          gint argv_length1,
                          const gchar* cwd,
                          const gchar* accounts_path,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_start_finish (DcRpcClient* self,
                                 GAsyncResult* _res_,
                                 GError** error);
static gboolean dc_rpc_client_start_co (DcRpcClientStartData* _data_);
static void dc_rpc_client_drain_stderr (DcRpcClient* self,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
static void dc_rpc_client_drain_stderr_finish (DcRpcClient* self,
                                        GAsyncResult* _res_);
static void dc_rpc_client_read_loop (DcRpcClient* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
static void dc_rpc_client_read_loop_finish (DcRpcClient* self,
                                     GAsyncResult* _res_);
VALA_EXTERN void dc_rpc_client_call (DcRpcClient* self,
                         const gchar* method,
                         JsonNode* params,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_);
VALA_EXTERN JsonNode* dc_rpc_client_call_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error);
VALA_EXTERN GType dc_params_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcParams, g_object_unref)
VALA_EXTERN DcParams* dc_params_begin (void);
VALA_EXTERN JsonNode* dc_params_build (DcParams* self);
static void dc_rpc_client_start_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_);
static void _vala_JsonNode_free (JsonNode* self);
static void dc_rpc_client_nap (DcRpcClient* self,
                        guint ms,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_);
static void dc_rpc_client_nap_finish (DcRpcClient* self,
                               GAsyncResult* _res_);
static void dc_rpc_client_set_is_connected (DcRpcClient* self,
                                     gboolean value);
static void dc_rpc_client_drain_stderr_data_free (gpointer _data);
static gboolean dc_rpc_client_drain_stderr_co (DcRpcClientDrainStderrData* _data_);
static void dc_rpc_client_drain_stderr_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void dc_rpc_client_nap_data_free (gpointer _data);
static gboolean dc_rpc_client_nap_co (DcRpcClientNapData* _data_);
static gboolean _dc_rpc_client_nap_co_gsource_func (gpointer self);
VALA_EXTERN void dc_rpc_client_stop (DcRpcClient* self);
static void dc_rpc_client_call_data_free (gpointer _data);
static JsonNode* _vala_JsonNode_copy (JsonNode* self);
static gboolean dc_rpc_client_call_co (DcRpcClientCallData* _data_);
static void dc_rpc_client_send_request (DcRpcClient* self,
                                 gint id,
                                 const gchar* method,
                                 JsonNode* params,
                                 GError** error);
VALA_EXTERN DcPendingCall* dc_pending_call_new (gint id);
VALA_EXTERN DcPendingCall* dc_pending_call_construct (GType object_type,
                                          gint id);
static gboolean _dc_rpc_client_call_co_gsource_func (gpointer self);
static void dc_rpc_client_remove_pending (DcRpcClient* self,
                                   gint id);
static void dc_rpc_client_read_loop_data_free (gpointer _data);
static gboolean dc_rpc_client_read_loop_co (DcRpcClientReadLoopData* _data_);
static void dc_rpc_client_read_loop_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_);
static DcPendingCall* dc_rpc_client_find_pending (DcRpcClient* self,
                                           gint id);
static void dc_rpc_client_get_all_accounts_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_all_accounts (DcRpcClient* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN JsonNode* dc_rpc_client_get_all_accounts_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_get_all_accounts_co (DcRpcClientGetAllAccountsData* _data_);
static void dc_rpc_client_get_all_accounts_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_add_account_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_add_account (DcRpcClient* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_add_account_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_add_account_co (DcRpcClientAddAccountData* _data_);
static void dc_rpc_client_add_account_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_select_account_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_select_account (DcRpcClient* self,
                                   gint acct_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_select_account_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_select_account_co (DcRpcClientSelectAccountData* _data_);
VALA_EXTERN DcParams* dc_params_add_int (DcParams* self,
                             gint v);
static void dc_rpc_client_select_account_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_is_configured_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_is_configured (DcRpcClient* self,
                                  gint acct_id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN gboolean dc_rpc_client_is_configured_finish (DcRpcClient* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static gboolean dc_rpc_client_is_configured_co (DcRpcClientIsConfiguredData* _data_);
static void dc_rpc_client_is_configured_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_remove_account_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_remove_account (DcRpcClient* self,
                                   gint acct_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_remove_account_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_remove_account_co (DcRpcClientRemoveAccountData* _data_);
static void dc_rpc_client_remove_account_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_start_io_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_start_io (DcRpcClient* self,
                             gint acct_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_start_io_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error);
static gboolean dc_rpc_client_start_io_co (DcRpcClientStartIoData* _data_);
static void dc_rpc_client_start_io_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_);
static void dc_rpc_client_stop_io_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_stop_io (DcRpcClient* self,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_stop_io_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error);
static gboolean dc_rpc_client_stop_io_co (DcRpcClientStopIoData* _data_);
VALA_EXTERN gint dc_rpc_client_get_account_id (DcRpcClient* self);
static void dc_rpc_client_stop_io_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_);
static void dc_rpc_client_get_connectivity_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_connectivity (DcRpcClient* self,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_connectivity_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_get_connectivity_co (DcRpcClientGetConnectivityData* _data_);
static void dc_rpc_client_get_connectivity_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_get_connectivity_html_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_connectivity_html (DcRpcClient* self,
                                          gint acct_id,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_connectivity_html_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_get_connectivity_html_co (DcRpcClientGetConnectivityHtmlData* _data_);
static void dc_rpc_client_get_connectivity_html_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_get_account_file_size_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_account_file_size (DcRpcClient* self,
                                          gint acct_id,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN gint64 dc_rpc_client_get_account_file_size_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_get_account_file_size_co (DcRpcClientGetAccountFileSizeData* _data_);
static void dc_rpc_client_get_account_file_size_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_get_blob_dir_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_blob_dir (DcRpcClient* self,
                                 gint acct_id,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_blob_dir_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_get_blob_dir_co (DcRpcClientGetBlobDirData* _data_);
static void dc_rpc_client_get_blob_dir_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void dc_rpc_client_add_transport_from_qr_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_add_transport_from_qr (DcRpcClient* self,
                                          gint acct_id,
                                          const gchar* qr_text,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_add_transport_from_qr_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_add_transport_from_qr_co (DcRpcClientAddTransportFromQrData* _data_);
VALA_EXTERN DcParams* dc_params_add_string (DcParams* self,
                                const gchar* v);
static void dc_rpc_client_add_transport_from_qr_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_get_backup_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_backup (DcRpcClient* self,
                               gint acct_id,
                               const gchar* qr_text,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_get_backup_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error);
static gboolean dc_rpc_client_get_backup_co (DcRpcClientGetBackupData* _data_);
static void dc_rpc_client_get_backup_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_);
static void dc_rpc_client_provide_backup_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_provide_backup (DcRpcClient* self,
                                   gint acct_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_provide_backup_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_provide_backup_co (DcRpcClientProvideBackupData* _data_);
static void dc_rpc_client_provide_backup_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_get_backup_qr_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_backup_qr (DcRpcClient* self,
                                  gint acct_id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_backup_qr_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_get_backup_qr_co (DcRpcClientGetBackupQrData* _data_);
static void dc_rpc_client_get_backup_qr_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_create_qr_svg_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_create_qr_svg (DcRpcClient* self,
                                  const gchar* text,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_create_qr_svg_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_create_qr_svg_co (DcRpcClientCreateQrSvgData* _data_);
static void dc_rpc_client_create_qr_svg_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_get_chat_securejoin_qr_code_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_chat_securejoin_qr_code (DcRpcClient* self,
                                                gint acct_id,
                                                gint chat_id,
                                                GAsyncReadyCallback _callback_,
                                                gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_chat_securejoin_qr_code_finish (DcRpcClient* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static gboolean dc_rpc_client_get_chat_securejoin_qr_code_co (DcRpcClientGetChatSecurejoinQrCodeData* _data_);
VALA_EXTERN DcParams* dc_params_add_null (DcParams* self);
static void dc_rpc_client_get_chat_securejoin_qr_code_ready (GObject* source_object,
                                                      GAsyncResult* _res_,
                                                      gpointer _user_data_);
static void dc_rpc_client_stop_ongoing_process_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_stop_ongoing_process (DcRpcClient* self,
                                         gint acct_id,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_stop_ongoing_process_finish (DcRpcClient* self,
                                                GAsyncResult* _res_,
                                                GError** error);
static gboolean dc_rpc_client_stop_ongoing_process_co (DcRpcClientStopOngoingProcessData* _data_);
static void dc_rpc_client_stop_ongoing_process_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void dc_rpc_client_check_qr_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_check_qr (DcRpcClient* self,
                             gint acct_id,
                             const gchar* qr_text,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_check_qr_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_check_qr_co (DcRpcClientCheckQrData* _data_);
static void dc_rpc_client_check_qr_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_);
static void dc_rpc_client_secure_join_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_secure_join (DcRpcClient* self,
                                gint acct_id,
                                const gchar* qr_text,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_secure_join_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_secure_join_co (DcRpcClientSecureJoinData* _data_);
static void dc_rpc_client_secure_join_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_add_or_update_transport_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_add_or_update_transport (DcRpcClient* self,
                                            gint acct_id,
                                            const gchar* email,
                                            const gchar* password,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_add_or_update_transport_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_add_or_update_transport_co (DcRpcClientAddOrUpdateTransportData* _data_);
VALA_EXTERN DcParams* dc_params_begin_object (DcParams* self);
VALA_EXTERN DcParams* dc_params_set_string_member (DcParams* self,
                                       const gchar* name,
                                       const gchar* value);
VALA_EXTERN DcParams* dc_params_set_null_member (DcParams* self,
                                     const gchar* name);
VALA_EXTERN DcParams* dc_params_end_object (DcParams* self);
static void dc_rpc_client_add_or_update_transport_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void dc_rpc_client_list_transports_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_list_transports (DcRpcClient* self,
                                    gint acct_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN JsonNode* dc_rpc_client_list_transports_finish (DcRpcClient* self,
                                                GAsyncResult* _res_,
                                                GError** error);
static gboolean dc_rpc_client_list_transports_co (DcRpcClientListTransportsData* _data_);
static void dc_rpc_client_list_transports_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_delete_transport_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_delete_transport (DcRpcClient* self,
                                     gint acct_id,
                                     const gchar* addr,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_transport_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_delete_transport_co (DcRpcClientDeleteTransportData* _data_);
static void dc_rpc_client_delete_transport_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_batch_set_config_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_batch_set_config (DcRpcClient* self,
                                     const gchar* key,
                                     const gchar* val,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_batch_set_config_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_batch_set_config_co (DcRpcClientBatchSetConfigData* _data_);
static void dc_rpc_client_batch_set_config_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_get_config_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_config (DcRpcClient* self,
                               const gchar* key,
                               gint acct_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_);
VALA_EXTERN gchar* dc_rpc_client_get_config_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static gboolean dc_rpc_client_get_config_co (DcRpcClientGetConfigData* _data_);
static void dc_rpc_client_get_config_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_);
static void dc_rpc_client_get_chatlist_entries_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_chatlist_entries (DcRpcClient* self,
                                         const gchar* query,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_chatlist_entries_finish (DcRpcClient* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static gboolean dc_rpc_client_get_chatlist_entries_co (DcRpcClientGetChatlistEntriesData* _data_);
VALA_EXTERN void dc_rpc_client_get_chatlist_entries_for (DcRpcClient* self,
                                             gint acct_id,
                                             const gchar* query,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_chatlist_entries_for_finish (DcRpcClient* self,
                                                          GAsyncResult* _res_,
                                                          GError** error);
static void dc_rpc_client_get_chatlist_entries_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
static void dc_rpc_client_get_chatlist_entries_for_data_free (gpointer _data);
static gboolean dc_rpc_client_get_chatlist_entries_for_co (DcRpcClientGetChatlistEntriesForData* _data_);
static void dc_rpc_client_get_chatlist_entries_for_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void dc_rpc_client_get_chatlist_items_by_entries_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_chatlist_items_by_entries (DcRpcClient* self,
                                                  JsonArray* entries,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_chatlist_items_by_entries_finish (DcRpcClient* self,
                                                                GAsyncResult* _res_,
                                                                GError** error);
static gboolean dc_rpc_client_get_chatlist_items_by_entries_co (DcRpcClientGetChatlistItemsByEntriesData* _data_);
VALA_EXTERN void dc_rpc_client_get_chatlist_items_by_entries_for (DcRpcClient* self,
                                                      gint acct_id,
                                                      JsonArray* entries,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_chatlist_items_by_entries_for_finish (DcRpcClient* self,
                                                                    GAsyncResult* _res_,
                                                                    GError** error);
static void dc_rpc_client_get_chatlist_items_by_entries_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void dc_rpc_client_get_chatlist_items_by_entries_for_data_free (gpointer _data);
static gboolean dc_rpc_client_get_chatlist_items_by_entries_for_co (DcRpcClientGetChatlistItemsByEntriesForData* _data_);
VALA_EXTERN DcParams* dc_params_add_json_array (DcParams* self,
                                    JsonArray* arr);
static void dc_rpc_client_get_chatlist_items_by_entries_for_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_);
static void dc_rpc_client_get_full_chat_by_id_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_full_chat_by_id (DcRpcClient* self,
                                        gint chat_id,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_full_chat_by_id_finish (DcRpcClient* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static gboolean dc_rpc_client_get_full_chat_by_id_co (DcRpcClientGetFullChatByIdData* _data_);
static void dc_rpc_client_get_full_chat_by_id_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_get_message_ids_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_message_ids (DcRpcClient* self,
                                    gint chat_id,
                                    gboolean info_only,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_message_ids_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_get_message_ids_co (DcRpcClientGetMessageIdsData* _data_);
VALA_EXTERN void dc_rpc_client_get_message_ids_for (DcRpcClient* self,
                                        gint acct_id,
                                        gint chat_id,
                                        gboolean info_only,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_message_ids_for_finish (DcRpcClient* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static void dc_rpc_client_get_message_ids_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_get_message_ids_for_data_free (gpointer _data);
static gboolean dc_rpc_client_get_message_ids_for_co (DcRpcClientGetMessageIdsForData* _data_);
VALA_EXTERN DcParams* dc_params_add_bool (DcParams* self,
                              gboolean v);
static void dc_rpc_client_get_message_ids_for_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_get_message_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_message (DcRpcClient* self,
                                gint msg_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_message_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static gboolean dc_rpc_client_get_message_co (DcRpcClientGetMessageData* _data_);
static void dc_rpc_client_get_message_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_fetch_message_data_free (gpointer _data);
VALA_EXTERN GType dc_message_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcMessage, g_object_unref)
VALA_EXTERN void dc_rpc_client_fetch_message (DcRpcClient* self,
                                  gint msg_id,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN DcMessage* dc_rpc_client_fetch_message_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_fetch_message_co (DcRpcClientFetchMessageData* _data_);
static void dc_rpc_client_fetch_message_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
VALA_EXTERN DcMessage* dc_rpc_client_parse_message (JsonObject* obj,
                                        const gchar* self_email);
VALA_EXTERN const gchar* dc_rpc_client_get_self_email (DcRpcClient* self);
static void dc_rpc_client_get_messages_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_messages (DcRpcClient* self,
                                 gint* msg_ids,
                                 gint msg_ids_length1,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_messages_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_get_messages_co (DcRpcClientGetMessagesData* _data_);
VALA_EXTERN void dc_rpc_client_get_messages_for (DcRpcClient* self,
                                     gint acct_id,
                                     gint* msg_ids,
                                     gint msg_ids_length1,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_messages_for_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static void dc_rpc_client_get_messages_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void dc_rpc_client_get_messages_for_data_free (gpointer _data);
static gboolean dc_rpc_client_get_messages_for_co (DcRpcClientGetMessagesForData* _data_);
VALA_EXTERN DcParams* dc_params_add_int_array (DcParams* self,
                                   gint* values,
                                   gint values_length1);
static void dc_rpc_client_get_messages_for_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_send_msg_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_send_msg (DcRpcClient* self,
                             gint chat_id,
                             const gchar* text,
                             const gchar* file_path,
                             const gchar* file_name,
                             gint quoted_msg_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_send_msg_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error);
static gboolean dc_rpc_client_send_msg_co (DcRpcClientSendMsgData* _data_);
static void dc_rpc_client_send_msg_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_);
static void dc_rpc_client_send_edit_request_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_send_edit_request (DcRpcClient* self,
                                      gint msg_id,
                                      const gchar* new_text,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_send_edit_request_finish (DcRpcClient* self,
                                             GAsyncResult* _res_,
                                             GError** error);
static gboolean dc_rpc_client_send_edit_request_co (DcRpcClientSendEditRequestData* _data_);
static void dc_rpc_client_send_edit_request_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void dc_rpc_client_send_reaction_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_send_reaction (DcRpcClient* self,
                                  gint msg_id,
                                  gchar** emojis,
                                  gint emojis_length1,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_send_reaction_finish (DcRpcClient* self,
                                         GAsyncResult* _res_,
                                         GError** error);
static gboolean dc_rpc_client_send_reaction_co (DcRpcClientSendReactionData* _data_);
VALA_EXTERN DcParams* dc_params_add_string_array (DcParams* self,
                                      gchar** values,
                                      gint values_length1);
static void dc_rpc_client_send_reaction_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
static void dc_rpc_client_marknoticed_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_marknoticed_chat (DcRpcClient* self,
                                     gint chat_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_marknoticed_chat_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_marknoticed_chat_co (DcRpcClientMarknoticedChatData* _data_);
static void dc_rpc_client_marknoticed_chat_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_mark_seen_msgs_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_mark_seen_msgs (DcRpcClient* self,
                                   gint* msg_ids,
                                   gint msg_ids_length1,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_mark_seen_msgs_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_mark_seen_msgs_co (DcRpcClientMarkSeenMsgsData* _data_);
static void dc_rpc_client_mark_seen_msgs_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_get_next_event_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_next_event (DcRpcClient* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_next_event_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_get_next_event_co (DcRpcClientGetNextEventData* _data_);
static void dc_rpc_client_get_next_event_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_get_contact_ids_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_contact_ids (DcRpcClient* self,
                                    const gchar* query,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_contact_ids_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_get_contact_ids_co (DcRpcClientGetContactIdsData* _data_);
VALA_EXTERN void dc_rpc_client_get_contact_ids_for (DcRpcClient* self,
                                        gint acct_id,
                                        const gchar* query,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN JsonArray* dc_rpc_client_get_contact_ids_for_finish (DcRpcClient* self,
                                                     GAsyncResult* _res_,
                                                     GError** error);
static void dc_rpc_client_get_contact_ids_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_get_contact_ids_for_data_free (gpointer _data);
static gboolean dc_rpc_client_get_contact_ids_for_co (DcRpcClientGetContactIdsForData* _data_);
static void dc_rpc_client_get_contact_ids_for_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_create_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_create_contact (DcRpcClient* self,
                                   const gchar* email,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_create_contact_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_create_contact_co (DcRpcClientCreateContactData* _data_);
static void dc_rpc_client_create_contact_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_lookup_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_lookup_contact (DcRpcClient* self,
                                   const gchar* email,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_lookup_contact_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error);
static gboolean dc_rpc_client_lookup_contact_co (DcRpcClientLookupContactData* _data_);
static void dc_rpc_client_lookup_contact_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
static void dc_rpc_client_get_or_create_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_or_create_contact (DcRpcClient* self,
                                          const gchar* email,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_or_create_contact_finish (DcRpcClient* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static gboolean dc_rpc_client_get_or_create_contact_co (DcRpcClientGetOrCreateContactData* _data_);
static void dc_rpc_client_get_or_create_contact_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_);
static void dc_rpc_client_get_or_create_chat_by_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_or_create_chat_by_contact (DcRpcClient* self,
                                                  gint contact_id,
                                                  GAsyncReadyCallback _callback_,
                                                  gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_get_or_create_chat_by_contact_finish (DcRpcClient* self,
                                                         GAsyncResult* _res_,
                                                         GError** error);
static gboolean dc_rpc_client_get_or_create_chat_by_contact_co (DcRpcClientGetOrCreateChatByContactData* _data_);
static void dc_rpc_client_get_or_create_chat_by_contact_ready (GObject* source_object,
                                                        GAsyncResult* _res_,
                                                        gpointer _user_data_);
static void dc_rpc_client_create_group_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_create_group (DcRpcClient* self,
                                 const gchar* name,
                                 gboolean protect,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN gint dc_rpc_client_create_group_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error);
static gboolean dc_rpc_client_create_group_co (DcRpcClientCreateGroupData* _data_);
static void dc_rpc_client_create_group_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_);
static void dc_rpc_client_leave_group_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_leave_group (DcRpcClient* self,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_leave_group_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_leave_group_co (DcRpcClientLeaveGroupData* _data_);
static void dc_rpc_client_leave_group_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_delete_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_delete_chat (DcRpcClient* self,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_chat_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error);
static gboolean dc_rpc_client_delete_chat_co (DcRpcClientDeleteChatData* _data_);
static void dc_rpc_client_delete_chat_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_set_chat_visibility_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_chat_visibility (DcRpcClient* self,
                                        gint chat_id,
                                        const gchar* visibility,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_chat_visibility_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_set_chat_visibility_co (DcRpcClientSetChatVisibilityData* _data_);
static void dc_rpc_client_set_chat_visibility_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_delete_messages_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_delete_messages (DcRpcClient* self,
                                    gint* msg_ids,
                                    gint msg_ids_length1,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_messages_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean dc_rpc_client_delete_messages_co (DcRpcClientDeleteMessagesData* _data_);
static void dc_rpc_client_delete_messages_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_forward_messages_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_forward_messages (DcRpcClient* self,
                                     gint* msg_ids,
                                     gint msg_ids_length1,
                                     gint chat_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_forward_messages_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static gboolean dc_rpc_client_forward_messages_co (DcRpcClientForwardMessagesData* _data_);
static void dc_rpc_client_forward_messages_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
static void dc_rpc_client_delete_messages_for_all_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_delete_messages_for_all (DcRpcClient* self,
                                            gint* msg_ids,
                                            gint msg_ids_length1,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_delete_messages_for_all_finish (DcRpcClient* self,
                                                   GAsyncResult* _res_,
                                                   GError** error);
static gboolean dc_rpc_client_delete_messages_for_all_co (DcRpcClientDeleteMessagesForAllData* _data_);
static void dc_rpc_client_delete_messages_for_all_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void dc_rpc_client_get_contact_for_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_contact_for (DcRpcClient* self,
                                    gint acct_id,
                                    gint contact_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_contact_for_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean dc_rpc_client_get_contact_for_co (DcRpcClientGetContactForData* _data_);
static void dc_rpc_client_get_contact_for_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void dc_rpc_client_get_contact_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_get_contact (DcRpcClient* self,
                                gint contact_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN JsonObject* dc_rpc_client_get_contact_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error);
static gboolean dc_rpc_client_get_contact_co (DcRpcClientGetContactData* _data_);
static void dc_rpc_client_get_contact_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
static void dc_rpc_client_add_contact_to_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_add_contact_to_chat (DcRpcClient* self,
                                        gint chat_id,
                                        gint contact_id,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_add_contact_to_chat_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error);
static gboolean dc_rpc_client_add_contact_to_chat_co (DcRpcClientAddContactToChatData* _data_);
static void dc_rpc_client_add_contact_to_chat_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_);
static void dc_rpc_client_remove_contact_from_chat_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_remove_contact_from_chat (DcRpcClient* self,
                                             gint chat_id,
                                             gint contact_id,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_remove_contact_from_chat_finish (DcRpcClient* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static gboolean dc_rpc_client_remove_contact_from_chat_co (DcRpcClientRemoveContactFromChatData* _data_);
static void dc_rpc_client_remove_contact_from_chat_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
static void dc_rpc_client_set_chat_profile_image_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_chat_profile_image (DcRpcClient* self,
                                           gint chat_id,
                                           const gchar* image_path,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_chat_profile_image_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error);
static gboolean dc_rpc_client_set_chat_profile_image_co (DcRpcClientSetChatProfileImageData* _data_);
static void dc_rpc_client_set_chat_profile_image_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_);
static void dc_rpc_client_set_chat_ephemeral_timer_data_free (gpointer _data);
VALA_EXTERN void dc_rpc_client_set_chat_ephemeral_timer (DcRpcClient* self,
                                             gint chat_id,
                                             gint timer,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN void dc_rpc_client_set_chat_ephemeral_timer_finish (DcRpcClient* self,
                                                    GAsyncResult* _res_,
                                                    GError** error);
static gboolean dc_rpc_client_set_chat_ephemeral_timer_co (DcRpcClientSetChatEphemeralTimerData* _data_);
static void dc_rpc_client_set_chat_ephemeral_timer_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
VALA_EXTERN GType dc_contact_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcContact, g_object_unref)
VALA_EXTERN DcContact* dc_rpc_client_parse_contact (gint contact_id,
                                        JsonObject* obj);
VALA_EXTERN DcContact* dc_contact_new (void);
VALA_EXTERN DcContact* dc_contact_construct (GType object_type);
VALA_EXTERN void dc_contact_set_id (DcContact* self,
                        gint value);
VALA_EXTERN gchar* dc_json_str (JsonObject* obj,
                    const gchar* key);
VALA_EXTERN void dc_contact_set_display_name (DcContact* self,
                                  const gchar* value);
VALA_EXTERN void dc_contact_set_address (DcContact* self,
                             const gchar* value);
VALA_EXTERN void dc_contact_set_profile_image (DcContact* self,
                                   const gchar* value);
VALA_EXTERN gboolean dc_json_bool (JsonObject* obj,
                       const gchar* key);
VALA_EXTERN void dc_contact_set_is_verified (DcContact* self,
                                 gboolean value);
VALA_EXTERN DcMessage* dc_message_new (void);
VALA_EXTERN DcMessage* dc_message_construct (GType object_type);
VALA_EXTERN gint64 dc_json_int (JsonObject* obj,
                    const gchar* key,
                    gint64 fallback);
VALA_EXTERN void dc_message_set_id (DcMessage* self,
                        gint value);
VALA_EXTERN void dc_message_set_chat_id (DcMessage* self,
                             gint value);
VALA_EXTERN void dc_message_set_text (DcMessage* self,
                          const gchar* value);
VALA_EXTERN void dc_message_set_timestamp (DcMessage* self,
                               gint64 value);
VALA_EXTERN void dc_message_set_is_info (DcMessage* self,
                             gboolean value);
VALA_EXTERN void dc_message_set_file_path (DcMessage* self,
                               const gchar* value);
VALA_EXTERN void dc_message_set_file_name (DcMessage* self,
                               const gchar* value);
VALA_EXTERN void dc_message_set_file_mime (DcMessage* self,
                               const gchar* value);
VALA_EXTERN void dc_message_set_file_bytes (DcMessage* self,
                                gint value);
VALA_EXTERN void dc_message_set_view_type (DcMessage* self,
                               const gchar* value);
VALA_EXTERN void dc_message_set_state (DcMessage* self,
                           gint value);
VALA_EXTERN void dc_message_set_sender_address (DcMessage* self,
                                    const gchar* value);
VALA_EXTERN void dc_message_set_sender_name (DcMessage* self,
                                 const gchar* value);
VALA_EXTERN const gchar* dc_message_get_sender_address (DcMessage* self);
VALA_EXTERN void dc_message_set_is_outgoing (DcMessage* self,
                                 gboolean value);
static void _vala_array_add1 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add2 (gint* * array,
                       gint* length,
                       gint* size,
                       gint value);
VALA_EXTERN void dc_message_set_reactions (DcMessage* self,
                               const gchar* value);
VALA_EXTERN void dc_message_set_quote_text (DcMessage* self,
                                const gchar* value);
VALA_EXTERN void dc_message_set_quote_sender_name (DcMessage* self,
                                       const gchar* value);
VALA_EXTERN void dc_message_set_quote_msg_id (DcMessage* self,
                                  gint value);
VALA_EXTERN GType dc_chat_entry_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DcChatEntry, g_object_unref)
VALA_EXTERN DcChatEntry* dc_rpc_client_parse_chat_item (gint chat_id,
                                            JsonObject* obj);
VALA_EXTERN DcChatEntry* dc_chat_entry_new (void);
VALA_EXTERN DcChatEntry* dc_chat_entry_construct (GType object_type);
VALA_EXTERN void dc_chat_entry_set_id (DcChatEntry* self,
                           gint value);
VALA_EXTERN void dc_chat_entry_set_name (DcChatEntry* self,
                             const gchar* value);
VALA_EXTERN void dc_chat_entry_set_summary_prefix (DcChatEntry* self,
                                       const gchar* value);
VALA_EXTERN void dc_chat_entry_set_last_message (DcChatEntry* self,
                                     const gchar* value);
VALA_EXTERN const gchar* dc_chat_entry_get_last_message (DcChatEntry* self);
VALA_EXTERN void dc_chat_entry_set_unread_count (DcChatEntry* self,
                                     gint value);
VALA_EXTERN void dc_chat_entry_set_timestamp (DcChatEntry* self,
                                  gint64 value);
VALA_EXTERN void dc_chat_entry_set_avatar_path (DcChatEntry* self,
                                    const gchar* value);
VALA_EXTERN void dc_chat_entry_set_is_muted (DcChatEntry* self,
                                 gboolean value);
VALA_EXTERN void dc_chat_entry_set_is_contact_request (DcChatEntry* self,
                                           gboolean value);
VALA_EXTERN void dc_chat_entry_set_is_archived (DcChatEntry* self,
                                    gboolean value);
VALA_EXTERN void dc_chat_entry_set_is_pinned (DcChatEntry* self,
                                  gboolean value);
VALA_EXTERN DcRpcClient* dc_rpc_client_new (void);
VALA_EXTERN DcRpcClient* dc_rpc_client_construct (GType object_type);
VALA_EXTERN gboolean dc_rpc_client_get_is_connected (DcRpcClient* self);
VALA_EXTERN void dc_rpc_client_set_account_id (DcRpcClient* self,
                                   gint value);
VALA_EXTERN void dc_rpc_client_set_self_email (DcRpcClient* self,
                                   const gchar* value);
static void dc_rpc_client_finalize (GObject * obj);
static GType dc_rpc_client_get_type_once (void);
static void _vala_dc_rpc_client_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec);
static void _vala_dc_rpc_client_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec);
static void dc_pending_call_finalize (DcPendingCall * obj);
static GType dc_pending_call_get_type_once (void);
static DcParams* dc_params_new (void);
static DcParams* dc_params_construct (GType object_type);
static void dc_params_finalize (GObject * obj);
static GType dc_params_get_type_once (void);
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 inline gpointer
dc_rpc_client_get_instance_private (DcRpcClient* self)
{
	return G_STRUCT_MEMBER_P (self, DcRpcClient_private_offset);
}

static void
_dc_pending_call_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (dc_pending_call_unref (var), NULL));
}

static void
dc_rpc_client_start_data_free (gpointer _data)
{
	DcRpcClientStartData* _data_;
	_data_ = _data;
	_g_free0 (_data_->cwd);
	_g_free0 (_data_->accounts_path);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStartData, _data_);
}

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

void
dc_rpc_client_start (DcRpcClient* self,
                     gchar** argv,
                     gint argv_length1,
                     const gchar* cwd,
                     const gchar* accounts_path,
                     GAsyncReadyCallback _callback_,
                     gpointer _user_data_)
{
	DcRpcClientStartData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStartData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_start_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->argv = argv;
	_data_->argv_length1 = argv_length1;
	_tmp1_ = g_strdup (cwd);
	_g_free0 (_data_->cwd);
	_data_->cwd = _tmp1_;
	_tmp2_ = g_strdup (accounts_path);
	_g_free0 (_data_->accounts_path);
	_data_->accounts_path = _tmp2_;
	dc_rpc_client_start_co (_data_);
}

void
dc_rpc_client_start_finish (DcRpcClient* self,
                            GAsyncResult* _res_,
                            GError** error)
{
	DcRpcClientStartData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_start_ready (GObject* source_object,
                           GAsyncResult* _res_,
                           gpointer _user_data_)
{
	DcRpcClientStartData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_start_co (_data_);
}

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

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
dc_rpc_client_start_co (DcRpcClientStartData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->flags = (G_SUBPROCESS_FLAGS_STDIN_PIPE | G_SUBPROCESS_FLAGS_STDOUT_PIPE) | G_SUBPROCESS_FLAGS_STDERR_PIPE;
	_data_->_tmp0_ = g_subprocess_launcher_new (_data_->flags);
	_data_->launcher = _data_->_tmp0_;
	if (_data_->cwd != NULL) {
		_data_->_tmp1_ = _data_->launcher;
		g_subprocess_launcher_set_cwd (_data_->_tmp1_, _data_->cwd);
	}
	if (_data_->accounts_path != NULL) {
		_data_->_tmp2_ = _data_->launcher;
		g_subprocess_launcher_setenv (_data_->_tmp2_, "DC_ACCOUNTS_PATH", _data_->accounts_path, TRUE);
	}
	_data_->_tmp4_ = _data_->launcher;
	_data_->_tmp5_ = g_subprocess_launcher_spawnv (_data_->_tmp4_, _data_->argv, &_data_->_inner_error0_);
	_data_->_tmp3_ = _data_->_tmp5_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->launcher);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = _data_->_tmp3_;
	_data_->_tmp3_ = NULL;
	_g_object_unref0 (_data_->self->priv->process);
	_data_->self->priv->process = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->self->priv->process;
	_data_->_tmp8_ = g_subprocess_get_stdin_pipe (_data_->_tmp7_);
	_data_->_tmp9_ = _g_object_ref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->self->priv->writer);
	_data_->self->priv->writer = _data_->_tmp9_;
	_data_->_tmp10_ = _data_->self->priv->process;
	_data_->_tmp11_ = g_subprocess_get_stdout_pipe (_data_->_tmp10_);
	_data_->_tmp12_ = g_data_input_stream_new (_data_->_tmp11_);
	_g_object_unref0 (_data_->self->priv->reader);
	_data_->self->priv->reader = _data_->_tmp12_;
	_data_->_tmp13_ = _data_->self->priv->reader;
	g_data_input_stream_set_newline_type (_data_->_tmp13_, G_DATA_STREAM_NEWLINE_TYPE_LF);
	dc_rpc_client_drain_stderr (_data_->self, NULL, NULL);
	dc_rpc_client_read_loop (_data_->self, NULL, NULL);
	{
		_data_->_tmp14_ = dc_params_begin ();
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = dc_params_build (_data_->_tmp15_);
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_state_ = 1;
		dc_rpc_client_call (_data_->self, "get_system_info", _data_->_tmp17_, dc_rpc_client_start_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp18_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp19_ = _data_->_tmp18_;
		__vala_JsonNode_free0 (_data_->_tmp19_);
		__vala_JsonNode_free0 (_data_->_tmp17_);
		_g_object_unref0 (_data_->_tmp15_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_state_ = 2;
		dc_rpc_client_nap (_data_->self, (guint) 200, dc_rpc_client_start_ready, _data_);
		return FALSE;
		_state_2:
		dc_rpc_client_nap_finish (_data_->self, _data_->_res_);
		_data_->_tmp20_ = _data_->self->priv->last_stderr;
		_data_->_tmp21_ = strlen (_data_->_tmp20_);
		_data_->_tmp22_ = _data_->_tmp21_;
		if (_data_->_tmp22_ > 0) {
			_data_->_tmp23_ = _data_->self->priv->last_stderr;
			_data_->_tmp24_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "%s", _data_->_tmp23_);
			_data_->_inner_error0_ = _data_->_tmp24_;
			_g_error_free0 (_data_->e);
			goto __finally0;
		}
		_data_->_tmp25_ = _data_->e;
		_data_->_tmp26_ = _g_error_copy0 (_data_->_tmp25_);
		_data_->_inner_error0_ = _data_->_tmp26_;
		_g_error_free0 (_data_->e);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->_tmp3_);
		_g_object_unref0 (_data_->launcher);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	dc_rpc_client_set_is_connected (_data_->self, TRUE);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->launcher);
	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 void
dc_rpc_client_drain_stderr_data_free (gpointer _data)
{
	DcRpcClientDrainStderrData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDrainStderrData, _data_);
}

static void
dc_rpc_client_drain_stderr (DcRpcClient* self,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	DcRpcClientDrainStderrData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientDrainStderrData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_drain_stderr_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_drain_stderr_co (_data_);
}

static void
dc_rpc_client_drain_stderr_finish (DcRpcClient* self,
                                   GAsyncResult* _res_)
{
	DcRpcClientDrainStderrData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_rpc_client_drain_stderr_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	DcRpcClientDrainStderrData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_drain_stderr_co (_data_);
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static gboolean
dc_rpc_client_drain_stderr_co (DcRpcClientDrainStderrData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->process;
	if (_data_->_tmp0_ == NULL) {
		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;
	}
	{
		_data_->_tmp1_ = _data_->self->priv->process;
		_data_->_tmp2_ = g_subprocess_get_stderr_pipe (_data_->_tmp1_);
		_data_->_tmp3_ = g_data_input_stream_new (_data_->_tmp2_);
		_data_->err_stream = _data_->_tmp3_;
		while (TRUE) {
			_data_->_tmp5_ = _data_->err_stream;
			_data_->_tmp6_ = 0UL;
			_data_->_state_ = 1;
			g_data_input_stream_read_line_async (_data_->_tmp5_, G_PRIORITY_DEFAULT, NULL, dc_rpc_client_drain_stderr_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp7_ = g_data_input_stream_read_line_finish_utf8 (_data_->_tmp5_, _data_->_res_, &_data_->_tmp6_, &_data_->_inner_error0_);
			_data_->len = _data_->_tmp6_;
			_data_->_tmp4_ = _data_->_tmp7_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_free0 (_data_->line);
				_g_object_unref0 (_data_->err_stream);
				goto __catch0_g_error;
			}
			_data_->_tmp8_ = _data_->_tmp4_;
			_data_->_tmp4_ = NULL;
			_g_free0 (_data_->line);
			_data_->line = _data_->_tmp8_;
			_data_->_tmp9_ = _data_->line;
			if (!(_data_->_tmp9_ != NULL)) {
				_g_free0 (_data_->_tmp4_);
				break;
			}
			_data_->_tmp10_ = _data_->line;
			_data_->_tmp11_ = string_strip (_data_->_tmp10_);
			_g_free0 (_data_->self->priv->last_stderr);
			_data_->self->priv->last_stderr = _data_->_tmp11_;
			_g_free0 (_data_->_tmp4_);
		}
		_g_free0 (_data_->line);
		_g_object_unref0 (_data_->err_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_nap_data_free (gpointer _data)
{
	DcRpcClientNapData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientNapData, _data_);
}

static void
dc_rpc_client_nap (DcRpcClient* self,
                   guint ms,
                   GAsyncReadyCallback _callback_,
                   gpointer _user_data_)
{
	DcRpcClientNapData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientNapData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_nap_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->ms = ms;
	dc_rpc_client_nap_co (_data_);
}

static void
dc_rpc_client_nap_finish (DcRpcClient* self,
                          GAsyncResult* _res_)
{
	DcRpcClientNapData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static gboolean
_dc_rpc_client_nap_co_gsource_func (gpointer self)
{
	gboolean result;
	result = dc_rpc_client_nap_co (self);
	return result;
}

static gboolean
dc_rpc_client_nap_co (DcRpcClientNapData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	g_timeout_add_full (G_PRIORITY_DEFAULT, _data_->ms, _dc_rpc_client_nap_co_gsource_func, _data_, NULL);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	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;
}

void
dc_rpc_client_stop (DcRpcClient* self)
{
	GSubprocess* _tmp0_;
	g_return_if_fail (self != NULL);
	dc_rpc_client_set_is_connected (self, FALSE);
	_tmp0_ = self->priv->process;
	if (_tmp0_ != NULL) {
		GSubprocess* _tmp1_;
		_tmp1_ = self->priv->process;
		g_subprocess_force_exit (_tmp1_);
		_g_object_unref0 (self->priv->process);
		self->priv->process = NULL;
	}
	_g_object_unref0 (self->priv->writer);
	self->priv->writer = NULL;
	_g_object_unref0 (self->priv->reader);
	self->priv->reader = NULL;
}

static void
dc_rpc_client_call_data_free (gpointer _data)
{
	DcRpcClientCallData* _data_;
	_data_ = _data;
	_g_free0 (_data_->method);
	__vala_JsonNode_free0 (_data_->params);
	__vala_JsonNode_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCallData, _data_);
}

static JsonNode*
_vala_JsonNode_copy (JsonNode* self)
{
	return g_boxed_copy (json_node_get_type (), self);
}

static gpointer
__vala_JsonNode_copy0 (gpointer self)
{
	return self ? _vala_JsonNode_copy (self) : NULL;
}

void
dc_rpc_client_call (DcRpcClient* self,
                    const gchar* method,
                    JsonNode* params,
                    GAsyncReadyCallback _callback_,
                    gpointer _user_data_)
{
	DcRpcClientCallData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	JsonNode* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (method != NULL);
	g_return_if_fail (params != NULL);
	_data_ = g_slice_new0 (DcRpcClientCallData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_call_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (method);
	_g_free0 (_data_->method);
	_data_->method = _tmp1_;
	_tmp2_ = __vala_JsonNode_copy0 (params);
	__vala_JsonNode_free0 (_data_->params);
	_data_->params = _tmp2_;
	dc_rpc_client_call_co (_data_);
}

JsonNode*
dc_rpc_client_call_finish (DcRpcClient* self,
                           GAsyncResult* _res_,
                           GError** error)
{
	JsonNode* result;
	DcRpcClientCallData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static gboolean
_dc_rpc_client_call_co_gsource_func (gpointer self)
{
	gboolean result;
	result = dc_rpc_client_call_co (self);
	return result;
}

static gpointer
_dc_pending_call_ref0 (gpointer self)
{
	return self ? dc_pending_call_ref (self) : NULL;
}

static gboolean
dc_rpc_client_call_co (DcRpcClientCallData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->writer;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp2_ = _data_->self->priv->reader;
		_data_->_tmp0_ = _data_->_tmp2_ == NULL;
	}
	if (_data_->_tmp0_) {
		_data_->_tmp3_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_NOT_CONNECTED, "RPC client not connected");
		_data_->_inner_error0_ = _data_->_tmp3_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp4_ = _data_->self->priv->next_id;
	_data_->self->priv->next_id = _data_->_tmp4_ + 1;
	_data_->id = _data_->_tmp4_;
	dc_rpc_client_send_request (_data_->self, _data_->id, _data_->method, _data_->params, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = dc_pending_call_new (_data_->id);
	_data_->pc = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->pc;
	(_data_->_tmp6_->callback_target_destroy_notify == NULL) ? NULL : (_data_->_tmp6_->callback_target_destroy_notify (_data_->_tmp6_->callback_target), NULL);
	_data_->_tmp6_->callback = NULL;
	_data_->_tmp6_->callback_target = NULL;
	_data_->_tmp6_->callback_target_destroy_notify = NULL;
	_data_->_tmp6_->callback = _dc_rpc_client_call_co_gsource_func;
	_data_->_tmp6_->callback_target = _data_;
	_data_->_tmp6_->callback_target_destroy_notify = NULL;
	_data_->_tmp7_ = _data_->self->priv->pending;
	_data_->_tmp8_ = _data_->pc;
	_data_->_tmp9_ = _dc_pending_call_ref0 (_data_->_tmp8_);
	g_ptr_array_add (_data_->_tmp7_, _data_->_tmp9_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	dc_rpc_client_remove_pending (_data_->self, _data_->id);
	_data_->_tmp10_ = _data_->pc;
	_data_->_tmp11_ = _data_->_tmp10_->error_msg;
	if (_data_->_tmp11_ != NULL) {
		_data_->_tmp12_ = _data_->pc;
		_data_->_tmp13_ = _data_->_tmp12_->error_msg;
		_data_->_tmp14_ = g_error_new (G_IO_ERROR, G_IO_ERROR_FAILED, "RPC %s: %s", _data_->method, _data_->_tmp13_);
		_data_->_inner_error0_ = _data_->_tmp14_;
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_dc_pending_call_unref0 (_data_->pc);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = _data_->pc;
	_data_->_tmp16_ = _data_->_tmp15_->result;
	_data_->_tmp17_ = __vala_JsonNode_copy0 (_data_->_tmp16_);
	_data_->result = _data_->_tmp17_;
	_dc_pending_call_unref0 (_data_->pc);
	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 guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static void
dc_rpc_client_send_request (DcRpcClient* self,
                            gint id,
                            const gchar* method,
                            JsonNode* params,
                            GError** error)
{
	JsonBuilder* b = NULL;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonBuilder* _tmp2_;
	JsonBuilder* _tmp3_;
	JsonBuilder* _tmp4_;
	JsonBuilder* _tmp5_;
	JsonBuilder* _tmp6_;
	JsonBuilder* _tmp7_;
	JsonBuilder* _tmp8_;
	JsonBuilder* _tmp9_;
	JsonNode* _tmp10_;
	JsonBuilder* _tmp11_;
	JsonGenerator* gen = NULL;
	JsonGenerator* _tmp12_;
	JsonGenerator* _tmp13_;
	JsonBuilder* _tmp14_;
	JsonNode* _tmp15_;
	JsonNode* _tmp16_;
	gsize json_len = 0UL;
	gchar* json = NULL;
	JsonGenerator* _tmp17_;
	gsize _tmp18_ = 0UL;
	gchar* _tmp19_;
	gchar* line = NULL;
	const gchar* _tmp20_;
	gchar* _tmp21_;
	gsize written = 0UL;
	GOutputStream* _tmp22_;
	const gchar* _tmp23_;
	guint8* _tmp24_;
	gint _tmp24__length1;
	gint _tmp25_ = 0;
	guint8* _tmp26_;
	gint _tmp26__length1;
	gsize _tmp27_ = 0UL;
	GOutputStream* _tmp28_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (method != NULL);
	g_return_if_fail (params != NULL);
	_tmp0_ = json_builder_new ();
	b = _tmp0_;
	_tmp1_ = b;
	json_builder_begin_object (_tmp1_);
	_tmp2_ = b;
	json_builder_set_member_name (_tmp2_, "jsonrpc");
	_tmp3_ = b;
	json_builder_add_string_value (_tmp3_, "2.0");
	_tmp4_ = b;
	json_builder_set_member_name (_tmp4_, "id");
	_tmp5_ = b;
	json_builder_add_int_value (_tmp5_, (gint64) id);
	_tmp6_ = b;
	json_builder_set_member_name (_tmp6_, "method");
	_tmp7_ = b;
	json_builder_add_string_value (_tmp7_, method);
	_tmp8_ = b;
	json_builder_set_member_name (_tmp8_, "params");
	_tmp9_ = b;
	_tmp10_ = __vala_JsonNode_copy0 (params);
	json_builder_add_value (_tmp9_, _tmp10_);
	_tmp11_ = b;
	json_builder_end_object (_tmp11_);
	_tmp12_ = json_generator_new ();
	gen = _tmp12_;
	_tmp13_ = gen;
	_tmp14_ = b;
	_tmp15_ = json_builder_get_root (_tmp14_);
	_tmp16_ = _tmp15_;
	json_generator_set_root (_tmp13_, _tmp16_);
	__vala_JsonNode_free0 (_tmp16_);
	_tmp17_ = gen;
	_tmp19_ = json_generator_to_data (_tmp17_, &_tmp18_);
	json_len = _tmp18_;
	json = _tmp19_;
	_tmp20_ = json;
	_tmp21_ = g_strconcat (_tmp20_, "\n", NULL);
	line = _tmp21_;
	_tmp22_ = self->priv->writer;
	_tmp23_ = line;
	_tmp24_ = string_get_data (_tmp23_, &_tmp25_);
	_tmp24__length1 = _tmp25_;
	_tmp26_ = _tmp24_;
	_tmp26__length1 = _tmp24__length1;
	g_output_stream_write_all (_tmp22_, _tmp26_, (gsize) _tmp26__length1, &_tmp27_, NULL, &_inner_error0_);
	written = _tmp27_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_free0 (line);
		_g_free0 (json);
		_g_object_unref0 (gen);
		_g_object_unref0 (b);
		return;
	}
	_tmp28_ = self->priv->writer;
	g_output_stream_flush (_tmp28_, NULL, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_free0 (line);
		_g_free0 (json);
		_g_object_unref0 (gen);
		_g_object_unref0 (b);
		return;
	}
	_g_free0 (line);
	_g_free0 (json);
	_g_object_unref0 (gen);
	_g_object_unref0 (b);
}

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

static void
dc_rpc_client_read_loop (DcRpcClient* self,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_)
{
	DcRpcClientReadLoopData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientReadLoopData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_read_loop_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_read_loop_co (_data_);
}

static void
dc_rpc_client_read_loop_finish (DcRpcClient* self,
                                GAsyncResult* _res_)
{
	DcRpcClientReadLoopData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
dc_rpc_client_read_loop_ready (GObject* source_object,
                               GAsyncResult* _res_,
                               gpointer _user_data_)
{
	DcRpcClientReadLoopData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_read_loop_co (_data_);
}

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

static gboolean
dc_rpc_client_read_loop_co (DcRpcClientReadLoopData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		while (TRUE) {
			_data_->_tmp0_ = _data_->self->priv->reader;
			_data_->_tmp1_ = 0UL;
			_data_->_state_ = 1;
			g_data_input_stream_read_line_async (_data_->_tmp0_, G_PRIORITY_DEFAULT, NULL, dc_rpc_client_read_loop_ready, _data_);
			return FALSE;
			_state_1:
			_data_->_tmp2_ = g_data_input_stream_read_line_finish_utf8 (_data_->_tmp0_, _data_->_res_, &_data_->_tmp1_, &_data_->_inner_error0_);
			_data_->len = _data_->_tmp1_;
			_data_->line = _data_->_tmp2_;
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
			_data_->_tmp3_ = _data_->line;
			if (_data_->_tmp3_ == NULL) {
				_g_free0 (_data_->line);
				break;
			}
			_data_->_tmp4_ = _data_->line;
			_data_->_tmp5_ = string_strip (_data_->_tmp4_);
			_data_->_tmp6_ = _data_->_tmp5_;
			_data_->_tmp7_ = strlen (_data_->_tmp6_);
			_data_->_tmp8_ = _data_->_tmp7_;
			_data_->_tmp9_ = _data_->_tmp8_ == 0;
			_g_free0 (_data_->_tmp6_);
			if (_data_->_tmp9_) {
				_g_free0 (_data_->line);
				continue;
			}
			_data_->_tmp10_ = json_parser_new ();
			_data_->parser = _data_->_tmp10_;
			_data_->_tmp11_ = _data_->parser;
			_data_->_tmp12_ = _data_->line;
			json_parser_load_from_data (_data_->_tmp11_, _data_->_tmp12_, (gssize) -1, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				_g_object_unref0 (_data_->parser);
				_g_free0 (_data_->line);
				goto __catch0_g_error;
			}
			_data_->_tmp13_ = _data_->parser;
			_data_->_tmp14_ = json_parser_get_root (_data_->_tmp13_);
			_data_->_tmp15_ = __vala_JsonNode_copy0 (_data_->_tmp14_);
			_data_->root = _data_->_tmp15_;
			_data_->_tmp17_ = _data_->root;
			if (_data_->_tmp17_ == NULL) {
				_data_->_tmp16_ = TRUE;
			} else {
				_data_->_tmp18_ = _data_->root;
				_data_->_tmp16_ = json_node_get_node_type (_data_->_tmp18_) != JSON_NODE_OBJECT;
			}
			if (_data_->_tmp16_) {
				__vala_JsonNode_free0 (_data_->root);
				_g_object_unref0 (_data_->parser);
				_g_free0 (_data_->line);
				continue;
			}
			_data_->_tmp19_ = _data_->root;
			_data_->_tmp20_ = json_node_get_object (_data_->_tmp19_);
			_data_->_tmp21_ = _json_object_ref0 (_data_->_tmp20_);
			_data_->obj = _data_->_tmp21_;
			_data_->_tmp22_ = _data_->obj;
			if (!json_object_has_member (_data_->_tmp22_, "id")) {
				_json_object_unref0 (_data_->obj);
				__vala_JsonNode_free0 (_data_->root);
				_g_object_unref0 (_data_->parser);
				_g_free0 (_data_->line);
				continue;
			}
			_data_->_tmp23_ = _data_->obj;
			_data_->resp_id = (gint) json_object_get_int_member (_data_->_tmp23_, "id");
			_data_->_tmp24_ = dc_rpc_client_find_pending (_data_->self, _data_->resp_id);
			_data_->pc = _data_->_tmp24_;
			_data_->_tmp25_ = _data_->pc;
			if (_data_->_tmp25_ == NULL) {
				_dc_pending_call_unref0 (_data_->pc);
				_json_object_unref0 (_data_->obj);
				__vala_JsonNode_free0 (_data_->root);
				_g_object_unref0 (_data_->parser);
				_g_free0 (_data_->line);
				continue;
			}
			_data_->_tmp27_ = _data_->obj;
			if (json_object_has_member (_data_->_tmp27_, "error")) {
				_data_->_tmp28_ = _data_->obj;
				_data_->_tmp29_ = json_object_get_member (_data_->_tmp28_, "error");
				_data_->_tmp26_ = !json_node_is_null (_data_->_tmp29_);
			} else {
				_data_->_tmp26_ = FALSE;
			}
			if (_data_->_tmp26_) {
				_data_->_tmp30_ = _data_->obj;
				_data_->_tmp31_ = json_object_get_object_member (_data_->_tmp30_, "error");
				_data_->_tmp32_ = _json_object_ref0 (_data_->_tmp31_);
				_data_->err = _data_->_tmp32_;
				_data_->_tmp34_ = _data_->err;
				if (json_object_has_member (_data_->_tmp34_, "message")) {
					_data_->_tmp35_ = _data_->err;
					_data_->_tmp36_ = json_object_get_string_member (_data_->_tmp35_, "message");
					_data_->_tmp33_ = _data_->_tmp36_;
				} else {
					_data_->_tmp33_ = "Unknown RPC error";
				}
				_data_->_tmp37_ = _data_->pc;
				_data_->_tmp38_ = g_strdup (_data_->_tmp33_);
				_g_free0 (_data_->_tmp37_->error_msg);
				_data_->_tmp37_->error_msg = _data_->_tmp38_;
				_json_object_unref0 (_data_->err);
			} else {
				_data_->_tmp39_ = _data_->obj;
				if (json_object_has_member (_data_->_tmp39_, "result")) {
					_data_->_tmp40_ = _data_->obj;
					_data_->_tmp41_ = json_object_get_member (_data_->_tmp40_, "result");
					_data_->_tmp42_ = __vala_JsonNode_copy0 (_data_->_tmp41_);
					_data_->result_member = _data_->_tmp42_;
					_data_->_tmp44_ = _data_->result_member;
					if (_data_->_tmp44_ != NULL) {
						_data_->_tmp45_ = _data_->result_member;
						_data_->_tmp46_ = json_node_copy (_data_->_tmp45_);
						__vala_JsonNode_free0 (_data_->_tmp43_);
						_data_->_tmp43_ = _data_->_tmp46_;
					} else {
						__vala_JsonNode_free0 (_data_->_tmp43_);
						_data_->_tmp43_ = NULL;
					}
					_data_->_tmp47_ = _data_->pc;
					_data_->_tmp48_ = _data_->_tmp43_;
					_data_->_tmp43_ = NULL;
					__vala_JsonNode_free0 (_data_->_tmp47_->result);
					_data_->_tmp47_->result = _data_->_tmp48_;
					__vala_JsonNode_free0 (_data_->_tmp43_);
					__vala_JsonNode_free0 (_data_->result_member);
				}
			}
			_data_->_tmp49_ = _data_->pc;
			_data_->_tmp50_ = _data_->_tmp49_->callback;
			_data_->_tmp50__target = _data_->_tmp49_->callback_target;
			if (_data_->_tmp50_ != NULL) {
				_data_->_tmp51_ = _data_->pc;
				_data_->_tmp52_ = _data_->_tmp51_->callback;
				_data_->_tmp52__target = _data_->_tmp51_->callback_target;
				_data_->_tmp52__target_destroy_notify = _data_->_tmp51_->callback_target_destroy_notify;
				_data_->_tmp51_->callback = NULL;
				_data_->_tmp51_->callback_target = NULL;
				_data_->_tmp51_->callback_target_destroy_notify = NULL;
				_data_->cb = _data_->_tmp52_;
				_data_->cb_target = _data_->_tmp52__target;
				_data_->cb_target_destroy_notify = _data_->_tmp52__target_destroy_notify;
				_data_->_tmp53_ = _data_->pc;
				(_data_->_tmp53_->callback_target_destroy_notify == NULL) ? NULL : (_data_->_tmp53_->callback_target_destroy_notify (_data_->_tmp53_->callback_target), NULL);
				_data_->_tmp53_->callback = NULL;
				_data_->_tmp53_->callback_target = NULL;
				_data_->_tmp53_->callback_target_destroy_notify = NULL;
				_data_->_tmp53_->callback = NULL;
				_data_->_tmp53_->callback_target = NULL;
				_data_->_tmp53_->callback_target_destroy_notify = NULL;
				_data_->_tmp54_ = _data_->cb;
				_data_->_tmp54__target = _data_->cb_target;
				_data_->_tmp54__target_destroy_notify = _data_->cb_target_destroy_notify;
				_data_->cb = NULL;
				_data_->cb_target = NULL;
				_data_->cb_target_destroy_notify = NULL;
				g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _data_->_tmp54_, _data_->_tmp54__target, _data_->_tmp54__target_destroy_notify);
				(_data_->cb_target_destroy_notify == NULL) ? NULL : (_data_->cb_target_destroy_notify (_data_->cb_target), NULL);
				_data_->cb = NULL;
				_data_->cb_target = NULL;
				_data_->cb_target_destroy_notify = NULL;
			}
			_dc_pending_call_unref0 (_data_->pc);
			_json_object_unref0 (_data_->obj);
			__vala_JsonNode_free0 (_data_->root);
			_g_object_unref0 (_data_->parser);
			_g_free0 (_data_->line);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp55_ = _data_->e;
		_data_->_tmp56_ = _data_->_tmp55_->message;
		g_warning ("rpc_client.vala:174: RPC read loop error: %s", _data_->_tmp56_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	dc_rpc_client_set_is_connected (_data_->self, FALSE);
	g_signal_emit (_data_->self, dc_rpc_client_signals[DC_RPC_CLIENT_DISCONNECTED_SIGNAL], 0, "RPC server closed");
	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 gint
vala_g_ptr_array_get_length (GPtrArray* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = (gint) self->len;
	return result;
}

static DcPendingCall*
dc_rpc_client_find_pending (DcRpcClient* self,
                            gint id)
{
	DcPendingCall* result;
	g_return_val_if_fail (self != NULL, NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GPtrArray* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				GPtrArray* _tmp5_;
				gconstpointer _tmp6_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->pending;
				_tmp3_ = vala_g_ptr_array_get_length (_tmp2_);
				_tmp4_ = _tmp3_;
				if (!(i < _tmp4_)) {
					break;
				}
				_tmp5_ = self->priv->pending;
				_tmp6_ = g_ptr_array_index (_tmp5_, (guint) i);
				if (((DcPendingCall*) _tmp6_)->id == id) {
					GPtrArray* _tmp7_;
					gconstpointer _tmp8_;
					DcPendingCall* _tmp9_;
					_tmp7_ = self->priv->pending;
					_tmp8_ = g_ptr_array_index (_tmp7_, (guint) i);
					_tmp9_ = _dc_pending_call_ref0 ((DcPendingCall*) _tmp8_);
					result = _tmp9_;
					return result;
				}
			}
		}
	}
	result = NULL;
	return result;
}

static void
dc_rpc_client_remove_pending (DcRpcClient* self,
                              gint id)
{
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				GPtrArray* _tmp2_;
				gint _tmp3_;
				gint _tmp4_;
				GPtrArray* _tmp5_;
				gconstpointer _tmp6_;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->pending;
				_tmp3_ = vala_g_ptr_array_get_length (_tmp2_);
				_tmp4_ = _tmp3_;
				if (!(i < _tmp4_)) {
					break;
				}
				_tmp5_ = self->priv->pending;
				_tmp6_ = g_ptr_array_index (_tmp5_, (guint) i);
				if (((DcPendingCall*) _tmp6_)->id == id) {
					GPtrArray* _tmp7_;
					_tmp7_ = self->priv->pending;
					g_ptr_array_remove_index (_tmp7_, (guint) i);
					return;
				}
			}
		}
	}
}

static void
dc_rpc_client_get_all_accounts_data_free (gpointer _data)
{
	DcRpcClientGetAllAccountsData* _data_;
	_data_ = _data;
	__vala_JsonNode_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetAllAccountsData, _data_);
}

void
dc_rpc_client_get_all_accounts (DcRpcClient* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientGetAllAccountsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetAllAccountsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_all_accounts_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_get_all_accounts_co (_data_);
}

JsonNode*
dc_rpc_client_get_all_accounts_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	JsonNode* result;
	DcRpcClientGetAllAccountsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_all_accounts_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientGetAllAccountsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_all_accounts_co (_data_);
}

static gboolean
dc_rpc_client_get_all_accounts_co (DcRpcClientGetAllAccountsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = dc_params_begin ();
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = dc_params_build (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_all_accounts", _data_->_tmp4_, dc_rpc_client_get_all_accounts_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp5_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp6_ = _data_->_tmp5_;
	__vala_JsonNode_free0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp2_);
	_data_->_tmp0_ = _data_->_tmp6_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp7_;
	__vala_JsonNode_free0 (_data_->_tmp0_);
	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 void
dc_rpc_client_add_account_data_free (gpointer _data)
{
	DcRpcClientAddAccountData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAddAccountData, _data_);
}

void
dc_rpc_client_add_account (DcRpcClient* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientAddAccountData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientAddAccountData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_add_account_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_add_account_co (_data_);
}

gint
dc_rpc_client_add_account_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	gint result;
	DcRpcClientAddAccountData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_add_account_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientAddAccountData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_add_account_co (_data_);
}

static gboolean
dc_rpc_client_add_account_co (DcRpcClientAddAccountData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_build (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "add_account", _data_->_tmp3_, dc_rpc_client_add_account_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp5_ = _data_->_tmp4_;
	__vala_JsonNode_free0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp5_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_select_account_data_free (gpointer _data)
{
	DcRpcClientSelectAccountData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSelectAccountData, _data_);
}

void
dc_rpc_client_select_account (DcRpcClient* self,
                              gint acct_id,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientSelectAccountData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSelectAccountData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_select_account_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_select_account_co (_data_);
}

void
dc_rpc_client_select_account_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientSelectAccountData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_select_account_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientSelectAccountData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_select_account_co (_data_);
}

static gboolean
dc_rpc_client_select_account_co (DcRpcClientSelectAccountData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "select_account", _data_->_tmp5_, dc_rpc_client_select_account_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_is_configured_data_free (gpointer _data)
{
	DcRpcClientIsConfiguredData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientIsConfiguredData, _data_);
}

void
dc_rpc_client_is_configured (DcRpcClient* self,
                             gint acct_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientIsConfiguredData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientIsConfiguredData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_is_configured_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_is_configured_co (_data_);
}

gboolean
dc_rpc_client_is_configured_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	gboolean result;
	DcRpcClientIsConfiguredData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gboolean _tmp0_ = FALSE;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_is_configured_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientIsConfiguredData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_is_configured_co (_data_);
}

static gboolean
dc_rpc_client_is_configured_co (DcRpcClientIsConfiguredData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "is_configured", _data_->_tmp5_, dc_rpc_client_is_configured_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = json_node_get_boolean (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_remove_account_data_free (gpointer _data)
{
	DcRpcClientRemoveAccountData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientRemoveAccountData, _data_);
}

void
dc_rpc_client_remove_account (DcRpcClient* self,
                              gint acct_id,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientRemoveAccountData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientRemoveAccountData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_remove_account_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_remove_account_co (_data_);
}

void
dc_rpc_client_remove_account_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientRemoveAccountData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_remove_account_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientRemoveAccountData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_remove_account_co (_data_);
}

static gboolean
dc_rpc_client_remove_account_co (DcRpcClientRemoveAccountData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "remove_account", _data_->_tmp5_, dc_rpc_client_remove_account_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_start_io_data_free (gpointer _data)
{
	DcRpcClientStartIoData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStartIoData, _data_);
}

void
dc_rpc_client_start_io (DcRpcClient* self,
                        gint acct_id,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_)
{
	DcRpcClientStartIoData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStartIoData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_start_io_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_start_io_co (_data_);
}

void
dc_rpc_client_start_io_finish (DcRpcClient* self,
                               GAsyncResult* _res_,
                               GError** error)
{
	DcRpcClientStartIoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_start_io_ready (GObject* source_object,
                              GAsyncResult* _res_,
                              gpointer _user_data_)
{
	DcRpcClientStartIoData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_start_io_co (_data_);
}

static gboolean
dc_rpc_client_start_io_co (DcRpcClientStartIoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "start_io", _data_->_tmp5_, dc_rpc_client_start_io_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_stop_io_data_free (gpointer _data)
{
	DcRpcClientStopIoData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStopIoData, _data_);
}

void
dc_rpc_client_stop_io (DcRpcClient* self,
                       GAsyncReadyCallback _callback_,
                       gpointer _user_data_)
{
	DcRpcClientStopIoData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStopIoData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_stop_io_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_stop_io_co (_data_);
}

void
dc_rpc_client_stop_io_finish (DcRpcClient* self,
                              GAsyncResult* _res_,
                              GError** error)
{
	DcRpcClientStopIoData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_stop_io_ready (GObject* source_object,
                             GAsyncResult* _res_,
                             gpointer _user_data_)
{
	DcRpcClientStopIoData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_stop_io_co (_data_);
}

static gboolean
dc_rpc_client_stop_io_co (DcRpcClientStopIoData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_build (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "stop_io", _data_->_tmp6_, dc_rpc_client_stop_io_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp7_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp8_ = _data_->_tmp7_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	__vala_JsonNode_free0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_get_connectivity_data_free (gpointer _data)
{
	DcRpcClientGetConnectivityData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetConnectivityData, _data_);
}

void
dc_rpc_client_get_connectivity (DcRpcClient* self,
                                gint acct_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientGetConnectivityData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetConnectivityData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_connectivity_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_connectivity_co (_data_);
}

gint
dc_rpc_client_get_connectivity_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	gint result;
	DcRpcClientGetConnectivityData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_get_connectivity_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientGetConnectivityData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_connectivity_co (_data_);
}

static gboolean
dc_rpc_client_get_connectivity_co (DcRpcClientGetConnectivityData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->acct_id > 0) {
		_data_->_tmp0_ = _data_->acct_id;
	} else {
		_data_->_tmp1_ = _data_->self->priv->_account_id;
		_data_->_tmp0_ = _data_->_tmp1_;
	}
	_data_->id = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_begin ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_connectivity", _data_->_tmp7_, dc_rpc_client_get_connectivity_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_connectivity_html_data_free (gpointer _data)
{
	DcRpcClientGetConnectivityHtmlData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetConnectivityHtmlData, _data_);
}

void
dc_rpc_client_get_connectivity_html (DcRpcClient* self,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientGetConnectivityHtmlData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetConnectivityHtmlData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_connectivity_html_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_connectivity_html_co (_data_);
}

gchar*
dc_rpc_client_get_connectivity_html_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	gchar* result;
	DcRpcClientGetConnectivityHtmlData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_connectivity_html_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientGetConnectivityHtmlData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_connectivity_html_co (_data_);
}

static gboolean
dc_rpc_client_get_connectivity_html_co (DcRpcClientGetConnectivityHtmlData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->acct_id > 0) {
		_data_->_tmp0_ = _data_->acct_id;
	} else {
		_data_->_tmp1_ = _data_->self->priv->_account_id;
		_data_->_tmp0_ = _data_->_tmp1_;
	}
	_data_->id = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_begin ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_connectivity_html", _data_->_tmp7_, dc_rpc_client_get_connectivity_html_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp10_ = json_node_get_string (_data_->_result_);
	_data_->_tmp11_ = g_strdup (_data_->_tmp10_);
	_data_->result = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_account_file_size_data_free (gpointer _data)
{
	DcRpcClientGetAccountFileSizeData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetAccountFileSizeData, _data_);
}

void
dc_rpc_client_get_account_file_size (DcRpcClient* self,
                                     gint acct_id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientGetAccountFileSizeData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetAccountFileSizeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_account_file_size_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_account_file_size_co (_data_);
}

gint64
dc_rpc_client_get_account_file_size_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	gint64 result;
	DcRpcClientGetAccountFileSizeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint64 _tmp0_ = 0LL;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_get_account_file_size_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientGetAccountFileSizeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_account_file_size_co (_data_);
}

static gboolean
dc_rpc_client_get_account_file_size_co (DcRpcClientGetAccountFileSizeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->acct_id > 0) {
		_data_->_tmp0_ = _data_->acct_id;
	} else {
		_data_->_tmp1_ = _data_->self->priv->_account_id;
		_data_->_tmp0_ = _data_->_tmp1_;
	}
	_data_->id = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_begin ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_account_file_size", _data_->_tmp7_, dc_rpc_client_get_account_file_size_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_blob_dir_data_free (gpointer _data)
{
	DcRpcClientGetBlobDirData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetBlobDirData, _data_);
}

void
dc_rpc_client_get_blob_dir (DcRpcClient* self,
                            gint acct_id,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	DcRpcClientGetBlobDirData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetBlobDirData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_blob_dir_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_blob_dir_co (_data_);
}

gchar*
dc_rpc_client_get_blob_dir_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	gchar* result;
	DcRpcClientGetBlobDirData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_blob_dir_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	DcRpcClientGetBlobDirData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_blob_dir_co (_data_);
}

static gboolean
dc_rpc_client_get_blob_dir_co (DcRpcClientGetBlobDirData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->acct_id > 0) {
		_data_->_tmp0_ = _data_->acct_id;
	} else {
		_data_->_tmp1_ = _data_->self->priv->_account_id;
		_data_->_tmp0_ = _data_->_tmp1_;
	}
	_data_->id = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_begin ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_blob_dir", _data_->_tmp7_, dc_rpc_client_get_blob_dir_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp10_ = json_node_is_null (_data_->_result_);
	}
	if (_data_->_tmp10_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp11_ = json_node_get_string (_data_->_result_);
	_data_->_tmp12_ = g_strdup (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_add_transport_from_qr_data_free (gpointer _data)
{
	DcRpcClientAddTransportFromQrData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAddTransportFromQrData, _data_);
}

void
dc_rpc_client_add_transport_from_qr (DcRpcClient* self,
                                     gint acct_id,
                                     const gchar* qr_text,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientAddTransportFromQrData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientAddTransportFromQrData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_add_transport_from_qr_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_add_transport_from_qr_co (_data_);
}

void
dc_rpc_client_add_transport_from_qr_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	DcRpcClientAddTransportFromQrData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_add_transport_from_qr_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientAddTransportFromQrData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_add_transport_from_qr_co (_data_);
}

static gboolean
dc_rpc_client_add_transport_from_qr_co (DcRpcClientAddTransportFromQrData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "add_transport_from_qr", _data_->_tmp7_, dc_rpc_client_add_transport_from_qr_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_get_backup_data_free (gpointer _data)
{
	DcRpcClientGetBackupData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetBackupData, _data_);
}

void
dc_rpc_client_get_backup (DcRpcClient* self,
                          gint acct_id,
                          const gchar* qr_text,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_)
{
	DcRpcClientGetBackupData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetBackupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_backup_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_get_backup_co (_data_);
}

void
dc_rpc_client_get_backup_finish (DcRpcClient* self,
                                 GAsyncResult* _res_,
                                 GError** error)
{
	DcRpcClientGetBackupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_get_backup_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_)
{
	DcRpcClientGetBackupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_backup_co (_data_);
}

static gboolean
dc_rpc_client_get_backup_co (DcRpcClientGetBackupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_backup", _data_->_tmp7_, dc_rpc_client_get_backup_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_provide_backup_data_free (gpointer _data)
{
	DcRpcClientProvideBackupData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientProvideBackupData, _data_);
}

void
dc_rpc_client_provide_backup (DcRpcClient* self,
                              gint acct_id,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientProvideBackupData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientProvideBackupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_provide_backup_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_provide_backup_co (_data_);
}

void
dc_rpc_client_provide_backup_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientProvideBackupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_provide_backup_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientProvideBackupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_provide_backup_co (_data_);
}

static gboolean
dc_rpc_client_provide_backup_co (DcRpcClientProvideBackupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "provide_backup", _data_->_tmp5_, dc_rpc_client_provide_backup_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_get_backup_qr_data_free (gpointer _data)
{
	DcRpcClientGetBackupQrData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetBackupQrData, _data_);
}

void
dc_rpc_client_get_backup_qr (DcRpcClient* self,
                             gint acct_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientGetBackupQrData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetBackupQrData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_backup_qr_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_backup_qr_co (_data_);
}

gchar*
dc_rpc_client_get_backup_qr_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	gchar* result;
	DcRpcClientGetBackupQrData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_backup_qr_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientGetBackupQrData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_backup_qr_co (_data_);
}

static gboolean
dc_rpc_client_get_backup_qr_co (DcRpcClientGetBackupQrData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_backup_qr", _data_->_tmp5_, dc_rpc_client_get_backup_qr_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = json_node_get_string (_data_->_result_);
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_create_qr_svg_data_free (gpointer _data)
{
	DcRpcClientCreateQrSvgData* _data_;
	_data_ = _data;
	_g_free0 (_data_->text);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCreateQrSvgData, _data_);
}

void
dc_rpc_client_create_qr_svg (DcRpcClient* self,
                             const gchar* text,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientCreateQrSvgData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (text != NULL);
	_data_ = g_slice_new0 (DcRpcClientCreateQrSvgData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_create_qr_svg_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (text);
	_g_free0 (_data_->text);
	_data_->text = _tmp1_;
	dc_rpc_client_create_qr_svg_co (_data_);
}

gchar*
dc_rpc_client_create_qr_svg_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	gchar* result;
	DcRpcClientCreateQrSvgData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_create_qr_svg_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientCreateQrSvgData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_create_qr_svg_co (_data_);
}

static gboolean
dc_rpc_client_create_qr_svg_co (DcRpcClientCreateQrSvgData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_string (_data_->_tmp1_, _data_->text);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "create_qr_svg", _data_->_tmp5_, dc_rpc_client_create_qr_svg_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp7_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = json_node_get_string (_data_->_result_);
	_data_->_tmp9_ = g_strdup (_data_->_tmp8_);
	_data_->result = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_chat_securejoin_qr_code_data_free (gpointer _data)
{
	DcRpcClientGetChatSecurejoinQrCodeData* _data_;
	_data_ = _data;
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatSecurejoinQrCodeData, _data_);
}

void
dc_rpc_client_get_chat_securejoin_qr_code (DcRpcClient* self,
                                           gint acct_id,
                                           gint chat_id,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_)
{
	DcRpcClientGetChatSecurejoinQrCodeData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatSecurejoinQrCodeData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chat_securejoin_qr_code_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->chat_id = chat_id;
	dc_rpc_client_get_chat_securejoin_qr_code_co (_data_);
}

gchar*
dc_rpc_client_get_chat_securejoin_qr_code_finish (DcRpcClient* self,
                                                  GAsyncResult* _res_,
                                                  GError** error)
{
	gchar* result;
	DcRpcClientGetChatSecurejoinQrCodeData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_chat_securejoin_qr_code_ready (GObject* source_object,
                                                 GAsyncResult* _res_,
                                                 gpointer _user_data_)
{
	DcRpcClientGetChatSecurejoinQrCodeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chat_securejoin_qr_code_co (_data_);
}

static gboolean
dc_rpc_client_get_chat_securejoin_qr_code_co (DcRpcClientGetChatSecurejoinQrCodeData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_g_object_unref0 (_data_->_tmp1_);
	_data_->p = _data_->_tmp3_;
	if (_data_->chat_id > 0) {
		_data_->_tmp4_ = _data_->p;
		_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
		_data_->_tmp6_ = _data_->_tmp5_;
		_g_object_unref0 (_data_->_tmp6_);
	} else {
		_data_->_tmp7_ = _data_->p;
		_data_->_tmp8_ = dc_params_add_null (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_g_object_unref0 (_data_->_tmp9_);
	}
	_data_->_tmp10_ = _data_->p;
	_data_->_tmp11_ = dc_params_build (_data_->_tmp10_);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chat_securejoin_qr_code", _data_->_tmp12_, dc_rpc_client_get_chat_securejoin_qr_code_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp13_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp14_ = _data_->_tmp13_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	_data_->_result_ = _data_->_tmp14_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->p);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp15_ = json_node_get_string (_data_->_result_);
	_data_->_tmp16_ = g_strdup (_data_->_tmp15_);
	_data_->result = _data_->_tmp16_;
	__vala_JsonNode_free0 (_data_->_result_);
	_g_object_unref0 (_data_->p);
	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 void
dc_rpc_client_stop_ongoing_process_data_free (gpointer _data)
{
	DcRpcClientStopOngoingProcessData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientStopOngoingProcessData, _data_);
}

void
dc_rpc_client_stop_ongoing_process (DcRpcClient* self,
                                    gint acct_id,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	DcRpcClientStopOngoingProcessData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientStopOngoingProcessData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_stop_ongoing_process_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_stop_ongoing_process_co (_data_);
}

void
dc_rpc_client_stop_ongoing_process_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	DcRpcClientStopOngoingProcessData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_stop_ongoing_process_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	DcRpcClientStopOngoingProcessData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_stop_ongoing_process_co (_data_);
}

static gboolean
dc_rpc_client_stop_ongoing_process_co (DcRpcClientStopOngoingProcessData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_build (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "stop_ongoing_process", _data_->_tmp5_, dc_rpc_client_stop_ongoing_process_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp6_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp7_ = _data_->_tmp6_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	__vala_JsonNode_free0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_check_qr_data_free (gpointer _data)
{
	DcRpcClientCheckQrData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCheckQrData, _data_);
}

void
dc_rpc_client_check_qr (DcRpcClient* self,
                        gint acct_id,
                        const gchar* qr_text,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_)
{
	DcRpcClientCheckQrData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientCheckQrData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_check_qr_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_check_qr_co (_data_);
}

JsonObject*
dc_rpc_client_check_qr_finish (DcRpcClient* self,
                               GAsyncResult* _res_,
                               GError** error)
{
	JsonObject* result;
	DcRpcClientCheckQrData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_check_qr_ready (GObject* source_object,
                              GAsyncResult* _res_,
                              gpointer _user_data_)
{
	DcRpcClientCheckQrData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_check_qr_co (_data_);
}

static gboolean
dc_rpc_client_check_qr_co (DcRpcClientCheckQrData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "check_qr", _data_->_tmp7_, dc_rpc_client_check_qr_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp10_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_OBJECT;
	}
	if (_data_->_tmp10_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp11_ = json_node_get_object (_data_->_result_);
	_data_->_tmp12_ = _json_object_ref0 (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_secure_join_data_free (gpointer _data)
{
	DcRpcClientSecureJoinData* _data_;
	_data_ = _data;
	_g_free0 (_data_->qr_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSecureJoinData, _data_);
}

void
dc_rpc_client_secure_join (DcRpcClient* self,
                           gint acct_id,
                           const gchar* qr_text,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientSecureJoinData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (qr_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientSecureJoinData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_secure_join_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (qr_text);
	_g_free0 (_data_->qr_text);
	_data_->qr_text = _tmp1_;
	dc_rpc_client_secure_join_co (_data_);
}

gint
dc_rpc_client_secure_join_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	gint result;
	DcRpcClientSecureJoinData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_secure_join_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientSecureJoinData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_secure_join_co (_data_);
}

static gboolean
dc_rpc_client_secure_join_co (DcRpcClientSecureJoinData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->qr_text);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "secure_join", _data_->_tmp7_, dc_rpc_client_secure_join_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_add_or_update_transport_data_free (gpointer _data)
{
	DcRpcClientAddOrUpdateTransportData* _data_;
	_data_ = _data;
	_g_free0 (_data_->email);
	_g_free0 (_data_->password);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAddOrUpdateTransportData, _data_);
}

void
dc_rpc_client_add_or_update_transport (DcRpcClient* self,
                                       gint acct_id,
                                       const gchar* email,
                                       const gchar* password,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DcRpcClientAddOrUpdateTransportData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (email != NULL);
	g_return_if_fail (password != NULL);
	_data_ = g_slice_new0 (DcRpcClientAddOrUpdateTransportData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_add_or_update_transport_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (email);
	_g_free0 (_data_->email);
	_data_->email = _tmp1_;
	_tmp2_ = g_strdup (password);
	_g_free0 (_data_->password);
	_data_->password = _tmp2_;
	dc_rpc_client_add_or_update_transport_co (_data_);
}

void
dc_rpc_client_add_or_update_transport_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	DcRpcClientAddOrUpdateTransportData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_add_or_update_transport_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	DcRpcClientAddOrUpdateTransportData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_add_or_update_transport_co (_data_);
}

static gboolean
dc_rpc_client_add_or_update_transport_co (DcRpcClientAddOrUpdateTransportData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_begin_object (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_set_string_member (_data_->_tmp5_, "addr", _data_->email);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_set_string_member (_data_->_tmp7_, "password", _data_->password);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = dc_params_set_null_member (_data_->_tmp9_, "imapServer");
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = dc_params_set_null_member (_data_->_tmp11_, "imapPort");
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = dc_params_set_null_member (_data_->_tmp13_, "imapSecurity");
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = dc_params_set_null_member (_data_->_tmp15_, "imapUser");
	_data_->_tmp17_ = _data_->_tmp16_;
	_data_->_tmp18_ = dc_params_set_null_member (_data_->_tmp17_, "smtpServer");
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = dc_params_set_null_member (_data_->_tmp19_, "smtpPort");
	_data_->_tmp21_ = _data_->_tmp20_;
	_data_->_tmp22_ = dc_params_set_null_member (_data_->_tmp21_, "smtpSecurity");
	_data_->_tmp23_ = _data_->_tmp22_;
	_data_->_tmp24_ = dc_params_set_null_member (_data_->_tmp23_, "smtpUser");
	_data_->_tmp25_ = _data_->_tmp24_;
	_data_->_tmp26_ = dc_params_set_null_member (_data_->_tmp25_, "smtpPassword");
	_data_->_tmp27_ = _data_->_tmp26_;
	_data_->_tmp28_ = dc_params_set_null_member (_data_->_tmp27_, "certificateChecks");
	_data_->_tmp29_ = _data_->_tmp28_;
	_data_->_tmp30_ = dc_params_set_null_member (_data_->_tmp29_, "oauth2");
	_data_->_tmp31_ = _data_->_tmp30_;
	_data_->_tmp32_ = dc_params_end_object (_data_->_tmp31_);
	_data_->_tmp33_ = _data_->_tmp32_;
	_data_->_tmp34_ = dc_params_build (_data_->_tmp33_);
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "add_or_update_transport", _data_->_tmp35_, dc_rpc_client_add_or_update_transport_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp36_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp37_ = _data_->_tmp36_;
	__vala_JsonNode_free0 (_data_->_tmp37_);
	__vala_JsonNode_free0 (_data_->_tmp35_);
	_g_object_unref0 (_data_->_tmp33_);
	_g_object_unref0 (_data_->_tmp31_);
	_g_object_unref0 (_data_->_tmp29_);
	_g_object_unref0 (_data_->_tmp27_);
	_g_object_unref0 (_data_->_tmp25_);
	_g_object_unref0 (_data_->_tmp23_);
	_g_object_unref0 (_data_->_tmp21_);
	_g_object_unref0 (_data_->_tmp19_);
	_g_object_unref0 (_data_->_tmp17_);
	_g_object_unref0 (_data_->_tmp15_);
	_g_object_unref0 (_data_->_tmp13_);
	_g_object_unref0 (_data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_list_transports_data_free (gpointer _data)
{
	DcRpcClientListTransportsData* _data_;
	_data_ = _data;
	__vala_JsonNode_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientListTransportsData, _data_);
}

void
dc_rpc_client_list_transports (DcRpcClient* self,
                               gint acct_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientListTransportsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientListTransportsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_list_transports_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	dc_rpc_client_list_transports_co (_data_);
}

JsonNode*
dc_rpc_client_list_transports_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	JsonNode* result;
	DcRpcClientListTransportsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_list_transports_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientListTransportsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_list_transports_co (_data_);
}

static gboolean
dc_rpc_client_list_transports_co (DcRpcClientListTransportsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = dc_params_begin ();
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp2_, _data_->acct_id);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_build (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "list_transports", _data_->_tmp6_, dc_rpc_client_list_transports_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp7_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp8_ = _data_->_tmp7_;
	__vala_JsonNode_free0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp2_);
	_data_->_tmp0_ = _data_->_tmp8_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp0_);
	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 void
dc_rpc_client_delete_transport_data_free (gpointer _data)
{
	DcRpcClientDeleteTransportData* _data_;
	_data_ = _data;
	_g_free0 (_data_->addr);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDeleteTransportData, _data_);
}

void
dc_rpc_client_delete_transport (DcRpcClient* self,
                                gint acct_id,
                                const gchar* addr,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientDeleteTransportData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (addr != NULL);
	_data_ = g_slice_new0 (DcRpcClientDeleteTransportData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_delete_transport_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (addr);
	_g_free0 (_data_->addr);
	_data_->addr = _tmp1_;
	dc_rpc_client_delete_transport_co (_data_);
}

void
dc_rpc_client_delete_transport_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	DcRpcClientDeleteTransportData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_delete_transport_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientDeleteTransportData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_delete_transport_co (_data_);
}

static gboolean
dc_rpc_client_delete_transport_co (DcRpcClientDeleteTransportData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_string (_data_->_tmp3_, _data_->addr);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "delete_transport", _data_->_tmp7_, dc_rpc_client_delete_transport_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_batch_set_config_data_free (gpointer _data)
{
	DcRpcClientBatchSetConfigData* _data_;
	_data_ = _data;
	_g_free0 (_data_->key);
	_g_free0 (_data_->val);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientBatchSetConfigData, _data_);
}

void
dc_rpc_client_batch_set_config (DcRpcClient* self,
                                const gchar* key,
                                const gchar* val,
                                gint acct_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientBatchSetConfigData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	g_return_if_fail (val != NULL);
	_data_ = g_slice_new0 (DcRpcClientBatchSetConfigData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_batch_set_config_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (key);
	_g_free0 (_data_->key);
	_data_->key = _tmp1_;
	_tmp2_ = g_strdup (val);
	_g_free0 (_data_->val);
	_data_->val = _tmp2_;
	_data_->acct_id = acct_id;
	dc_rpc_client_batch_set_config_co (_data_);
}

void
dc_rpc_client_batch_set_config_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	DcRpcClientBatchSetConfigData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_batch_set_config_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientBatchSetConfigData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_batch_set_config_co (_data_);
}

static gboolean
dc_rpc_client_batch_set_config_co (DcRpcClientBatchSetConfigData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->acct_id > 0) {
		_data_->_tmp0_ = _data_->acct_id;
	} else {
		_data_->_tmp1_ = _data_->self->priv->_account_id;
		_data_->_tmp0_ = _data_->_tmp1_;
	}
	_data_->id = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_begin ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_begin_object (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_set_string_member (_data_->_tmp7_, _data_->key, _data_->val);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = dc_params_end_object (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = dc_params_build (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "batch_set_config", _data_->_tmp13_, dc_rpc_client_batch_set_config_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp14_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp15_ = _data_->_tmp14_;
	__vala_JsonNode_free0 (_data_->_tmp15_);
	__vala_JsonNode_free0 (_data_->_tmp13_);
	_g_object_unref0 (_data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_get_config_data_free (gpointer _data)
{
	DcRpcClientGetConfigData* _data_;
	_data_ = _data;
	_g_free0 (_data_->key);
	_g_free0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetConfigData, _data_);
}

void
dc_rpc_client_get_config (DcRpcClient* self,
                          const gchar* key,
                          gint acct_id,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_)
{
	DcRpcClientGetConfigData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (key != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetConfigData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_config_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (key);
	_g_free0 (_data_->key);
	_data_->key = _tmp1_;
	_data_->acct_id = acct_id;
	dc_rpc_client_get_config_co (_data_);
}

gchar*
dc_rpc_client_get_config_finish (DcRpcClient* self,
                                 GAsyncResult* _res_,
                                 GError** error)
{
	gchar* result;
	DcRpcClientGetConfigData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_config_ready (GObject* source_object,
                                GAsyncResult* _res_,
                                gpointer _user_data_)
{
	DcRpcClientGetConfigData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_config_co (_data_);
}

static gboolean
dc_rpc_client_get_config_co (DcRpcClientGetConfigData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (_data_->acct_id > 0) {
		_data_->_tmp0_ = _data_->acct_id;
	} else {
		_data_->_tmp1_ = _data_->self->priv->_account_id;
		_data_->_tmp0_ = _data_->_tmp1_;
	}
	_data_->id = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_begin ();
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_add_string (_data_->_tmp5_, _data_->key);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_build (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_config", _data_->_tmp9_, dc_rpc_client_get_config_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp10_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp11_ = _data_->_tmp10_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->_result_ = _data_->_tmp11_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp12_ = TRUE;
	} else {
		_data_->_tmp12_ = json_node_is_null (_data_->_result_);
	}
	if (_data_->_tmp12_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp13_ = json_node_get_string (_data_->_result_);
	_data_->_tmp14_ = g_strdup (_data_->_tmp13_);
	_data_->result = _data_->_tmp14_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_chatlist_entries_data_free (gpointer _data)
{
	DcRpcClientGetChatlistEntriesData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatlistEntriesData, _data_);
}

void
dc_rpc_client_get_chatlist_entries (DcRpcClient* self,
                                    const gchar* query,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	DcRpcClientGetChatlistEntriesData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatlistEntriesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chatlist_entries_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (query);
	_g_free0 (_data_->query);
	_data_->query = _tmp1_;
	dc_rpc_client_get_chatlist_entries_co (_data_);
}

JsonArray*
dc_rpc_client_get_chatlist_entries_finish (DcRpcClient* self,
                                           GAsyncResult* _res_,
                                           GError** error)
{
	JsonArray* result;
	DcRpcClientGetChatlistEntriesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_chatlist_entries_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	DcRpcClientGetChatlistEntriesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chatlist_entries_co (_data_);
}

static gboolean
dc_rpc_client_get_chatlist_entries_co (DcRpcClientGetChatlistEntriesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->_account_id;
	_data_->_state_ = 1;
	dc_rpc_client_get_chatlist_entries_for (_data_->self, _data_->_tmp1_, _data_->query, dc_rpc_client_get_chatlist_entries_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_rpc_client_get_chatlist_entries_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp3_;
	_json_array_unref0 (_data_->_tmp0_);
	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 void
dc_rpc_client_get_chatlist_entries_for_data_free (gpointer _data)
{
	DcRpcClientGetChatlistEntriesForData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatlistEntriesForData, _data_);
}

void
dc_rpc_client_get_chatlist_entries_for (DcRpcClient* self,
                                        gint acct_id,
                                        const gchar* query,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcRpcClientGetChatlistEntriesForData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatlistEntriesForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chatlist_entries_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (query);
	_g_free0 (_data_->query);
	_data_->query = _tmp1_;
	dc_rpc_client_get_chatlist_entries_for_co (_data_);
}

JsonArray*
dc_rpc_client_get_chatlist_entries_for_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	JsonArray* result;
	DcRpcClientGetChatlistEntriesForData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_chatlist_entries_for_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcRpcClientGetChatlistEntriesForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chatlist_entries_for_co (_data_);
}

static gpointer
_json_array_ref0 (gpointer self)
{
	return self ? json_array_ref (self) : NULL;
}

static gboolean
dc_rpc_client_get_chatlist_entries_for_co (DcRpcClientGetChatlistEntriesForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_null (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_add_string (_data_->_tmp5_, _data_->query);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_add_null (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = dc_params_build (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chatlist_entries", _data_->_tmp11_, dc_rpc_client_get_chatlist_entries_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp12_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp13_ = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp13_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp14_ = json_node_get_array (_data_->_result_);
	_data_->_tmp15_ = _json_array_ref0 (_data_->_tmp14_);
	_data_->result = _data_->_tmp15_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_chatlist_items_by_entries_data_free (gpointer _data)
{
	DcRpcClientGetChatlistItemsByEntriesData* _data_;
	_data_ = _data;
	_json_array_unref0 (_data_->entries);
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatlistItemsByEntriesData, _data_);
}

void
dc_rpc_client_get_chatlist_items_by_entries (DcRpcClient* self,
                                             JsonArray* entries,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	DcRpcClientGetChatlistItemsByEntriesData* _data_;
	DcRpcClient* _tmp0_;
	JsonArray* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (entries != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatlistItemsByEntriesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chatlist_items_by_entries_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _json_array_ref0 (entries);
	_json_array_unref0 (_data_->entries);
	_data_->entries = _tmp1_;
	dc_rpc_client_get_chatlist_items_by_entries_co (_data_);
}

JsonObject*
dc_rpc_client_get_chatlist_items_by_entries_finish (DcRpcClient* self,
                                                    GAsyncResult* _res_,
                                                    GError** error)
{
	JsonObject* result;
	DcRpcClientGetChatlistItemsByEntriesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_chatlist_items_by_entries_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	DcRpcClientGetChatlistItemsByEntriesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chatlist_items_by_entries_co (_data_);
}

static gboolean
dc_rpc_client_get_chatlist_items_by_entries_co (DcRpcClientGetChatlistItemsByEntriesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->_account_id;
	_data_->_state_ = 1;
	dc_rpc_client_get_chatlist_items_by_entries_for (_data_->self, _data_->_tmp1_, _data_->entries, dc_rpc_client_get_chatlist_items_by_entries_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_rpc_client_get_chatlist_items_by_entries_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp3_;
	_json_object_unref0 (_data_->_tmp0_);
	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 void
dc_rpc_client_get_chatlist_items_by_entries_for_data_free (gpointer _data)
{
	DcRpcClientGetChatlistItemsByEntriesForData* _data_;
	_data_ = _data;
	_json_array_unref0 (_data_->entries);
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetChatlistItemsByEntriesForData, _data_);
}

void
dc_rpc_client_get_chatlist_items_by_entries_for (DcRpcClient* self,
                                                 gint acct_id,
                                                 JsonArray* entries,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	DcRpcClientGetChatlistItemsByEntriesForData* _data_;
	DcRpcClient* _tmp0_;
	JsonArray* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (entries != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetChatlistItemsByEntriesForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_chatlist_items_by_entries_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = _json_array_ref0 (entries);
	_json_array_unref0 (_data_->entries);
	_data_->entries = _tmp1_;
	dc_rpc_client_get_chatlist_items_by_entries_for_co (_data_);
}

JsonObject*
dc_rpc_client_get_chatlist_items_by_entries_for_finish (DcRpcClient* self,
                                                        GAsyncResult* _res_,
                                                        GError** error)
{
	JsonObject* result;
	DcRpcClientGetChatlistItemsByEntriesForData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_chatlist_items_by_entries_for_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_)
{
	DcRpcClientGetChatlistItemsByEntriesForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_chatlist_items_by_entries_for_co (_data_);
}

static gboolean
dc_rpc_client_get_chatlist_items_by_entries_for_co (DcRpcClientGetChatlistItemsByEntriesForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_json_array (_data_->_tmp3_, _data_->entries);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chatlist_items_by_entries", _data_->_tmp7_, dc_rpc_client_get_chatlist_items_by_entries_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp10_ = json_node_get_object (_data_->_result_);
	_data_->_tmp11_ = _json_object_ref0 (_data_->_tmp10_);
	_data_->result = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_full_chat_by_id_data_free (gpointer _data)
{
	DcRpcClientGetFullChatByIdData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetFullChatByIdData, _data_);
}

void
dc_rpc_client_get_full_chat_by_id (DcRpcClient* self,
                                   gint chat_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientGetFullChatByIdData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetFullChatByIdData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_full_chat_by_id_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_get_full_chat_by_id_co (_data_);
}

JsonObject*
dc_rpc_client_get_full_chat_by_id_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	JsonObject* result;
	DcRpcClientGetFullChatByIdData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_full_chat_by_id_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientGetFullChatByIdData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_full_chat_by_id_co (_data_);
}

static gboolean
dc_rpc_client_get_full_chat_by_id_co (DcRpcClientGetFullChatByIdData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_full_chat_by_id", _data_->_tmp8_, dc_rpc_client_get_full_chat_by_id_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp11_ = json_node_get_object (_data_->_result_);
	_data_->_tmp12_ = _json_object_ref0 (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_message_ids_data_free (gpointer _data)
{
	DcRpcClientGetMessageIdsData* _data_;
	_data_ = _data;
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessageIdsData, _data_);
}

void
dc_rpc_client_get_message_ids (DcRpcClient* self,
                               gint chat_id,
                               gboolean info_only,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientGetMessageIdsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessageIdsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_message_ids_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->info_only = info_only;
	dc_rpc_client_get_message_ids_co (_data_);
}

JsonArray*
dc_rpc_client_get_message_ids_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	JsonArray* result;
	DcRpcClientGetMessageIdsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_message_ids_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientGetMessageIdsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_message_ids_co (_data_);
}

static gboolean
dc_rpc_client_get_message_ids_co (DcRpcClientGetMessageIdsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->_account_id;
	_data_->_state_ = 1;
	dc_rpc_client_get_message_ids_for (_data_->self, _data_->_tmp1_, _data_->chat_id, _data_->info_only, dc_rpc_client_get_message_ids_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_rpc_client_get_message_ids_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp3_;
	_json_array_unref0 (_data_->_tmp0_);
	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 void
dc_rpc_client_get_message_ids_for_data_free (gpointer _data)
{
	DcRpcClientGetMessageIdsForData* _data_;
	_data_ = _data;
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessageIdsForData, _data_);
}

void
dc_rpc_client_get_message_ids_for (DcRpcClient* self,
                                   gint acct_id,
                                   gint chat_id,
                                   gboolean info_only,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientGetMessageIdsForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessageIdsForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_message_ids_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->chat_id = chat_id;
	_data_->info_only = info_only;
	dc_rpc_client_get_message_ids_for_co (_data_);
}

JsonArray*
dc_rpc_client_get_message_ids_for_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	JsonArray* result;
	DcRpcClientGetMessageIdsForData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_message_ids_for_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientGetMessageIdsForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_message_ids_for_co (_data_);
}

static gboolean
dc_rpc_client_get_message_ids_for_co (DcRpcClientGetMessageIdsForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->chat_id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_add_bool (_data_->_tmp5_, _data_->info_only);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_add_bool (_data_->_tmp7_, FALSE);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_tmp10_ = dc_params_build (_data_->_tmp9_);
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_message_ids", _data_->_tmp11_, dc_rpc_client_get_message_ids_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp12_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp13_ = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp13_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp14_ = json_node_get_array (_data_->_result_);
	_data_->_tmp15_ = _json_array_ref0 (_data_->_tmp14_);
	_data_->result = _data_->_tmp15_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_message_data_free (gpointer _data)
{
	DcRpcClientGetMessageData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessageData, _data_);
}

void
dc_rpc_client_get_message (DcRpcClient* self,
                           gint msg_id,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientGetMessageData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_message_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	dc_rpc_client_get_message_co (_data_);
}

JsonObject*
dc_rpc_client_get_message_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	JsonObject* result;
	DcRpcClientGetMessageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_message_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientGetMessageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_message_co (_data_);
}

static gboolean
dc_rpc_client_get_message_co (DcRpcClientGetMessageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->msg_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_message", _data_->_tmp8_, dc_rpc_client_get_message_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp11_ = json_node_get_object (_data_->_result_);
	_data_->_tmp12_ = _json_object_ref0 (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_fetch_message_data_free (gpointer _data)
{
	DcRpcClientFetchMessageData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientFetchMessageData, _data_);
}

void
dc_rpc_client_fetch_message (DcRpcClient* self,
                             gint msg_id,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientFetchMessageData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientFetchMessageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_fetch_message_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	dc_rpc_client_fetch_message_co (_data_);
}

DcMessage*
dc_rpc_client_fetch_message_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	DcMessage* result;
	DcRpcClientFetchMessageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_fetch_message_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientFetchMessageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_fetch_message_co (_data_);
}

static gboolean
dc_rpc_client_fetch_message_co (DcRpcClientFetchMessageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	dc_rpc_client_get_message (_data_->self, _data_->msg_id, dc_rpc_client_fetch_message_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = dc_rpc_client_get_message_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->obj = _data_->_tmp0_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->obj == NULL) {
		_data_->result = NULL;
		_json_object_unref0 (_data_->obj);
		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;
	}
	_data_->_tmp1_ = _data_->self->priv->_self_email;
	_data_->_tmp2_ = dc_rpc_client_parse_message (_data_->obj, _data_->_tmp1_);
	_data_->result = _data_->_tmp2_;
	_json_object_unref0 (_data_->obj);
	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 void
dc_rpc_client_get_messages_data_free (gpointer _data)
{
	DcRpcClientGetMessagesData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessagesData, _data_);
}

void
dc_rpc_client_get_messages (DcRpcClient* self,
                            gint* msg_ids,
                            gint msg_ids_length1,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	DcRpcClientGetMessagesData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessagesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_messages_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_get_messages_co (_data_);
}

JsonObject*
dc_rpc_client_get_messages_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	JsonObject* result;
	DcRpcClientGetMessagesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_messages_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	DcRpcClientGetMessagesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_messages_co (_data_);
}

static gboolean
dc_rpc_client_get_messages_co (DcRpcClientGetMessagesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->_account_id;
	_data_->_state_ = 1;
	dc_rpc_client_get_messages_for (_data_->self, _data_->_tmp1_, _data_->msg_ids, (gint) _data_->msg_ids_length1, dc_rpc_client_get_messages_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_rpc_client_get_messages_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp3_;
	_json_object_unref0 (_data_->_tmp0_);
	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 void
dc_rpc_client_get_messages_for_data_free (gpointer _data)
{
	DcRpcClientGetMessagesForData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetMessagesForData, _data_);
}

void
dc_rpc_client_get_messages_for (DcRpcClient* self,
                                gint acct_id,
                                gint* msg_ids,
                                gint msg_ids_length1,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientGetMessagesForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetMessagesForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_messages_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_get_messages_for_co (_data_);
}

JsonObject*
dc_rpc_client_get_messages_for_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	JsonObject* result;
	DcRpcClientGetMessagesForData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_messages_for_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientGetMessagesForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_messages_for_co (_data_);
}

static gboolean
dc_rpc_client_get_messages_for_co (DcRpcClientGetMessagesForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int_array (_data_->_tmp3_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_messages", _data_->_tmp7_, dc_rpc_client_get_messages_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp10_ = json_node_get_object (_data_->_result_);
	_data_->_tmp11_ = _json_object_ref0 (_data_->_tmp10_);
	_data_->result = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_send_msg_data_free (gpointer _data)
{
	DcRpcClientSendMsgData* _data_;
	_data_ = _data;
	_g_free0 (_data_->text);
	_g_free0 (_data_->file_path);
	_g_free0 (_data_->file_name);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSendMsgData, _data_);
}

void
dc_rpc_client_send_msg (DcRpcClient* self,
                        gint chat_id,
                        const gchar* text,
                        const gchar* file_path,
                        const gchar* file_name,
                        gint quoted_msg_id,
                        GAsyncReadyCallback _callback_,
                        gpointer _user_data_)
{
	DcRpcClientSendMsgData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSendMsgData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_send_msg_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_tmp1_ = g_strdup (text);
	_g_free0 (_data_->text);
	_data_->text = _tmp1_;
	_tmp2_ = g_strdup (file_path);
	_g_free0 (_data_->file_path);
	_data_->file_path = _tmp2_;
	_tmp3_ = g_strdup (file_name);
	_g_free0 (_data_->file_name);
	_data_->file_name = _tmp3_;
	_data_->quoted_msg_id = quoted_msg_id;
	dc_rpc_client_send_msg_co (_data_);
}

gint
dc_rpc_client_send_msg_finish (DcRpcClient* self,
                               GAsyncResult* _res_,
                               GError** error)
{
	gint result;
	DcRpcClientSendMsgData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_send_msg_ready (GObject* source_object,
                              GAsyncResult* _res_,
                              gpointer _user_data_)
{
	DcRpcClientSendMsgData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_send_msg_co (_data_);
}

static gboolean
dc_rpc_client_send_msg_co (DcRpcClientSendMsgData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->text);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_add_string (_data_->_tmp8_, _data_->file_path);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = dc_params_add_string (_data_->_tmp10_, _data_->file_name);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_tmp13_ = dc_params_add_null (_data_->_tmp12_);
	_data_->_tmp14_ = _data_->_tmp13_;
	_g_object_unref0 (_data_->_tmp12_);
	_g_object_unref0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->p = _data_->_tmp14_;
	if (_data_->quoted_msg_id > 0) {
		_data_->_tmp15_ = _data_->p;
		_data_->_tmp16_ = dc_params_add_int (_data_->_tmp15_, _data_->quoted_msg_id);
		_data_->_tmp17_ = _data_->_tmp16_;
		_g_object_unref0 (_data_->_tmp17_);
	} else {
		_data_->_tmp18_ = _data_->p;
		_data_->_tmp19_ = dc_params_add_null (_data_->_tmp18_);
		_data_->_tmp20_ = _data_->_tmp19_;
		_g_object_unref0 (_data_->_tmp20_);
	}
	_data_->_tmp21_ = _data_->p;
	_data_->_tmp22_ = dc_params_build (_data_->_tmp21_);
	_data_->_tmp23_ = _data_->_tmp22_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "misc_send_msg", _data_->_tmp23_, dc_rpc_client_send_msg_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp24_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp25_ = _data_->_tmp24_;
	__vala_JsonNode_free0 (_data_->_tmp23_);
	_data_->_result_ = _data_->_tmp25_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->p);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp27_ = _data_->_result_;
	if (_data_->_tmp27_ != NULL) {
		_data_->_tmp28_ = _data_->_result_;
		_data_->_tmp26_ = json_node_get_node_type (_data_->_tmp28_) == JSON_NODE_ARRAY;
	} else {
		_data_->_tmp26_ = FALSE;
	}
	if (_data_->_tmp26_) {
		_data_->_tmp29_ = _data_->_result_;
		_data_->_tmp30_ = json_node_get_array (_data_->_tmp29_);
		_data_->_tmp31_ = _json_array_ref0 (_data_->_tmp30_);
		_data_->arr = _data_->_tmp31_;
		_data_->_tmp32_ = _data_->arr;
		if (json_array_get_length (_data_->_tmp32_) > ((guint) 0)) {
			_data_->_tmp33_ = _data_->arr;
			_data_->result = (gint) json_array_get_int_element (_data_->_tmp33_, (guint) 0);
			_json_array_unref0 (_data_->arr);
			__vala_JsonNode_free0 (_data_->_result_);
			_g_object_unref0 (_data_->p);
			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;
		}
		_json_array_unref0 (_data_->arr);
	}
	_data_->result = 0;
	__vala_JsonNode_free0 (_data_->_result_);
	_g_object_unref0 (_data_->p);
	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 void
dc_rpc_client_send_edit_request_data_free (gpointer _data)
{
	DcRpcClientSendEditRequestData* _data_;
	_data_ = _data;
	_g_free0 (_data_->new_text);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSendEditRequestData, _data_);
}

void
dc_rpc_client_send_edit_request (DcRpcClient* self,
                                 gint msg_id,
                                 const gchar* new_text,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	DcRpcClientSendEditRequestData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_text != NULL);
	_data_ = g_slice_new0 (DcRpcClientSendEditRequestData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_send_edit_request_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_tmp1_ = g_strdup (new_text);
	_g_free0 (_data_->new_text);
	_data_->new_text = _tmp1_;
	dc_rpc_client_send_edit_request_co (_data_);
}

void
dc_rpc_client_send_edit_request_finish (DcRpcClient* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	DcRpcClientSendEditRequestData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_send_edit_request_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	DcRpcClientSendEditRequestData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_send_edit_request_co (_data_);
}

static gboolean
dc_rpc_client_send_edit_request_co (DcRpcClientSendEditRequestData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->msg_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->new_text);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "send_edit_request", _data_->_tmp10_, dc_rpc_client_send_edit_request_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_send_reaction_data_free (gpointer _data)
{
	DcRpcClientSendReactionData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSendReactionData, _data_);
}

void
dc_rpc_client_send_reaction (DcRpcClient* self,
                             gint msg_id,
                             gchar** emojis,
                             gint emojis_length1,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	DcRpcClientSendReactionData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSendReactionData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_send_reaction_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_id = msg_id;
	_data_->emojis = emojis;
	_data_->emojis_length1 = emojis_length1;
	dc_rpc_client_send_reaction_co (_data_);
}

void
dc_rpc_client_send_reaction_finish (DcRpcClient* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	DcRpcClientSendReactionData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_send_reaction_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	DcRpcClientSendReactionData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_send_reaction_co (_data_);
}

static gboolean
dc_rpc_client_send_reaction_co (DcRpcClientSendReactionData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->msg_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string_array (_data_->_tmp6_, _data_->emojis, (gint) _data_->emojis_length1);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "send_reaction", _data_->_tmp10_, dc_rpc_client_send_reaction_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_marknoticed_chat_data_free (gpointer _data)
{
	DcRpcClientMarknoticedChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientMarknoticedChatData, _data_);
}

void
dc_rpc_client_marknoticed_chat (DcRpcClient* self,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientMarknoticedChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientMarknoticedChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_marknoticed_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_marknoticed_chat_co (_data_);
}

void
dc_rpc_client_marknoticed_chat_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	DcRpcClientMarknoticedChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_marknoticed_chat_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientMarknoticedChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_marknoticed_chat_co (_data_);
}

static gboolean
dc_rpc_client_marknoticed_chat_co (DcRpcClientMarknoticedChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "marknoticed_chat", _data_->_tmp8_, dc_rpc_client_marknoticed_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_mark_seen_msgs_data_free (gpointer _data)
{
	DcRpcClientMarkSeenMsgsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientMarkSeenMsgsData, _data_);
}

void
dc_rpc_client_mark_seen_msgs (DcRpcClient* self,
                              gint* msg_ids,
                              gint msg_ids_length1,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientMarkSeenMsgsData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientMarkSeenMsgsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_mark_seen_msgs_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_mark_seen_msgs_co (_data_);
}

void
dc_rpc_client_mark_seen_msgs_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	DcRpcClientMarkSeenMsgsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_mark_seen_msgs_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientMarkSeenMsgsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_mark_seen_msgs_co (_data_);
}

static gboolean
dc_rpc_client_mark_seen_msgs_co (DcRpcClientMarkSeenMsgsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int_array (_data_->_tmp4_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "markseen_msgs", _data_->_tmp8_, dc_rpc_client_mark_seen_msgs_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_get_next_event_data_free (gpointer _data)
{
	DcRpcClientGetNextEventData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetNextEventData, _data_);
}

void
dc_rpc_client_get_next_event (DcRpcClient* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientGetNextEventData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetNextEventData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_next_event_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	dc_rpc_client_get_next_event_co (_data_);
}

JsonObject*
dc_rpc_client_get_next_event_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	JsonObject* result;
	DcRpcClientGetNextEventData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

/**
         * Blocks until the next event from the RPC server.
         * Returns the full event result: { contextId, event: { kind, ... } }
         * This is a global call (not per-account).
         */
static void
dc_rpc_client_get_next_event_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientGetNextEventData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_next_event_co (_data_);
}

static gboolean
dc_rpc_client_get_next_event_co (DcRpcClientGetNextEventData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_build (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_next_event", _data_->_tmp3_, dc_rpc_client_get_next_event_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp5_ = _data_->_tmp4_;
	__vala_JsonNode_free0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp5_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp6_ = TRUE;
	} else {
		_data_->_tmp6_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_OBJECT;
	}
	if (_data_->_tmp6_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp7_ = json_node_get_object (_data_->_result_);
	_data_->_tmp8_ = _json_object_ref0 (_data_->_tmp7_);
	_data_->result = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_contact_ids_data_free (gpointer _data)
{
	DcRpcClientGetContactIdsData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetContactIdsData, _data_);
}

void
dc_rpc_client_get_contact_ids (DcRpcClient* self,
                               const gchar* query,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientGetContactIdsData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetContactIdsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_contact_ids_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (query);
	_g_free0 (_data_->query);
	_data_->query = _tmp1_;
	dc_rpc_client_get_contact_ids_co (_data_);
}

JsonArray*
dc_rpc_client_get_contact_ids_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	JsonArray* result;
	DcRpcClientGetContactIdsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_contact_ids_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientGetContactIdsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_contact_ids_co (_data_);
}

static gboolean
dc_rpc_client_get_contact_ids_co (DcRpcClientGetContactIdsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = _data_->self->priv->_account_id;
	_data_->_state_ = 1;
	dc_rpc_client_get_contact_ids_for (_data_->self, _data_->_tmp1_, _data_->query, dc_rpc_client_get_contact_ids_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp2_ = dc_rpc_client_get_contact_ids_for_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp0_ = _data_->_tmp2_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = _data_->_tmp0_;
	_data_->_tmp0_ = NULL;
	_data_->result = _data_->_tmp3_;
	_json_array_unref0 (_data_->_tmp0_);
	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 void
dc_rpc_client_get_contact_ids_for_data_free (gpointer _data)
{
	DcRpcClientGetContactIdsForData* _data_;
	_data_ = _data;
	_g_free0 (_data_->query);
	_json_array_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetContactIdsForData, _data_);
}

void
dc_rpc_client_get_contact_ids_for (DcRpcClient* self,
                                   gint acct_id,
                                   const gchar* query,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientGetContactIdsForData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetContactIdsForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_contact_ids_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_tmp1_ = g_strdup (query);
	_g_free0 (_data_->query);
	_data_->query = _tmp1_;
	dc_rpc_client_get_contact_ids_for_co (_data_);
}

JsonArray*
dc_rpc_client_get_contact_ids_for_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	JsonArray* result;
	DcRpcClientGetContactIdsForData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_contact_ids_for_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientGetContactIdsForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_contact_ids_for_co (_data_);
}

static gboolean
dc_rpc_client_get_contact_ids_for_co (DcRpcClientGetContactIdsForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, 0);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_add_string (_data_->_tmp5_, _data_->query);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = dc_params_build (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_contact_ids", _data_->_tmp9_, dc_rpc_client_get_contact_ids_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp10_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp11_ = _data_->_tmp10_;
	__vala_JsonNode_free0 (_data_->_tmp9_);
	_g_object_unref0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp11_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp12_ = TRUE;
	} else {
		_data_->_tmp12_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_ARRAY;
	}
	if (_data_->_tmp12_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp13_ = json_node_get_array (_data_->_result_);
	_data_->_tmp14_ = _json_array_ref0 (_data_->_tmp13_);
	_data_->result = _data_->_tmp14_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_create_contact_data_free (gpointer _data)
{
	DcRpcClientCreateContactData* _data_;
	_data_ = _data;
	_g_free0 (_data_->email);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCreateContactData, _data_);
}

void
dc_rpc_client_create_contact (DcRpcClient* self,
                              const gchar* email,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientCreateContactData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (email != NULL);
	_data_ = g_slice_new0 (DcRpcClientCreateContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_create_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (email);
	_g_free0 (_data_->email);
	_data_->email = _tmp1_;
	dc_rpc_client_create_contact_co (_data_);
}

gint
dc_rpc_client_create_contact_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	gint result;
	DcRpcClientCreateContactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_create_contact_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientCreateContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_create_contact_co (_data_);
}

static gboolean
dc_rpc_client_create_contact_co (DcRpcClientCreateContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_string (_data_->_tmp4_, _data_->email);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, NULL);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "create_contact", _data_->_tmp10_, dc_rpc_client_create_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp12_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_lookup_contact_data_free (gpointer _data)
{
	DcRpcClientLookupContactData* _data_;
	_data_ = _data;
	_g_free0 (_data_->email);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientLookupContactData, _data_);
}

void
dc_rpc_client_lookup_contact (DcRpcClient* self,
                              const gchar* email,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	DcRpcClientLookupContactData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (email != NULL);
	_data_ = g_slice_new0 (DcRpcClientLookupContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_lookup_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (email);
	_g_free0 (_data_->email);
	_data_->email = _tmp1_;
	dc_rpc_client_lookup_contact_co (_data_);
}

gint
dc_rpc_client_lookup_contact_finish (DcRpcClient* self,
                                     GAsyncResult* _res_,
                                     GError** error)
{
	gint result;
	DcRpcClientLookupContactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_lookup_contact_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	DcRpcClientLookupContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_lookup_contact_co (_data_);
}

static gboolean
dc_rpc_client_lookup_contact_co (DcRpcClientLookupContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_string (_data_->_tmp4_, _data_->email);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "lookup_contact_id_by_addr", _data_->_tmp8_, dc_rpc_client_lookup_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp11_ = TRUE;
	} else {
		_data_->_tmp11_ = json_node_is_null (_data_->_result_);
	}
	if (_data_->_tmp11_) {
		_data_->result = 0;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_or_create_contact_data_free (gpointer _data)
{
	DcRpcClientGetOrCreateContactData* _data_;
	_data_ = _data;
	_g_free0 (_data_->email);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetOrCreateContactData, _data_);
}

void
dc_rpc_client_get_or_create_contact (DcRpcClient* self,
                                     const gchar* email,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	DcRpcClientGetOrCreateContactData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (email != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetOrCreateContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_or_create_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (email);
	_g_free0 (_data_->email);
	_data_->email = _tmp1_;
	dc_rpc_client_get_or_create_contact_co (_data_);
}

gint
dc_rpc_client_get_or_create_contact_finish (DcRpcClient* self,
                                            GAsyncResult* _res_,
                                            GError** error)
{
	gint result;
	DcRpcClientGetOrCreateContactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_get_or_create_contact_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_)
{
	DcRpcClientGetOrCreateContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_or_create_contact_co (_data_);
}

static gboolean
dc_rpc_client_get_or_create_contact_co (DcRpcClientGetOrCreateContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	dc_rpc_client_lookup_contact (_data_->self, _data_->email, dc_rpc_client_get_or_create_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->contact_id = dc_rpc_client_lookup_contact_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->contact_id == 0) {
		_data_->_state_ = 2;
		dc_rpc_client_create_contact (_data_->self, _data_->email, dc_rpc_client_get_or_create_contact_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp0_ = dc_rpc_client_create_contact_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->contact_id = _data_->_tmp0_;
	}
	_data_->result = _data_->contact_id;
	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 void
dc_rpc_client_get_or_create_chat_by_contact_data_free (gpointer _data)
{
	DcRpcClientGetOrCreateChatByContactData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetOrCreateChatByContactData, _data_);
}

void
dc_rpc_client_get_or_create_chat_by_contact (DcRpcClient* self,
                                             gint contact_id,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_)
{
	DcRpcClientGetOrCreateChatByContactData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetOrCreateChatByContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_or_create_chat_by_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->contact_id = contact_id;
	dc_rpc_client_get_or_create_chat_by_contact_co (_data_);
}

gint
dc_rpc_client_get_or_create_chat_by_contact_finish (DcRpcClient* self,
                                                    GAsyncResult* _res_,
                                                    GError** error)
{
	gint result;
	DcRpcClientGetOrCreateChatByContactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_get_or_create_chat_by_contact_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_)
{
	DcRpcClientGetOrCreateChatByContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_or_create_chat_by_contact_co (_data_);
}

static gboolean
dc_rpc_client_get_or_create_chat_by_contact_co (DcRpcClientGetOrCreateChatByContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->contact_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_chat_id_by_contact_id", _data_->_tmp8_, dc_rpc_client_get_or_create_chat_by_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp13_ = _data_->_result_;
	if (_data_->_tmp13_ != NULL) {
		_data_->_tmp14_ = _data_->_result_;
		_data_->_tmp12_ = !json_node_is_null (_data_->_tmp14_);
	} else {
		_data_->_tmp12_ = FALSE;
	}
	if (_data_->_tmp12_) {
		_data_->_tmp15_ = _data_->_result_;
		_data_->_tmp11_ = json_node_get_int (_data_->_tmp15_) > ((gint64) 0);
	} else {
		_data_->_tmp11_ = FALSE;
	}
	if (_data_->_tmp11_) {
		_data_->_tmp16_ = _data_->_result_;
		_data_->result = (gint) json_node_get_int (_data_->_tmp16_);
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp18_ = dc_params_begin ();
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = _data_->self->priv->_account_id;
	_data_->_tmp21_ = dc_params_add_int (_data_->_tmp19_, _data_->_tmp20_);
	_data_->_tmp22_ = _data_->_tmp21_;
	_data_->_tmp23_ = dc_params_add_int (_data_->_tmp22_, _data_->contact_id);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = dc_params_build (_data_->_tmp24_);
	_data_->_tmp26_ = _data_->_tmp25_;
	_data_->_state_ = 2;
	dc_rpc_client_call (_data_->self, "create_chat_by_contact_id", _data_->_tmp26_, dc_rpc_client_get_or_create_chat_by_contact_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp27_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp28_ = _data_->_tmp27_;
	__vala_JsonNode_free0 (_data_->_tmp26_);
	_g_object_unref0 (_data_->_tmp24_);
	_g_object_unref0 (_data_->_tmp22_);
	_g_object_unref0 (_data_->_tmp19_);
	_data_->_tmp17_ = _data_->_tmp28_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		__vala_JsonNode_free0 (_data_->_result_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp29_ = _data_->_tmp17_;
	_data_->_tmp17_ = NULL;
	__vala_JsonNode_free0 (_data_->_result_);
	_data_->_result_ = _data_->_tmp29_;
	_data_->_tmp30_ = _data_->_result_;
	_data_->result = (gint) json_node_get_int (_data_->_tmp30_);
	__vala_JsonNode_free0 (_data_->_tmp17_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_create_group_data_free (gpointer _data)
{
	DcRpcClientCreateGroupData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientCreateGroupData, _data_);
}

void
dc_rpc_client_create_group (DcRpcClient* self,
                            const gchar* name,
                            gboolean protect,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	DcRpcClientCreateGroupData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_data_ = g_slice_new0 (DcRpcClientCreateGroupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_create_group_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (name);
	_g_free0 (_data_->name);
	_data_->name = _tmp1_;
	_data_->protect = protect;
	dc_rpc_client_create_group_co (_data_);
}

gint
dc_rpc_client_create_group_finish (DcRpcClient* self,
                                   GAsyncResult* _res_,
                                   GError** error)
{
	gint result;
	DcRpcClientCreateGroupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		gint _tmp0_ = 0;
		return _tmp0_;
	}
	result = _data_->result;
	return result;
}

static void
dc_rpc_client_create_group_ready (GObject* source_object,
                                  GAsyncResult* _res_,
                                  gpointer _user_data_)
{
	DcRpcClientCreateGroupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_create_group_co (_data_);
}

static gboolean
dc_rpc_client_create_group_co (DcRpcClientCreateGroupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_string (_data_->_tmp4_, _data_->name);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_bool (_data_->_tmp6_, _data_->protect);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "create_group_chat", _data_->_tmp10_, dc_rpc_client_create_group_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp12_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = (gint) json_node_get_int (_data_->_result_);
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_leave_group_data_free (gpointer _data)
{
	DcRpcClientLeaveGroupData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientLeaveGroupData, _data_);
}

void
dc_rpc_client_leave_group (DcRpcClient* self,
                           gint chat_id,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientLeaveGroupData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientLeaveGroupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_leave_group_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_leave_group_co (_data_);
}

void
dc_rpc_client_leave_group_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	DcRpcClientLeaveGroupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_leave_group_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientLeaveGroupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_leave_group_co (_data_);
}

static gboolean
dc_rpc_client_leave_group_co (DcRpcClientLeaveGroupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "leave_group", _data_->_tmp8_, dc_rpc_client_leave_group_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_delete_chat_data_free (gpointer _data)
{
	DcRpcClientDeleteChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDeleteChatData, _data_);
}

void
dc_rpc_client_delete_chat (DcRpcClient* self,
                           gint chat_id,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientDeleteChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientDeleteChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_delete_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	dc_rpc_client_delete_chat_co (_data_);
}

void
dc_rpc_client_delete_chat_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	DcRpcClientDeleteChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_delete_chat_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientDeleteChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_delete_chat_co (_data_);
}

static gboolean
dc_rpc_client_delete_chat_co (DcRpcClientDeleteChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "delete_chat", _data_->_tmp8_, dc_rpc_client_delete_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_set_chat_visibility_data_free (gpointer _data)
{
	DcRpcClientSetChatVisibilityData* _data_;
	_data_ = _data;
	_g_free0 (_data_->visibility);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetChatVisibilityData, _data_);
}

void
dc_rpc_client_set_chat_visibility (DcRpcClient* self,
                                   gint chat_id,
                                   const gchar* visibility,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientSetChatVisibilityData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (visibility != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetChatVisibilityData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_chat_visibility_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_tmp1_ = g_strdup (visibility);
	_g_free0 (_data_->visibility);
	_data_->visibility = _tmp1_;
	dc_rpc_client_set_chat_visibility_co (_data_);
}

void
dc_rpc_client_set_chat_visibility_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	DcRpcClientSetChatVisibilityData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_chat_visibility_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientSetChatVisibilityData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_chat_visibility_co (_data_);
}

static gboolean
dc_rpc_client_set_chat_visibility_co (DcRpcClientSetChatVisibilityData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->visibility);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_chat_visibility", _data_->_tmp10_, dc_rpc_client_set_chat_visibility_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_delete_messages_data_free (gpointer _data)
{
	DcRpcClientDeleteMessagesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDeleteMessagesData, _data_);
}

void
dc_rpc_client_delete_messages (DcRpcClient* self,
                               gint* msg_ids,
                               gint msg_ids_length1,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientDeleteMessagesData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientDeleteMessagesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_delete_messages_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_delete_messages_co (_data_);
}

void
dc_rpc_client_delete_messages_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	DcRpcClientDeleteMessagesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_delete_messages_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientDeleteMessagesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_delete_messages_co (_data_);
}

static gboolean
dc_rpc_client_delete_messages_co (DcRpcClientDeleteMessagesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int_array (_data_->_tmp4_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "delete_messages", _data_->_tmp8_, dc_rpc_client_delete_messages_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_forward_messages_data_free (gpointer _data)
{
	DcRpcClientForwardMessagesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientForwardMessagesData, _data_);
}

void
dc_rpc_client_forward_messages (DcRpcClient* self,
                                gint* msg_ids,
                                gint msg_ids_length1,
                                gint chat_id,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	DcRpcClientForwardMessagesData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientForwardMessagesData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_forward_messages_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	_data_->chat_id = chat_id;
	dc_rpc_client_forward_messages_co (_data_);
}

void
dc_rpc_client_forward_messages_finish (DcRpcClient* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	DcRpcClientForwardMessagesData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_forward_messages_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	DcRpcClientForwardMessagesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_forward_messages_co (_data_);
}

static gboolean
dc_rpc_client_forward_messages_co (DcRpcClientForwardMessagesData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int_array (_data_->_tmp4_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_int (_data_->_tmp6_, _data_->chat_id);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "forward_messages", _data_->_tmp10_, dc_rpc_client_forward_messages_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_delete_messages_for_all_data_free (gpointer _data)
{
	DcRpcClientDeleteMessagesForAllData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientDeleteMessagesForAllData, _data_);
}

void
dc_rpc_client_delete_messages_for_all (DcRpcClient* self,
                                       gint* msg_ids,
                                       gint msg_ids_length1,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	DcRpcClientDeleteMessagesForAllData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientDeleteMessagesForAllData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_delete_messages_for_all_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->msg_ids = msg_ids;
	_data_->msg_ids_length1 = msg_ids_length1;
	dc_rpc_client_delete_messages_for_all_co (_data_);
}

void
dc_rpc_client_delete_messages_for_all_finish (DcRpcClient* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	DcRpcClientDeleteMessagesForAllData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_delete_messages_for_all_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	DcRpcClientDeleteMessagesForAllData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_delete_messages_for_all_co (_data_);
}

static gboolean
dc_rpc_client_delete_messages_for_all_co (DcRpcClientDeleteMessagesForAllData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int_array (_data_->_tmp4_, _data_->msg_ids, (gint) _data_->msg_ids_length1);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "delete_messages_for_all", _data_->_tmp8_, dc_rpc_client_delete_messages_for_all_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp10_);
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_get_contact_for_data_free (gpointer _data)
{
	DcRpcClientGetContactForData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetContactForData, _data_);
}

void
dc_rpc_client_get_contact_for (DcRpcClient* self,
                               gint acct_id,
                               gint contact_id,
                               GAsyncReadyCallback _callback_,
                               gpointer _user_data_)
{
	DcRpcClientGetContactForData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetContactForData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_contact_for_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->acct_id = acct_id;
	_data_->contact_id = contact_id;
	dc_rpc_client_get_contact_for_co (_data_);
}

JsonObject*
dc_rpc_client_get_contact_for_finish (DcRpcClient* self,
                                      GAsyncResult* _res_,
                                      GError** error)
{
	JsonObject* result;
	DcRpcClientGetContactForData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_contact_for_ready (GObject* source_object,
                                     GAsyncResult* _res_,
                                     gpointer _user_data_)
{
	DcRpcClientGetContactForData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_contact_for_co (_data_);
}

static gboolean
dc_rpc_client_get_contact_for_co (DcRpcClientGetContactForData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = dc_params_add_int (_data_->_tmp1_, _data_->acct_id);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = dc_params_add_int (_data_->_tmp3_, _data_->contact_id);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = dc_params_build (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_contact", _data_->_tmp7_, dc_rpc_client_get_contact_for_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp8_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp8_;
	__vala_JsonNode_free0 (_data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp5_);
	_g_object_unref0 (_data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp9_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->_tmp10_ = TRUE;
	} else {
		_data_->_tmp10_ = json_node_get_node_type (_data_->_result_) != JSON_NODE_OBJECT;
	}
	if (_data_->_tmp10_) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp11_ = json_node_get_object (_data_->_result_);
	_data_->_tmp12_ = _json_object_ref0 (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_get_contact_data_free (gpointer _data)
{
	DcRpcClientGetContactData* _data_;
	_data_ = _data;
	_json_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientGetContactData, _data_);
}

void
dc_rpc_client_get_contact (DcRpcClient* self,
                           gint contact_id,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	DcRpcClientGetContactData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientGetContactData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_get_contact_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->contact_id = contact_id;
	dc_rpc_client_get_contact_co (_data_);
}

JsonObject*
dc_rpc_client_get_contact_finish (DcRpcClient* self,
                                  GAsyncResult* _res_,
                                  GError** error)
{
	JsonObject* result;
	DcRpcClientGetContactData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
dc_rpc_client_get_contact_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	DcRpcClientGetContactData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_get_contact_co (_data_);
}

static gboolean
dc_rpc_client_get_contact_co (DcRpcClientGetContactData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->contact_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_build (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "get_contact", _data_->_tmp8_, dc_rpc_client_get_contact_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp9_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp10_ = _data_->_tmp9_;
	__vala_JsonNode_free0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	_data_->_result_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_result_ == NULL) {
		_data_->result = NULL;
		__vala_JsonNode_free0 (_data_->_result_);
		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;
	}
	_data_->_tmp11_ = json_node_get_object (_data_->_result_);
	_data_->_tmp12_ = _json_object_ref0 (_data_->_tmp11_);
	_data_->result = _data_->_tmp12_;
	__vala_JsonNode_free0 (_data_->_result_);
	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 void
dc_rpc_client_add_contact_to_chat_data_free (gpointer _data)
{
	DcRpcClientAddContactToChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientAddContactToChatData, _data_);
}

void
dc_rpc_client_add_contact_to_chat (DcRpcClient* self,
                                   gint chat_id,
                                   gint contact_id,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_)
{
	DcRpcClientAddContactToChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientAddContactToChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_add_contact_to_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->contact_id = contact_id;
	dc_rpc_client_add_contact_to_chat_co (_data_);
}

void
dc_rpc_client_add_contact_to_chat_finish (DcRpcClient* self,
                                          GAsyncResult* _res_,
                                          GError** error)
{
	DcRpcClientAddContactToChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_add_contact_to_chat_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_)
{
	DcRpcClientAddContactToChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_add_contact_to_chat_co (_data_);
}

static gboolean
dc_rpc_client_add_contact_to_chat_co (DcRpcClientAddContactToChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_int (_data_->_tmp6_, _data_->contact_id);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "add_contact_to_chat", _data_->_tmp10_, dc_rpc_client_add_contact_to_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_remove_contact_from_chat_data_free (gpointer _data)
{
	DcRpcClientRemoveContactFromChatData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientRemoveContactFromChatData, _data_);
}

void
dc_rpc_client_remove_contact_from_chat (DcRpcClient* self,
                                        gint chat_id,
                                        gint contact_id,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcRpcClientRemoveContactFromChatData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientRemoveContactFromChatData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_remove_contact_from_chat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->contact_id = contact_id;
	dc_rpc_client_remove_contact_from_chat_co (_data_);
}

void
dc_rpc_client_remove_contact_from_chat_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	DcRpcClientRemoveContactFromChatData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_remove_contact_from_chat_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcRpcClientRemoveContactFromChatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_remove_contact_from_chat_co (_data_);
}

static gboolean
dc_rpc_client_remove_contact_from_chat_co (DcRpcClientRemoveContactFromChatData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_int (_data_->_tmp6_, _data_->contact_id);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "remove_contact_from_chat", _data_->_tmp10_, dc_rpc_client_remove_contact_from_chat_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_set_chat_profile_image_data_free (gpointer _data)
{
	DcRpcClientSetChatProfileImageData* _data_;
	_data_ = _data;
	_g_free0 (_data_->image_path);
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetChatProfileImageData, _data_);
}

void
dc_rpc_client_set_chat_profile_image (DcRpcClient* self,
                                      gint chat_id,
                                      const gchar* image_path,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	DcRpcClientSetChatProfileImageData* _data_;
	DcRpcClient* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (image_path != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetChatProfileImageData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_chat_profile_image_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_tmp1_ = g_strdup (image_path);
	_g_free0 (_data_->image_path);
	_data_->image_path = _tmp1_;
	dc_rpc_client_set_chat_profile_image_co (_data_);
}

void
dc_rpc_client_set_chat_profile_image_finish (DcRpcClient* self,
                                             GAsyncResult* _res_,
                                             GError** error)
{
	DcRpcClientSetChatProfileImageData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_chat_profile_image_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_)
{
	DcRpcClientSetChatProfileImageData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_chat_profile_image_co (_data_);
}

static gboolean
dc_rpc_client_set_chat_profile_image_co (DcRpcClientSetChatProfileImageData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_string (_data_->_tmp6_, _data_->image_path);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_chat_profile_image", _data_->_tmp10_, dc_rpc_client_set_chat_profile_image_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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 void
dc_rpc_client_set_chat_ephemeral_timer_data_free (gpointer _data)
{
	DcRpcClientSetChatEphemeralTimerData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (DcRpcClientSetChatEphemeralTimerData, _data_);
}

void
dc_rpc_client_set_chat_ephemeral_timer (DcRpcClient* self,
                                        gint chat_id,
                                        gint timer,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	DcRpcClientSetChatEphemeralTimerData* _data_;
	DcRpcClient* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (DcRpcClientSetChatEphemeralTimerData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, dc_rpc_client_set_chat_ephemeral_timer_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->chat_id = chat_id;
	_data_->timer = timer;
	dc_rpc_client_set_chat_ephemeral_timer_co (_data_);
}

void
dc_rpc_client_set_chat_ephemeral_timer_finish (DcRpcClient* self,
                                               GAsyncResult* _res_,
                                               GError** error)
{
	DcRpcClientSetChatEphemeralTimerData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
dc_rpc_client_set_chat_ephemeral_timer_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	DcRpcClientSetChatEphemeralTimerData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	dc_rpc_client_set_chat_ephemeral_timer_co (_data_);
}

static gboolean
dc_rpc_client_set_chat_ephemeral_timer_co (DcRpcClientSetChatEphemeralTimerData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = dc_params_begin ();
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = _data_->self->priv->_account_id;
	_data_->_tmp3_ = dc_params_add_int (_data_->_tmp1_, _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = dc_params_add_int (_data_->_tmp4_, _data_->chat_id);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = dc_params_add_int (_data_->_tmp6_, _data_->timer);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = dc_params_build (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_state_ = 1;
	dc_rpc_client_call (_data_->self, "set_chat_ephemeral_timer", _data_->_tmp10_, dc_rpc_client_set_chat_ephemeral_timer_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp11_ = dc_rpc_client_call_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp12_ = _data_->_tmp11_;
	__vala_JsonNode_free0 (_data_->_tmp12_);
	__vala_JsonNode_free0 (_data_->_tmp10_);
	_g_object_unref0 (_data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp6_);
	_g_object_unref0 (_data_->_tmp4_);
	_g_object_unref0 (_data_->_tmp1_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	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;
}

/**
         * Parse a JSON contact object into a Dc.Contact model.
         */
DcContact*
dc_rpc_client_parse_contact (gint contact_id,
                             JsonObject* obj)
{
	DcContact* c = NULL;
	DcContact* _tmp0_;
	DcContact* _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_;
	DcContact* _tmp5_;
	gchar* _tmp6_ = NULL;
	gchar* _tmp7_;
	DcContact* _tmp9_;
	DcContact* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	DcContact* _tmp13_;
	DcContact* result;
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = dc_contact_new ();
	c = _tmp0_;
	_tmp1_ = c;
	dc_contact_set_id (_tmp1_, contact_id);
	_tmp3_ = dc_json_str (obj, "displayName");
	_tmp2_ = _tmp3_;
	if (_tmp2_ == NULL) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup ("");
		_g_free0 (_tmp2_);
		_tmp2_ = _tmp4_;
	}
	_tmp5_ = c;
	dc_contact_set_display_name (_tmp5_, _tmp2_);
	_tmp7_ = dc_json_str (obj, "address");
	_tmp6_ = _tmp7_;
	if (_tmp6_ == NULL) {
		gchar* _tmp8_;
		_tmp8_ = g_strdup ("");
		_g_free0 (_tmp6_);
		_tmp6_ = _tmp8_;
	}
	_tmp9_ = c;
	dc_contact_set_address (_tmp9_, _tmp6_);
	_tmp10_ = c;
	_tmp11_ = dc_json_str (obj, "profileImage");
	_tmp12_ = _tmp11_;
	dc_contact_set_profile_image (_tmp10_, _tmp12_);
	_g_free0 (_tmp12_);
	_tmp13_ = c;
	dc_contact_set_is_verified (_tmp13_, dc_json_bool (obj, "isVerified"));
	result = c;
	_g_free0 (_tmp6_);
	_g_free0 (_tmp2_);
	return result;
}

/**
         * Parse a JSON message object into a Dc.Message model.
         */
static void
_vala_array_add1 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add2 (gint* * array,
                  gint* length,
                  gint* size,
                  gint value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gint, *array, *size);
	}
	(*array)[(*length)++] = value;
}

DcMessage*
dc_rpc_client_parse_message (JsonObject* obj,
                             const gchar* self_email)
{
	DcMessage* msg = NULL;
	DcMessage* _tmp0_;
	DcMessage* _tmp1_;
	DcMessage* _tmp2_;
	DcMessage* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	DcMessage* _tmp6_;
	DcMessage* _tmp7_;
	DcMessage* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	DcMessage* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	DcMessage* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	DcMessage* _tmp17_;
	DcMessage* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	DcMessage* _tmp21_;
	gboolean _tmp22_ = FALSE;
	gboolean _tmp36_ = FALSE;
	gboolean _tmp48_ = FALSE;
	gboolean _tmp50_ = FALSE;
	gboolean _tmp108_ = FALSE;
	DcMessage* result;
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = dc_message_new ();
	msg = _tmp0_;
	_tmp1_ = msg;
	dc_message_set_id (_tmp1_, (gint) dc_json_int (obj, "id", (gint64) 0));
	_tmp2_ = msg;
	dc_message_set_chat_id (_tmp2_, (gint) dc_json_int (obj, "chatId", (gint64) 0));
	_tmp3_ = msg;
	_tmp4_ = dc_json_str (obj, "text");
	_tmp5_ = _tmp4_;
	dc_message_set_text (_tmp3_, _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = msg;
	dc_message_set_timestamp (_tmp6_, dc_json_int (obj, "timestamp", (gint64) 0));
	_tmp7_ = msg;
	dc_message_set_is_info (_tmp7_, dc_json_bool (obj, "isInfo"));
	_tmp8_ = msg;
	_tmp9_ = dc_json_str (obj, "file");
	_tmp10_ = _tmp9_;
	dc_message_set_file_path (_tmp8_, _tmp10_);
	_g_free0 (_tmp10_);
	_tmp11_ = msg;
	_tmp12_ = dc_json_str (obj, "fileName");
	_tmp13_ = _tmp12_;
	dc_message_set_file_name (_tmp11_, _tmp13_);
	_g_free0 (_tmp13_);
	_tmp14_ = msg;
	_tmp15_ = dc_json_str (obj, "fileMime");
	_tmp16_ = _tmp15_;
	dc_message_set_file_mime (_tmp14_, _tmp16_);
	_g_free0 (_tmp16_);
	_tmp17_ = msg;
	dc_message_set_file_bytes (_tmp17_, (gint) dc_json_int (obj, "fileBytes", (gint64) 0));
	_tmp18_ = msg;
	_tmp19_ = dc_json_str (obj, "viewType");
	_tmp20_ = _tmp19_;
	dc_message_set_view_type (_tmp18_, _tmp20_);
	_g_free0 (_tmp20_);
	_tmp21_ = msg;
	dc_message_set_state (_tmp21_, (gint) dc_json_int (obj, "state", (gint64) 0));
	if (json_object_has_member (obj, "sender")) {
		JsonNode* _tmp23_;
		_tmp23_ = json_object_get_member (obj, "sender");
		_tmp22_ = !json_node_is_null (_tmp23_);
	} else {
		_tmp22_ = FALSE;
	}
	if (_tmp22_) {
		JsonObject* sender = NULL;
		JsonObject* _tmp24_;
		JsonObject* _tmp25_;
		DcMessage* _tmp26_;
		JsonObject* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_ = NULL;
		JsonObject* _tmp31_;
		gchar* _tmp32_;
		DcMessage* _tmp35_;
		_tmp24_ = json_object_get_object_member (obj, "sender");
		_tmp25_ = _json_object_ref0 (_tmp24_);
		sender = _tmp25_;
		_tmp26_ = msg;
		_tmp27_ = sender;
		_tmp28_ = dc_json_str (_tmp27_, "address");
		_tmp29_ = _tmp28_;
		dc_message_set_sender_address (_tmp26_, _tmp29_);
		_g_free0 (_tmp29_);
		_tmp31_ = sender;
		_tmp32_ = dc_json_str (_tmp31_, "displayName");
		_tmp30_ = _tmp32_;
		if (_tmp30_ == NULL) {
			JsonObject* _tmp33_;
			gchar* _tmp34_;
			_tmp33_ = sender;
			_tmp34_ = dc_json_str (_tmp33_, "name");
			_g_free0 (_tmp30_);
			_tmp30_ = _tmp34_;
		}
		_tmp35_ = msg;
		dc_message_set_sender_name (_tmp35_, _tmp30_);
		_g_free0 (_tmp30_);
		_json_object_unref0 (sender);
	}
	if (self_email != NULL) {
		DcMessage* _tmp37_;
		const gchar* _tmp38_;
		const gchar* _tmp39_;
		_tmp37_ = msg;
		_tmp38_ = dc_message_get_sender_address (_tmp37_);
		_tmp39_ = _tmp38_;
		_tmp36_ = _tmp39_ != NULL;
	} else {
		_tmp36_ = FALSE;
	}
	if (_tmp36_) {
		DcMessage* _tmp40_;
		DcMessage* _tmp41_;
		const gchar* _tmp42_;
		const gchar* _tmp43_;
		gchar* _tmp44_;
		gchar* _tmp45_;
		gchar* _tmp46_;
		gchar* _tmp47_;
		_tmp40_ = msg;
		_tmp41_ = msg;
		_tmp42_ = dc_message_get_sender_address (_tmp41_);
		_tmp43_ = _tmp42_;
		_tmp44_ = g_utf8_strdown (_tmp43_, (gssize) -1);
		_tmp45_ = _tmp44_;
		_tmp46_ = g_utf8_strdown (self_email, (gssize) -1);
		_tmp47_ = _tmp46_;
		dc_message_set_is_outgoing (_tmp40_, g_strcmp0 (_tmp45_, _tmp47_) == 0);
		_g_free0 (_tmp47_);
		_g_free0 (_tmp45_);
	}
	if (json_object_has_member (obj, "fromId")) {
		_tmp48_ = json_object_get_int_member (obj, "fromId") == ((gint64) 1);
	} else {
		_tmp48_ = FALSE;
	}
	if (_tmp48_) {
		DcMessage* _tmp49_;
		_tmp49_ = msg;
		dc_message_set_is_outgoing (_tmp49_, TRUE);
	}
	if (json_object_has_member (obj, "reactions")) {
		JsonNode* _tmp51_;
		_tmp51_ = json_object_get_member (obj, "reactions");
		_tmp50_ = !json_node_is_null (_tmp51_);
	} else {
		_tmp50_ = FALSE;
	}
	if (_tmp50_) {
		JsonObject* reactions_obj = NULL;
		JsonObject* _tmp52_;
		JsonObject* _tmp53_;
		gboolean _tmp54_ = FALSE;
		gboolean _tmp55_ = FALSE;
		JsonObject* _tmp56_;
		_tmp52_ = json_object_get_object_member (obj, "reactions");
		_tmp53_ = _json_object_ref0 (_tmp52_);
		reactions_obj = _tmp53_;
		_tmp56_ = reactions_obj;
		if (_tmp56_ != NULL) {
			JsonObject* _tmp57_;
			_tmp57_ = reactions_obj;
			_tmp55_ = json_object_has_member (_tmp57_, "reactionsByContact");
		} else {
			_tmp55_ = FALSE;
		}
		if (_tmp55_) {
			JsonObject* _tmp58_;
			JsonNode* _tmp59_;
			_tmp58_ = reactions_obj;
			_tmp59_ = json_object_get_member (_tmp58_, "reactionsByContact");
			_tmp54_ = !json_node_is_null (_tmp59_);
		} else {
			_tmp54_ = FALSE;
		}
		if (_tmp54_) {
			JsonObject* by_contact = NULL;
			JsonObject* _tmp60_;
			JsonObject* _tmp61_;
			JsonObject* _tmp62_;
			gchar** r_emojis = NULL;
			gchar** _tmp63_;
			gint r_emojis_length1;
			gint _r_emojis_size_;
			gint* r_counts = NULL;
			gint* _tmp64_;
			gint r_counts_length1;
			gint _r_counts_size_;
			GList* members = NULL;
			JsonObject* _tmp65_;
			GList* _tmp66_;
			GList* _tmp67_;
			gchar** _tmp93_;
			gint _tmp93__length1;
			_tmp60_ = reactions_obj;
			_tmp61_ = json_object_get_object_member (_tmp60_, "reactionsByContact");
			_tmp62_ = _json_object_ref0 (_tmp61_);
			by_contact = _tmp62_;
			_tmp63_ = g_new0 (gchar*, 0 + 1);
			r_emojis = _tmp63_;
			r_emojis_length1 = 0;
			_r_emojis_size_ = r_emojis_length1;
			_tmp64_ = g_new0 (gint, 0);
			r_counts = _tmp64_;
			r_counts_length1 = 0;
			_r_counts_size_ = r_counts_length1;
			_tmp65_ = by_contact;
			_tmp66_ = json_object_get_members (_tmp65_);
			members = _tmp66_;
			_tmp67_ = members;
			{
				GList* cid_collection = NULL;
				GList* cid_it = NULL;
				cid_collection = _tmp67_;
				for (cid_it = cid_collection; cid_it != NULL; cid_it = cid_it->next) {
					const gchar* cid = NULL;
					cid = (const gchar*) cid_it->data;
					{
						JsonNode* node = NULL;
						JsonObject* _tmp68_;
						const gchar* _tmp69_;
						JsonNode* _tmp70_;
						JsonNode* _tmp71_;
						JsonNode* _tmp72_;
						JsonArray* arr = NULL;
						JsonNode* _tmp73_;
						JsonArray* _tmp74_;
						JsonArray* _tmp75_;
						_tmp68_ = by_contact;
						_tmp69_ = cid;
						_tmp70_ = json_object_get_member (_tmp68_, _tmp69_);
						_tmp71_ = __vala_JsonNode_copy0 (_tmp70_);
						node = _tmp71_;
						_tmp72_ = node;
						if (json_node_get_node_type (_tmp72_) != JSON_NODE_ARRAY) {
							__vala_JsonNode_free0 (node);
							continue;
						}
						_tmp73_ = node;
						_tmp74_ = json_node_get_array (_tmp73_);
						_tmp75_ = _json_array_ref0 (_tmp74_);
						arr = _tmp75_;
						{
							guint j = 0U;
							j = (guint) 0;
							{
								gboolean _tmp76_ = FALSE;
								_tmp76_ = TRUE;
								while (TRUE) {
									JsonArray* _tmp78_;
									gchar* emoji = NULL;
									JsonArray* _tmp79_;
									const gchar* _tmp80_;
									gchar* _tmp81_;
									gint found = 0;
									if (!_tmp76_) {
										guint _tmp77_;
										_tmp77_ = j;
										j = _tmp77_ + 1;
									}
									_tmp76_ = FALSE;
									_tmp78_ = arr;
									if (!(j < json_array_get_length (_tmp78_))) {
										break;
									}
									_tmp79_ = arr;
									_tmp80_ = json_array_get_string_element (_tmp79_, j);
									_tmp81_ = g_strdup (_tmp80_);
									emoji = _tmp81_;
									found = -1;
									{
										gint k = 0;
										k = 0;
										{
											gboolean _tmp82_ = FALSE;
											_tmp82_ = TRUE;
											while (TRUE) {
												gchar** _tmp84_;
												gint _tmp84__length1;
												gchar** _tmp85_;
												gint _tmp85__length1;
												const gchar* _tmp86_;
												const gchar* _tmp87_;
												if (!_tmp82_) {
													gint _tmp83_;
													_tmp83_ = k;
													k = _tmp83_ + 1;
												}
												_tmp82_ = FALSE;
												_tmp84_ = r_emojis;
												_tmp84__length1 = r_emojis_length1;
												if (!(k < _tmp84__length1)) {
													break;
												}
												_tmp85_ = r_emojis;
												_tmp85__length1 = r_emojis_length1;
												_tmp86_ = _tmp85_[k];
												_tmp87_ = emoji;
												if (g_strcmp0 (_tmp86_, _tmp87_) == 0) {
													found = k;
													break;
												}
											}
										}
									}
									if (found >= 0) {
										gint* _tmp88_;
										gint _tmp88__length1;
										gint* _tmp89_;
										gint _tmp89__length1;
										gint _tmp90_;
										_tmp88_ = r_counts;
										_tmp88__length1 = r_counts_length1;
										_tmp89_ = r_counts;
										_tmp89__length1 = r_counts_length1;
										_tmp90_ = _tmp89_[found];
										_tmp88_[found] = _tmp90_ + 1;
									} else {
										const gchar* _tmp91_;
										gchar* _tmp92_;
										_tmp91_ = emoji;
										_tmp92_ = g_strdup (_tmp91_);
										_vala_array_add1 (&r_emojis, &r_emojis_length1, &_r_emojis_size_, _tmp92_);
										_vala_array_add2 (&r_counts, &r_counts_length1, &_r_counts_size_, 1);
									}
									_g_free0 (emoji);
								}
							}
						}
						_json_array_unref0 (arr);
						__vala_JsonNode_free0 (node);
					}
				}
			}
			_tmp93_ = r_emojis;
			_tmp93__length1 = r_emojis_length1;
			if (_tmp93__length1 > 0) {
				GString* sb = NULL;
				GString* _tmp94_;
				DcMessage* _tmp105_;
				GString* _tmp106_;
				const gchar* _tmp107_;
				_tmp94_ = g_string_new ("");
				sb = _tmp94_;
				{
					gint k = 0;
					k = 0;
					{
						gboolean _tmp95_ = FALSE;
						_tmp95_ = TRUE;
						while (TRUE) {
							gchar** _tmp97_;
							gint _tmp97__length1;
							GString* _tmp98_;
							GString* _tmp100_;
							gchar** _tmp101_;
							gint _tmp101__length1;
							const gchar* _tmp102_;
							gint* _tmp103_;
							gint _tmp103__length1;
							gint _tmp104_;
							if (!_tmp95_) {
								gint _tmp96_;
								_tmp96_ = k;
								k = _tmp96_ + 1;
							}
							_tmp95_ = FALSE;
							_tmp97_ = r_emojis;
							_tmp97__length1 = r_emojis_length1;
							if (!(k < _tmp97__length1)) {
								break;
							}
							_tmp98_ = sb;
							if (_tmp98_->len > ((gssize) 0)) {
								GString* _tmp99_;
								_tmp99_ = sb;
								g_string_append (_tmp99_, ",");
							}
							_tmp100_ = sb;
							_tmp101_ = r_emojis;
							_tmp101__length1 = r_emojis_length1;
							_tmp102_ = _tmp101_[k];
							_tmp103_ = r_counts;
							_tmp103__length1 = r_counts_length1;
							_tmp104_ = _tmp103_[k];
							g_string_append_printf (_tmp100_, "%s:%d", _tmp102_, _tmp104_);
						}
					}
				}
				_tmp105_ = msg;
				_tmp106_ = sb;
				_tmp107_ = _tmp106_->str;
				dc_message_set_reactions (_tmp105_, _tmp107_);
				_g_string_free0 (sb);
			}
			(members == NULL) ? NULL : (members = (g_list_free (members), NULL));
			r_counts = (g_free (r_counts), NULL);
			r_emojis = (_vala_array_free (r_emojis, r_emojis_length1, (GDestroyNotify) g_free), NULL);
			_json_object_unref0 (by_contact);
		}
		_json_object_unref0 (reactions_obj);
	}
	if (json_object_has_member (obj, "quote")) {
		JsonNode* _tmp109_;
		_tmp109_ = json_object_get_member (obj, "quote");
		_tmp108_ = !json_node_is_null (_tmp109_);
	} else {
		_tmp108_ = FALSE;
	}
	if (_tmp108_) {
		JsonObject* quote = NULL;
		JsonObject* _tmp110_;
		JsonObject* _tmp111_;
		DcMessage* _tmp112_;
		JsonObject* _tmp113_;
		gchar* _tmp114_;
		gchar* _tmp115_;
		DcMessage* _tmp116_;
		JsonObject* _tmp117_;
		gchar* _tmp118_;
		gchar* _tmp119_;
		DcMessage* _tmp120_;
		JsonObject* _tmp121_;
		_tmp110_ = json_object_get_object_member (obj, "quote");
		_tmp111_ = _json_object_ref0 (_tmp110_);
		quote = _tmp111_;
		_tmp112_ = msg;
		_tmp113_ = quote;
		_tmp114_ = dc_json_str (_tmp113_, "text");
		_tmp115_ = _tmp114_;
		dc_message_set_quote_text (_tmp112_, _tmp115_);
		_g_free0 (_tmp115_);
		_tmp116_ = msg;
		_tmp117_ = quote;
		_tmp118_ = dc_json_str (_tmp117_, "authorDisplayName");
		_tmp119_ = _tmp118_;
		dc_message_set_quote_sender_name (_tmp116_, _tmp119_);
		_g_free0 (_tmp119_);
		_tmp120_ = msg;
		_tmp121_ = quote;
		dc_message_set_quote_msg_id (_tmp120_, (gint) dc_json_int (_tmp121_, "messageId", (gint64) 0));
		_json_object_unref0 (quote);
	}
	result = msg;
	return result;
}

/**
         * Parse a chatlist item JSON object into a Dc.ChatEntry model.
         */
DcChatEntry*
dc_rpc_client_parse_chat_item (gint chat_id,
                               JsonObject* obj)
{
	DcChatEntry* entry = NULL;
	DcChatEntry* _tmp0_;
	DcChatEntry* _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_;
	DcChatEntry* _tmp5_;
	gchar* s1 = NULL;
	gchar* _tmp6_;
	gboolean _tmp7_ = FALSE;
	const gchar* _tmp8_;
	gchar* s2 = NULL;
	gchar* _tmp14_;
	gboolean _tmp15_ = FALSE;
	const gchar* _tmp16_;
	DcChatEntry* _tmp22_;
	const gchar* _tmp23_;
	const gchar* _tmp24_;
	DcChatEntry* _tmp28_;
	DcChatEntry* _tmp29_;
	DcChatEntry* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	DcChatEntry* _tmp33_;
	DcChatEntry* _tmp34_;
	DcChatEntry* _tmp35_;
	DcChatEntry* _tmp36_;
	DcChatEntry* result;
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = dc_chat_entry_new ();
	entry = _tmp0_;
	_tmp1_ = entry;
	dc_chat_entry_set_id (_tmp1_, chat_id);
	_tmp3_ = dc_json_str (obj, "name");
	_tmp2_ = _tmp3_;
	if (_tmp2_ == NULL) {
		gchar* _tmp4_;
		_tmp4_ = g_strdup ("");
		_g_free0 (_tmp2_);
		_tmp2_ = _tmp4_;
	}
	_tmp5_ = entry;
	dc_chat_entry_set_name (_tmp5_, _tmp2_);
	_tmp6_ = dc_json_str (obj, "summaryText1");
	s1 = _tmp6_;
	_tmp8_ = s1;
	if (_tmp8_ != NULL) {
		const gchar* _tmp9_;
		gint _tmp10_;
		gint _tmp11_;
		_tmp9_ = s1;
		_tmp10_ = strlen (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp7_ = _tmp11_ > 0;
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		DcChatEntry* _tmp12_;
		const gchar* _tmp13_;
		_tmp12_ = entry;
		_tmp13_ = s1;
		dc_chat_entry_set_summary_prefix (_tmp12_, _tmp13_);
	}
	_tmp14_ = dc_json_str (obj, "summaryText2");
	s2 = _tmp14_;
	_tmp16_ = s2;
	if (_tmp16_ != NULL) {
		const gchar* _tmp17_;
		gint _tmp18_;
		gint _tmp19_;
		_tmp17_ = s2;
		_tmp18_ = strlen (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp15_ = _tmp19_ > 0;
	} else {
		_tmp15_ = FALSE;
	}
	if (_tmp15_) {
		DcChatEntry* _tmp20_;
		const gchar* _tmp21_;
		_tmp20_ = entry;
		_tmp21_ = s2;
		dc_chat_entry_set_last_message (_tmp20_, _tmp21_);
	}
	_tmp22_ = entry;
	_tmp23_ = dc_chat_entry_get_last_message (_tmp22_);
	_tmp24_ = _tmp23_;
	if (_tmp24_ == NULL) {
		DcChatEntry* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		_tmp25_ = entry;
		_tmp26_ = dc_json_str (obj, "lastMessageText");
		_tmp27_ = _tmp26_;
		dc_chat_entry_set_last_message (_tmp25_, _tmp27_);
		_g_free0 (_tmp27_);
	}
	_tmp28_ = entry;
	dc_chat_entry_set_unread_count (_tmp28_, (gint) dc_json_int (obj, "freshMessageCounter", (gint64) 0));
	_tmp29_ = entry;
	dc_chat_entry_set_timestamp (_tmp29_, dc_json_int (obj, "lastMessageTimestamp", (gint64) 0));
	_tmp30_ = entry;
	_tmp31_ = dc_json_str (obj, "avatarPath");
	_tmp32_ = _tmp31_;
	dc_chat_entry_set_avatar_path (_tmp30_, _tmp32_);
	_g_free0 (_tmp32_);
	_tmp33_ = entry;
	dc_chat_entry_set_is_muted (_tmp33_, dc_json_bool (obj, "isMuted"));
	_tmp34_ = entry;
	dc_chat_entry_set_is_contact_request (_tmp34_, dc_json_bool (obj, "isContactRequest"));
	_tmp35_ = entry;
	dc_chat_entry_set_is_archived (_tmp35_, dc_json_bool (obj, "isArchived"));
	_tmp36_ = entry;
	dc_chat_entry_set_is_pinned (_tmp36_, dc_json_bool (obj, "isPinned"));
	result = entry;
	_g_free0 (s2);
	_g_free0 (s1);
	_g_free0 (_tmp2_);
	return result;
}

DcRpcClient*
dc_rpc_client_construct (GType object_type)
{
	DcRpcClient * self = NULL;
	self = (DcRpcClient*) g_object_new (object_type, NULL);
	return self;
}

DcRpcClient*
dc_rpc_client_new (void)
{
	return dc_rpc_client_construct (DC_TYPE_RPC_CLIENT);
}

gboolean
dc_rpc_client_get_is_connected (DcRpcClient* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_connected;
	return result;
}

static void
dc_rpc_client_set_is_connected (DcRpcClient* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_rpc_client_get_is_connected (self);
	if (old_value != value) {
		self->priv->_is_connected = value;
		g_object_notify_by_pspec ((GObject *) self, dc_rpc_client_properties[DC_RPC_CLIENT_IS_CONNECTED_PROPERTY]);
	}
}

gint
dc_rpc_client_get_account_id (DcRpcClient* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_account_id;
	return result;
}

void
dc_rpc_client_set_account_id (DcRpcClient* self,
                              gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_rpc_client_get_account_id (self);
	if (old_value != value) {
		self->priv->_account_id = value;
		g_object_notify_by_pspec ((GObject *) self, dc_rpc_client_properties[DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY]);
	}
}

const gchar*
dc_rpc_client_get_self_email (DcRpcClient* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_self_email;
	result = _tmp0_;
	return result;
}

void
dc_rpc_client_set_self_email (DcRpcClient* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = dc_rpc_client_get_self_email (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_self_email);
		self->priv->_self_email = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, dc_rpc_client_properties[DC_RPC_CLIENT_SELF_EMAIL_PROPERTY]);
	}
}

static void
dc_rpc_client_class_init (DcRpcClientClass * klass,
                          gpointer klass_data)
{
	dc_rpc_client_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcRpcClient_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_dc_rpc_client_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_dc_rpc_client_set_property;
	G_OBJECT_CLASS (klass)->finalize = dc_rpc_client_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_RPC_CLIENT_IS_CONNECTED_PROPERTY, dc_rpc_client_properties[DC_RPC_CLIENT_IS_CONNECTED_PROPERTY] = g_param_spec_boolean ("is-connected", "is-connected", "is-connected", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY, dc_rpc_client_properties[DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY] = g_param_spec_int ("account-id", "account-id", "account-id", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), DC_RPC_CLIENT_SELF_EMAIL_PROPERTY, dc_rpc_client_properties[DC_RPC_CLIENT_SELF_EMAIL_PROPERTY] = g_param_spec_string ("self-email", "self-email", "self-email", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	dc_rpc_client_signals[DC_RPC_CLIENT_DISCONNECTED_SIGNAL] = g_signal_new ("disconnected", DC_TYPE_RPC_CLIENT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
dc_rpc_client_instance_init (DcRpcClient * self,
                             gpointer klass)
{
	GPtrArray* _tmp0_;
	gchar* _tmp1_;
	self->priv = dc_rpc_client_get_instance_private (self);
	self->priv->process = NULL;
	self->priv->reader = NULL;
	self->priv->writer = NULL;
	self->priv->next_id = 1;
	_tmp0_ = g_ptr_array_new_full ((guint) 0, _dc_pending_call_unref0_);
	self->priv->pending = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->last_stderr = _tmp1_;
	self->priv->_is_connected = FALSE;
	self->priv->_account_id = 0;
	self->priv->_self_email = NULL;
}

static void
dc_rpc_client_finalize (GObject * obj)
{
	DcRpcClient * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_RPC_CLIENT, DcRpcClient);
	_g_object_unref0 (self->priv->process);
	_g_object_unref0 (self->priv->reader);
	_g_object_unref0 (self->priv->writer);
	_g_ptr_array_unref0 (self->priv->pending);
	_g_free0 (self->priv->last_stderr);
	_g_free0 (self->priv->_self_email);
	G_OBJECT_CLASS (dc_rpc_client_parent_class)->finalize (obj);
}

/**
     * JSONRPC client that communicates with deltachat-rpc-server over stdio.
     * Each request is a JSON object terminated by newline.
     */
static GType
dc_rpc_client_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcRpcClientClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_rpc_client_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcRpcClient), 0, (GInstanceInitFunc) dc_rpc_client_instance_init, NULL };
	GType dc_rpc_client_type_id;
	dc_rpc_client_type_id = g_type_register_static (G_TYPE_OBJECT, "DcRpcClient", &g_define_type_info, 0);
	DcRpcClient_private_offset = g_type_add_instance_private (dc_rpc_client_type_id, sizeof (DcRpcClientPrivate));
	return dc_rpc_client_type_id;
}

GType
dc_rpc_client_get_type (void)
{
	static volatile gsize dc_rpc_client_type_id__once = 0;
	if (g_once_init_enter (&dc_rpc_client_type_id__once)) {
		GType dc_rpc_client_type_id;
		dc_rpc_client_type_id = dc_rpc_client_get_type_once ();
		g_once_init_leave (&dc_rpc_client_type_id__once, dc_rpc_client_type_id);
	}
	return dc_rpc_client_type_id__once;
}

static void
_vala_dc_rpc_client_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec)
{
	DcRpcClient * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_RPC_CLIENT, DcRpcClient);
	switch (property_id) {
		case DC_RPC_CLIENT_IS_CONNECTED_PROPERTY:
		g_value_set_boolean (value, dc_rpc_client_get_is_connected (self));
		break;
		case DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY:
		g_value_set_int (value, dc_rpc_client_get_account_id (self));
		break;
		case DC_RPC_CLIENT_SELF_EMAIL_PROPERTY:
		g_value_set_string (value, dc_rpc_client_get_self_email (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_dc_rpc_client_set_property (GObject * object,
                                  guint property_id,
                                  const GValue * value,
                                  GParamSpec * pspec)
{
	DcRpcClient * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, DC_TYPE_RPC_CLIENT, DcRpcClient);
	switch (property_id) {
		case DC_RPC_CLIENT_IS_CONNECTED_PROPERTY:
		dc_rpc_client_set_is_connected (self, g_value_get_boolean (value));
		break;
		case DC_RPC_CLIENT_ACCOUNT_ID_PROPERTY:
		dc_rpc_client_set_account_id (self, g_value_get_int (value));
		break;
		case DC_RPC_CLIENT_SELF_EMAIL_PROPERTY:
		dc_rpc_client_set_self_email (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

DcPendingCall*
dc_pending_call_construct (GType object_type,
                           gint id)
{
	DcPendingCall* self = NULL;
	self = (DcPendingCall*) g_type_create_instance (object_type);
	self->id = id;
	return self;
}

DcPendingCall*
dc_pending_call_new (gint id)
{
	return dc_pending_call_construct (DC_TYPE_PENDING_CALL, id);
}

static void
dc_value_pending_call_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
dc_value_pending_call_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		dc_pending_call_unref (value->data[0].v_pointer);
	}
}

static void
dc_value_pending_call_copy_value (const GValue* src_value,
                                  GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = dc_pending_call_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
dc_value_pending_call_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
dc_value_pending_call_collect_value (GValue* value,
                                     guint n_collect_values,
                                     GTypeCValue* collect_values,
                                     guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		DcPendingCall * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = dc_pending_call_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
dc_value_pending_call_lcopy_value (const GValue* value,
                                   guint n_collect_values,
                                   GTypeCValue* collect_values,
                                   guint collect_flags)
{
	DcPendingCall ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = dc_pending_call_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
dc_param_spec_pending_call (const gchar* name,
                            const gchar* nick,
                            const gchar* blurb,
                            GType object_type,
                            GParamFlags flags)
{
	DcParamSpecPendingCall* spec;
	g_return_val_if_fail (g_type_is_a (object_type, DC_TYPE_PENDING_CALL), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
dc_value_get_pending_call (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DC_TYPE_PENDING_CALL), NULL);
	return value->data[0].v_pointer;
}

void
dc_value_set_pending_call (GValue* value,
                           gpointer v_object)
{
	DcPendingCall * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DC_TYPE_PENDING_CALL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DC_TYPE_PENDING_CALL));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		dc_pending_call_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dc_pending_call_unref (old);
	}
}

void
dc_value_take_pending_call (GValue* value,
                            gpointer v_object)
{
	DcPendingCall * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, DC_TYPE_PENDING_CALL));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, DC_TYPE_PENDING_CALL));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		dc_pending_call_unref (old);
	}
}

static void
dc_pending_call_class_init (DcPendingCallClass * klass,
                            gpointer klass_data)
{
	dc_pending_call_parent_class = g_type_class_peek_parent (klass);
	((DcPendingCallClass *) klass)->finalize = dc_pending_call_finalize;
}

static void
dc_pending_call_instance_init (DcPendingCall * self,
                               gpointer klass)
{
	self->callback = NULL;
	self->callback_target = NULL;
	self->callback_target_destroy_notify = NULL;
	self->result = NULL;
	self->error_msg = NULL;
	self->ref_count = 1;
}

static void
dc_pending_call_finalize (DcPendingCall * obj)
{
	DcPendingCall * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_PENDING_CALL, DcPendingCall);
	g_signal_handlers_destroy (self);
	(self->callback_target_destroy_notify == NULL) ? NULL : (self->callback_target_destroy_notify (self->callback_target), NULL);
	self->callback = NULL;
	self->callback_target = NULL;
	self->callback_target_destroy_notify = NULL;
	__vala_JsonNode_free0 (self->result);
	_g_free0 (self->error_msg);
}

static GType
dc_pending_call_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { dc_value_pending_call_init, dc_value_pending_call_free_value, dc_value_pending_call_copy_value, dc_value_pending_call_peek_pointer, "p", dc_value_pending_call_collect_value, "p", dc_value_pending_call_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (DcPendingCallClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_pending_call_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcPendingCall), 0, (GInstanceInitFunc) dc_pending_call_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType dc_pending_call_type_id;
	dc_pending_call_type_id = g_type_register_fundamental (g_type_fundamental_next (), "DcPendingCall", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return dc_pending_call_type_id;
}

GType
dc_pending_call_get_type (void)
{
	static volatile gsize dc_pending_call_type_id__once = 0;
	if (g_once_init_enter (&dc_pending_call_type_id__once)) {
		GType dc_pending_call_type_id;
		dc_pending_call_type_id = dc_pending_call_get_type_once ();
		g_once_init_leave (&dc_pending_call_type_id__once, dc_pending_call_type_id);
	}
	return dc_pending_call_type_id__once;
}

gpointer
dc_pending_call_ref (gpointer instance)
{
	DcPendingCall * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
dc_pending_call_unref (gpointer instance)
{
	DcPendingCall * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		DC_PENDING_CALL_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
dc_params_get_instance_private (DcParams* self)
{
	return G_STRUCT_MEMBER_P (self, DcParams_private_offset);
}

static DcParams*
dc_params_construct (GType object_type)
{
	DcParams * self = NULL;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	self = (DcParams*) g_object_new (object_type, NULL);
	_tmp0_ = json_builder_new ();
	_g_object_unref0 (self->priv->b);
	self->priv->b = _tmp0_;
	_tmp1_ = self->priv->b;
	json_builder_begin_array (_tmp1_);
	return self;
}

static DcParams*
dc_params_new (void)
{
	return dc_params_construct (DC_TYPE_PARAMS);
}

DcParams*
dc_params_begin (void)
{
	DcParams* _tmp0_;
	DcParams* result;
	_tmp0_ = dc_params_new ();
	result = _tmp0_;
	return result;
}

DcParams*
dc_params_add_int (DcParams* self,
                   gint v)
{
	JsonBuilder* _tmp0_;
	DcParams* _tmp1_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_add_int_value (_tmp0_, (gint64) v);
	_tmp1_ = _g_object_ref0 (self);
	result = _tmp1_;
	return result;
}

DcParams*
dc_params_add_string (DcParams* self,
                      const gchar* v)
{
	DcParams* _tmp2_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (v != NULL) {
		JsonBuilder* _tmp0_;
		_tmp0_ = self->priv->b;
		json_builder_add_string_value (_tmp0_, v);
	} else {
		JsonBuilder* _tmp1_;
		_tmp1_ = self->priv->b;
		json_builder_add_null_value (_tmp1_);
	}
	_tmp2_ = _g_object_ref0 (self);
	result = _tmp2_;
	return result;
}

DcParams*
dc_params_add_bool (DcParams* self,
                    gboolean v)
{
	JsonBuilder* _tmp0_;
	DcParams* _tmp1_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_add_boolean_value (_tmp0_, v);
	_tmp1_ = _g_object_ref0 (self);
	result = _tmp1_;
	return result;
}

DcParams*
dc_params_add_null (DcParams* self)
{
	JsonBuilder* _tmp0_;
	DcParams* _tmp1_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_add_null_value (_tmp0_);
	_tmp1_ = _g_object_ref0 (self);
	result = _tmp1_;
	return result;
}

DcParams*
dc_params_add_int_array (DcParams* self,
                         gint* values,
                         gint values_length1)
{
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp2_;
	DcParams* _tmp3_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_begin_array (_tmp0_);
	{
		gint* v_collection = NULL;
		gint v_collection_length1 = 0;
		gint _v_collection_size_ = 0;
		gint v_it = 0;
		v_collection = values;
		v_collection_length1 = values_length1;
		for (v_it = 0; v_it < v_collection_length1; v_it = v_it + 1) {
			gint v = 0;
			v = v_collection[v_it];
			{
				JsonBuilder* _tmp1_;
				_tmp1_ = self->priv->b;
				json_builder_add_int_value (_tmp1_, (gint64) v);
			}
		}
	}
	_tmp2_ = self->priv->b;
	json_builder_end_array (_tmp2_);
	_tmp3_ = _g_object_ref0 (self);
	result = _tmp3_;
	return result;
}

DcParams*
dc_params_add_string_array (DcParams* self,
                            gchar** values,
                            gint values_length1)
{
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp4_;
	DcParams* _tmp5_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_begin_array (_tmp0_);
	{
		gchar** v_collection = NULL;
		gint v_collection_length1 = 0;
		gint _v_collection_size_ = 0;
		gint v_it = 0;
		v_collection = values;
		v_collection_length1 = values_length1;
		for (v_it = 0; v_it < v_collection_length1; v_it = v_it + 1) {
			gchar* _tmp1_;
			gchar* v = NULL;
			_tmp1_ = g_strdup (v_collection[v_it]);
			v = _tmp1_;
			{
				JsonBuilder* _tmp2_;
				const gchar* _tmp3_;
				_tmp2_ = self->priv->b;
				_tmp3_ = v;
				json_builder_add_string_value (_tmp2_, _tmp3_);
				_g_free0 (v);
			}
		}
	}
	_tmp4_ = self->priv->b;
	json_builder_end_array (_tmp4_);
	_tmp5_ = _g_object_ref0 (self);
	result = _tmp5_;
	return result;
}

DcParams*
dc_params_add_json_array (DcParams* self,
                          JsonArray* arr)
{
	JsonNode* node = NULL;
	JsonNode* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonNode* _tmp2_;
	DcParams* _tmp3_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (arr != NULL, NULL);
	_tmp0_ = json_node_new (JSON_NODE_ARRAY);
	node = _tmp0_;
	json_node_set_array (node, arr);
	_tmp1_ = self->priv->b;
	_tmp2_ = __vala_JsonNode_copy0 (node);
	json_builder_add_value (_tmp1_, _tmp2_);
	_tmp3_ = _g_object_ref0 (self);
	result = _tmp3_;
	__vala_JsonNode_free0 (node);
	return result;
}

DcParams*
dc_params_begin_object (DcParams* self)
{
	JsonBuilder* _tmp0_;
	DcParams* _tmp1_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_begin_object (_tmp0_);
	_tmp1_ = _g_object_ref0 (self);
	result = _tmp1_;
	return result;
}

DcParams*
dc_params_end_object (DcParams* self)
{
	JsonBuilder* _tmp0_;
	DcParams* _tmp1_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_end_object (_tmp0_);
	_tmp1_ = _g_object_ref0 (self);
	result = _tmp1_;
	return result;
}

DcParams*
dc_params_set_string_member (DcParams* self,
                             const gchar* name,
                             const gchar* value)
{
	JsonBuilder* _tmp0_;
	DcParams* _tmp3_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_set_member_name (_tmp0_, name);
	if (value != NULL) {
		JsonBuilder* _tmp1_;
		_tmp1_ = self->priv->b;
		json_builder_add_string_value (_tmp1_, value);
	} else {
		JsonBuilder* _tmp2_;
		_tmp2_ = self->priv->b;
		json_builder_add_null_value (_tmp2_);
	}
	_tmp3_ = _g_object_ref0 (self);
	result = _tmp3_;
	return result;
}

DcParams*
dc_params_set_null_member (DcParams* self,
                           const gchar* name)
{
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	DcParams* _tmp2_;
	DcParams* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_set_member_name (_tmp0_, name);
	_tmp1_ = self->priv->b;
	json_builder_add_null_value (_tmp1_);
	_tmp2_ = _g_object_ref0 (self);
	result = _tmp2_;
	return result;
}

JsonNode*
dc_params_build (DcParams* self)
{
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->b;
	json_builder_end_array (_tmp0_);
	_tmp1_ = self->priv->b;
	_tmp2_ = json_builder_get_root (_tmp1_);
	result = _tmp2_;
	return result;
}

static void
dc_params_class_init (DcParamsClass * klass,
                      gpointer klass_data)
{
	dc_params_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DcParams_private_offset);
	G_OBJECT_CLASS (klass)->finalize = dc_params_finalize;
}

static void
dc_params_instance_init (DcParams * self,
                         gpointer klass)
{
	self->priv = dc_params_get_instance_private (self);
}

static void
dc_params_finalize (GObject * obj)
{
	DcParams * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DC_TYPE_PARAMS, DcParams);
	_g_object_unref0 (self->priv->b);
	G_OBJECT_CLASS (dc_params_parent_class)->finalize (obj);
}

/**
     * Fluent builder for JSONRPC "params" arrays.
     * Replaces the build_params_* overload family and scattered inline Json.Builder use.
     */
static GType
dc_params_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DcParamsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dc_params_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DcParams), 0, (GInstanceInitFunc) dc_params_instance_init, NULL };
	GType dc_params_type_id;
	dc_params_type_id = g_type_register_static (G_TYPE_OBJECT, "DcParams", &g_define_type_info, 0);
	DcParams_private_offset = g_type_add_instance_private (dc_params_type_id, sizeof (DcParamsPrivate));
	return dc_params_type_id;
}

GType
dc_params_get_type (void)
{
	static volatile gsize dc_params_type_id__once = 0;
	if (g_once_init_enter (&dc_params_type_id__once)) {
		GType dc_params_type_id;
		dc_params_type_id = dc_params_get_type_once ();
		g_once_init_leave (&dc_params_type_id__once, dc_params_type_id);
	}
	return dc_params_type_id__once;
}

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

