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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <json-glib/json-glib.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <glib/gi18n-lib.h>
#include <adwaita.h>
#include <gio/gio.h>
#include <libsoup/soup.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 TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;
typedef struct _TubaEntityPrivate TubaEntityPrivate;

#define TUBA_API_TYPE_CONVERSATION (tuba_api_conversation_get_type ())
#define TUBA_API_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_CONVERSATION, TubaAPIConversation))
#define TUBA_API_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_CONVERSATION, TubaAPIConversationClass))
#define TUBA_API_IS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_CONVERSATION))
#define TUBA_API_IS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_CONVERSATION))
#define TUBA_API_CONVERSATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_CONVERSATION, TubaAPIConversationClass))

typedef struct _TubaAPIConversation TubaAPIConversation;
typedef struct _TubaAPIConversationClass TubaAPIConversationClass;
typedef struct _TubaAPIConversationPrivate TubaAPIConversationPrivate;

#define TUBA_API_TYPE_STATUS (tuba_api_status_get_type ())
#define TUBA_API_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatus))
#define TUBA_API_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))
#define TUBA_API_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_STATUS))
#define TUBA_API_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_STATUS))
#define TUBA_API_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))

typedef struct _TubaAPIStatus TubaAPIStatus;
typedef struct _TubaAPIStatusClass TubaAPIStatusClass;
enum  {
	TUBA_API_CONVERSATION_0_PROPERTY,
	TUBA_API_CONVERSATION_ID_PROPERTY,
	TUBA_API_CONVERSATION_ACCOUNTS_PROPERTY,
	TUBA_API_CONVERSATION_UNREAD_PROPERTY,
	TUBA_API_CONVERSATION_LAST_STATUS_PROPERTY,
	TUBA_API_CONVERSATION_NUM_PROPERTIES
};
static GParamSpec* tuba_api_conversation_properties[TUBA_API_CONVERSATION_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;

#define TUBA_WIDGETS_TYPE_RICH_LABEL (tuba_widgets_rich_label_get_type ())
#define TUBA_WIDGETS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabel))
#define TUBA_WIDGETS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))
#define TUBA_WIDGETS_IS_RICH_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_IS_RICH_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_RICH_LABEL))
#define TUBA_WIDGETS_RICH_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_RICH_LABEL, TubaWidgetsRichLabelClass))

typedef struct _TubaWidgetsRichLabel TubaWidgetsRichLabel;
typedef struct _TubaWidgetsRichLabelClass TubaWidgetsRichLabelClass;

#define TUBA_WIDGETS_TYPE_STATUS (tuba_widgets_status_get_type ())
#define TUBA_WIDGETS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatus))
#define TUBA_WIDGETS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatusClass))
#define TUBA_WIDGETS_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_STATUS))
#define TUBA_WIDGETS_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_STATUS))
#define TUBA_WIDGETS_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_STATUS, TubaWidgetsStatusClass))

typedef struct _TubaWidgetsStatus TubaWidgetsStatus;
typedef struct _TubaWidgetsStatusClass TubaWidgetsStatusClass;

#define TUBA_WIDGETS_TYPE_CONVERSATION (tuba_widgets_conversation_get_type ())
#define TUBA_WIDGETS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversation))
#define TUBA_WIDGETS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversationClass))
#define TUBA_WIDGETS_IS_CONVERSATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_CONVERSATION))
#define TUBA_WIDGETS_IS_CONVERSATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_CONVERSATION))
#define TUBA_WIDGETS_CONVERSATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_CONVERSATION, TubaWidgetsConversationClass))

typedef struct _TubaWidgetsConversation TubaWidgetsConversation;
typedef struct _TubaWidgetsConversationClass TubaWidgetsConversationClass;

#define TUBA_VIEWS_TYPE_BASE (tuba_views_base_get_type ())
#define TUBA_VIEWS_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBase))
#define TUBA_VIEWS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))
#define TUBA_VIEWS_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_BASE))
#define TUBA_VIEWS_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_BASE, TubaViewsBaseClass))

typedef struct _TubaViewsBase TubaViewsBase;
typedef struct _TubaViewsBaseClass TubaViewsBaseClass;

#define TUBA_VIEWS_TYPE_CONTENT_BASE (tuba_views_content_base_get_type ())
#define TUBA_VIEWS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBase))
#define TUBA_VIEWS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))
#define TUBA_VIEWS_IS_CONTENT_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_IS_CONTENT_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_CONTENT_BASE))
#define TUBA_VIEWS_CONTENT_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_CONTENT_BASE, TubaViewsContentBaseClass))

typedef struct _TubaViewsContentBase TubaViewsContentBase;
typedef struct _TubaViewsContentBaseClass TubaViewsContentBaseClass;

#define TUBA_VIEWS_TYPE_THREAD (tuba_views_thread_get_type ())
#define TUBA_VIEWS_THREAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_THREAD, TubaViewsThread))
#define TUBA_VIEWS_THREAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_THREAD, TubaViewsThreadClass))
#define TUBA_VIEWS_IS_THREAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_THREAD))
#define TUBA_VIEWS_IS_THREAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_THREAD))
#define TUBA_VIEWS_THREAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_THREAD, TubaViewsThreadClass))

typedef struct _TubaViewsThread TubaViewsThread;
typedef struct _TubaViewsThreadClass TubaViewsThreadClass;

#define TUBA_TYPE_APPLICATION (tuba_application_get_type ())
#define TUBA_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_APPLICATION, TubaApplication))
#define TUBA_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_APPLICATION, TubaApplicationClass))
#define TUBA_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_APPLICATION))
#define TUBA_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_APPLICATION))
#define TUBA_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_APPLICATION, TubaApplicationClass))

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;

#define TUBA_DIALOGS_TYPE_MAIN_WINDOW (tuba_dialogs_main_window_get_type ())
#define TUBA_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindow))
#define TUBA_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))
#define TUBA_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))

typedef struct _TubaDialogsMainWindow TubaDialogsMainWindow;
typedef struct _TubaDialogsMainWindowClass TubaDialogsMainWindowClass;

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())
typedef struct _TubaApiConversationMarkReadData TubaApiConversationMarkReadData;

struct _TubaWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TubaWidgetizable* self);
	void (*open) (TubaWidgetizable* self);
	void (*resolve_open) (TubaWidgetizable* self, TubaInstanceAccount* account);
};

struct _TubaEntity {
	GObject parent_instance;
	TubaEntityPrivate * priv;
};

struct _TubaEntityClass {
	GObjectClass parent_class;
	gboolean (*is_local) (TubaEntity* self, TubaInstanceAccount* account);
	GType (*deserialize_array_type) (TubaEntity* self, const gchar* prop);
};

struct _TubaAPIConversation {
	TubaEntity parent_instance;
	TubaAPIConversationPrivate * priv;
};

struct _TubaAPIConversationClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIConversationPrivate {
	gchar* _id;
	GeeArrayList* _accounts;
	gboolean _unread;
	TubaAPIStatus* _last_status;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaApiConversationMarkReadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaAPIConversation* self;
	TubaRequestV2* req;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	TubaAccountStore* _tmp4_;
	TubaInstanceAccount* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaRequestV2* _tmp8_;
	TubaRequestV2* _tmp9_;
	GInputStream* _tmp10_;
	GInputStream* _tmp11_;
	GError* _inner_error0_;
};

static gint TubaAPIConversation_private_offset;
static gpointer tuba_api_conversation_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaApplication* tuba_app;
static TubaWidgetizableIface * tuba_api_conversation_tuba_widgetizable_parent_iface = NULL;

VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GType tuba_api_conversation_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIConversation, g_object_unref)
VALA_EXTERN GType tuba_api_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIStatus, g_object_unref)
VALA_EXTERN GType tuba_entity_deserialize_array_type (TubaEntity* self,
                                          const gchar* prop);
static GType tuba_api_conversation_real_deserialize_array_type (TubaEntity* base,
                                                         const gchar* prop);
static GtkWidget* tuba_api_conversation_real_to_widget (TubaWidgetizable* base);
VALA_EXTERN TubaAPIStatus* tuba_api_conversation_get_last_status (TubaAPIConversation* self);
VALA_EXTERN GeeArrayList* tuba_api_conversation_get_accounts (TubaAPIConversation* self);
VALA_EXTERN const gchar* tuba_api_account_get_url (TubaAPIAccount* self);
VALA_EXTERN gchar* tuba_api_account_get_handle (TubaAPIAccount* self);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN gchar* tuba_instance_account_get_handle (TubaInstanceAccount* self);
VALA_EXTERN GType tuba_widgets_rich_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsRichLabel, g_object_unref)
VALA_EXTERN TubaWidgetsRichLabel* tuba_widgets_rich_label_new (const gchar* text);
VALA_EXTERN TubaWidgetsRichLabel* tuba_widgets_rich_label_construct (GType object_type,
                                                         const gchar* text);
VALA_EXTERN TubaWidgetsConversation* tuba_widgets_conversation_new (TubaAPIConversation* entity);
VALA_EXTERN TubaWidgetsConversation* tuba_widgets_conversation_construct (GType object_type,
                                                              TubaAPIConversation* entity);
VALA_EXTERN GType tuba_widgets_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsStatus, g_object_unref)
VALA_EXTERN GType tuba_widgets_conversation_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsConversation, g_object_unref)
static void tuba_api_conversation_real_open (TubaWidgetizable* base);
VALA_EXTERN GType tuba_views_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsBase, g_object_unref)
VALA_EXTERN GType tuba_views_content_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsContentBase, g_object_unref)
VALA_EXTERN GType tuba_views_thread_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsThread, g_object_unref)
VALA_EXTERN TubaAPIStatus* tuba_api_status_get_formal (TubaAPIStatus* self);
VALA_EXTERN TubaViewsThread* tuba_views_thread_new (TubaAPIStatus* status);
VALA_EXTERN TubaViewsThread* tuba_views_thread_construct (GType object_type,
                                              TubaAPIStatus* status);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
VALA_EXTERN GType tuba_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsMainWindow, g_object_unref)
VALA_EXTERN TubaDialogsMainWindow* tuba_application_get_main_window (TubaApplication* self);
VALA_EXTERN TubaViewsBase* tuba_dialogs_main_window_open_view (TubaDialogsMainWindow* self,
                                                   TubaViewsBase* view);
VALA_EXTERN gboolean tuba_api_conversation_get_unread (TubaAPIConversation* self);
VALA_EXTERN void tuba_api_conversation_mark_read (TubaAPIConversation* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN void tuba_api_conversation_mark_read_finish (TubaAPIConversation* self,
                                             GAsyncResult* _res_);
static void tuba_api_conversation_mark_read_data_free (gpointer _data);
static gboolean tuba_api_conversation_mark_read_co (TubaApiConversationMarkReadData* _data_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN const gchar* tuba_api_conversation_get_id (TubaAPIConversation* self);
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_api_conversation_mark_read_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
VALA_EXTERN void tuba_api_conversation_set_unread (TubaAPIConversation* self,
                                       gboolean value);
VALA_EXTERN TubaAPIConversation* tuba_api_conversation_new (void);
VALA_EXTERN TubaAPIConversation* tuba_api_conversation_construct (GType object_type);
VALA_EXTERN TubaEntity* tuba_entity_new (void);
VALA_EXTERN TubaEntity* tuba_entity_construct (GType object_type);
VALA_EXTERN void tuba_api_conversation_set_id (TubaAPIConversation* self,
                                   const gchar* value);
VALA_EXTERN void tuba_api_conversation_set_accounts (TubaAPIConversation* self,
                                         GeeArrayList* value);
VALA_EXTERN void tuba_api_conversation_set_last_status (TubaAPIConversation* self,
                                            TubaAPIStatus* value);
VALA_EXTERN GtkWidget* tuba_widgetizable_to_widget (TubaWidgetizable* self);
VALA_EXTERN void tuba_widgetizable_open (TubaWidgetizable* self);
static void tuba_api_conversation_finalize (GObject * obj);
static GType tuba_api_conversation_get_type_once (void);
static void _vala_tuba_api_conversation_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_tuba_api_conversation_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
tuba_api_conversation_get_instance_private (TubaAPIConversation* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIConversation_private_offset);
}

static GType
tuba_api_conversation_real_deserialize_array_type (TubaEntity* base,
                                                   const gchar* prop)
{
	TubaAPIConversation * self;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	GType result;
	self = (TubaAPIConversation*) base;
	g_return_val_if_fail (prop != NULL, G_TYPE_INVALID);
	_tmp0_ = prop;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("accounts")))) {
		switch (0) {
			default:
			{
				result = TUBA_API_TYPE_ACCOUNT;
				return result;
			}
		}
	}
	result = TUBA_ENTITY_CLASS (tuba_api_conversation_parent_class)->deserialize_array_type (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_TYPE_ENTITY, TubaEntity), prop);
	return result;
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static GtkWidget*
tuba_api_conversation_real_to_widget (TubaWidgetizable* base)
{
	TubaAPIConversation * self;
	TubaAPIStatus* _tmp0_;
	TubaWidgetsConversation* _tmp45_;
	GtkWidget* result;
	self = (TubaAPIConversation*) base;
	_tmp0_ = self->priv->_last_status;
	if (_tmp0_ == NULL) {
		gchar* account_list = NULL;
		gchar* _tmp1_;
		GeeArrayList* _tmp2_;
		const gchar* _tmp40_;
		gchar* _tmp41_;
		gchar* _tmp42_;
		TubaWidgetsRichLabel* _tmp43_ = NULL;
		GtkWidget* _tmp44_;
		_tmp1_ = g_strdup ("");
		account_list = _tmp1_;
		_tmp2_ = self->priv->_accounts;
		if (_tmp2_ != NULL) {
			const gchar* _tmp24_;
			gchar* _tmp25_;
			{
				GeeArrayList* _account_list = NULL;
				GeeArrayList* _tmp3_;
				gint _account_size = 0;
				GeeArrayList* _tmp4_;
				gint _tmp5_;
				gint _tmp6_;
				gint _account_index = 0;
				_tmp3_ = self->priv->_accounts;
				_account_list = _tmp3_;
				_tmp4_ = _account_list;
				_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
				_tmp6_ = _tmp5_;
				_account_size = _tmp6_;
				_account_index = -1;
				while (TRUE) {
					gint _tmp7_;
					gint _tmp8_;
					TubaAPIAccount* account = NULL;
					GeeArrayList* _tmp9_;
					gpointer _tmp10_;
					const gchar* _tmp11_;
					TubaAPIAccount* _tmp12_;
					const gchar* _tmp13_;
					const gchar* _tmp14_;
					const gchar* _tmp15_;
					TubaAPIAccount* _tmp16_;
					gchar* _tmp17_;
					gchar* _tmp18_;
					gchar* _tmp19_;
					const gchar* _tmp20_;
					gchar* _tmp21_;
					gchar* _tmp22_;
					gchar* _tmp23_;
					_account_index = _account_index + 1;
					_tmp7_ = _account_index;
					_tmp8_ = _account_size;
					if (!(_tmp7_ < _tmp8_)) {
						break;
					}
					_tmp9_ = _account_list;
					_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _account_index);
					account = (TubaAPIAccount*) _tmp10_;
					_tmp11_ = account_list;
					_tmp12_ = account;
					_tmp13_ = tuba_api_account_get_url (_tmp12_);
					_tmp14_ = _tmp13_;
					_tmp15_ = string_to_string (_tmp14_);
					_tmp16_ = account;
					_tmp17_ = tuba_api_account_get_handle (_tmp16_);
					_tmp18_ = _tmp17_;
					_tmp19_ = _tmp18_;
					_tmp20_ = string_to_string (_tmp19_);
					_tmp21_ = g_strconcat ("<a href='", _tmp15_, "'>", _tmp20_, "</a>, ", NULL);
					_tmp22_ = _tmp21_;
					_tmp23_ = g_strconcat (_tmp11_, _tmp22_, NULL);
					_g_free0 (account_list);
					account_list = _tmp23_;
					_g_free0 (_tmp22_);
					_g_free0 (_tmp19_);
					_g_object_unref0 (account);
				}
			}
			_tmp24_ = account_list;
			_tmp25_ = string_slice (_tmp24_, (glong) 0, (glong) -2);
			_g_free0 (account_list);
			account_list = _tmp25_;
		} else {
			TubaAccountStore* _tmp26_;
			TubaInstanceAccount* _tmp27_;
			TubaInstanceAccount* _tmp28_;
			const gchar* _tmp29_;
			const gchar* _tmp30_;
			const gchar* _tmp31_;
			TubaAccountStore* _tmp32_;
			TubaInstanceAccount* _tmp33_;
			TubaInstanceAccount* _tmp34_;
			gchar* _tmp35_;
			gchar* _tmp36_;
			gchar* _tmp37_;
			const gchar* _tmp38_;
			gchar* _tmp39_;
			_tmp26_ = tuba_accounts;
			_tmp27_ = tuba_account_store_get_active (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = tuba_api_account_get_url ((TubaAPIAccount*) _tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = string_to_string (_tmp30_);
			_tmp32_ = tuba_accounts;
			_tmp33_ = tuba_account_store_get_active (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = tuba_instance_account_get_handle (_tmp34_);
			_tmp36_ = _tmp35_;
			_tmp37_ = _tmp36_;
			_tmp38_ = string_to_string (_tmp37_);
			_tmp39_ = g_strconcat ("<a href='", _tmp31_, "'>", _tmp38_, "</a>", NULL);
			_g_free0 (account_list);
			account_list = _tmp39_;
			_g_free0 (_tmp37_);
		}
		_tmp40_ = account_list;
		_tmp41_ = g_strdup_printf (_ ("Empty Conversation with %s"), _tmp40_);
		_tmp42_ = _tmp41_;
		_tmp43_ = tuba_widgets_rich_label_new (_tmp42_);
		gtk_widget_set_margin_top ((GtkWidget*) _tmp43_, 16);
		gtk_widget_set_margin_bottom ((GtkWidget*) _tmp43_, 16);
		gtk_widget_set_margin_start ((GtkWidget*) _tmp43_, 16);
		gtk_widget_set_margin_end ((GtkWidget*) _tmp43_, 16);
		g_object_ref_sink (_tmp43_);
		_tmp44_ = (GtkWidget*) _tmp43_;
		_g_free0 (_tmp42_);
		result = _tmp44_;
		_g_free0 (account_list);
		return result;
	}
	_tmp45_ = tuba_widgets_conversation_new (self);
	g_object_ref_sink (_tmp45_);
	result = (GtkWidget*) _tmp45_;
	return result;
}

static void
tuba_api_conversation_real_open (TubaWidgetizable* base)
{
	TubaAPIConversation * self;
	TubaAPIStatus* _tmp0_;
	TubaViewsThread* view = NULL;
	TubaAPIStatus* _tmp1_;
	TubaAPIStatus* _tmp2_;
	TubaAPIStatus* _tmp3_;
	TubaViewsThread* _tmp4_;
	TubaApplication* _tmp5_;
	TubaDialogsMainWindow* _tmp6_;
	TubaDialogsMainWindow* _tmp7_;
	TubaViewsThread* _tmp8_;
	TubaViewsBase* _tmp9_;
	TubaViewsBase* _tmp10_;
	gboolean _tmp11_;
	self = (TubaAPIConversation*) base;
	_tmp0_ = self->priv->_last_status;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_last_status;
	_tmp2_ = tuba_api_status_get_formal (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = tuba_views_thread_new (_tmp3_);
	g_object_ref_sink (_tmp4_);
	view = _tmp4_;
	_tmp5_ = tuba_app;
	_tmp6_ = tuba_application_get_main_window (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = view;
	_tmp9_ = tuba_dialogs_main_window_open_view (_tmp7_, (TubaViewsBase*) _tmp8_);
	_tmp10_ = _tmp9_;
	_g_object_unref0 (_tmp10_);
	_tmp11_ = self->priv->_unread;
	if (_tmp11_) {
		tuba_api_conversation_mark_read (self, NULL, NULL);
	}
	_g_object_unref0 (view);
}

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

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

void
tuba_api_conversation_mark_read (TubaAPIConversation* self,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	TubaApiConversationMarkReadData* _data_;
	TubaAPIConversation* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaApiConversationMarkReadData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_api_conversation_mark_read_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_api_conversation_mark_read_co (_data_);
}

void
tuba_api_conversation_mark_read_finish (TubaAPIConversation* self,
                                        GAsyncResult* _res_)
{
	TubaApiConversationMarkReadData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_api_conversation_mark_read_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	TubaApiConversationMarkReadData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_api_conversation_mark_read_co (_data_);
}

static gboolean
tuba_api_conversation_mark_read_co (TubaApiConversationMarkReadData* _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->_id;
	_data_->_tmp1_ = string_to_string (_data_->_tmp0_);
	_data_->_tmp2_ = g_strconcat ("/api/v1/conversations/", _data_->_tmp1_, "/read", NULL);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = tuba_accounts;
	_data_->_tmp5_ = tuba_account_store_get_active (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _g_object_ref0 (_data_->_tmp6_);
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = tuba_request_v2_new (_data_->_tmp3_, TUBA_REQUEST_V2_METHOD_POST);
	tuba_request_v2_set_account (_data_->_tmp8_, _data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_free0 (_data_->_tmp3_);
	_data_->req = _data_->_tmp9_;
	{
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->req, tuba_api_conversation_mark_read_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp10_ = tuba_request_v2_exec_finish (_data_->req, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_g_object_unref0 (_data_->_tmp11_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		tuba_api_conversation_set_unread (_data_->self, FALSE);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_object_unref0 (_data_->req);
		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_object_unref0 (_data_->req);
	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;
}

TubaAPIConversation*
tuba_api_conversation_construct (GType object_type)
{
	TubaAPIConversation * self = NULL;
	self = (TubaAPIConversation*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIConversation*
tuba_api_conversation_new (void)
{
	return tuba_api_conversation_construct (TUBA_API_TYPE_CONVERSATION);
}

const gchar*
tuba_api_conversation_get_id (TubaAPIConversation* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

void
tuba_api_conversation_set_id (TubaAPIConversation* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_conversation_get_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_conversation_properties[TUBA_API_CONVERSATION_ID_PROPERTY]);
	}
}

GeeArrayList*
tuba_api_conversation_get_accounts (TubaAPIConversation* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_accounts;
	result = _tmp0_;
	return result;
}

void
tuba_api_conversation_set_accounts (TubaAPIConversation* self,
                                    GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_conversation_get_accounts (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_accounts);
		self->priv->_accounts = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_conversation_properties[TUBA_API_CONVERSATION_ACCOUNTS_PROPERTY]);
	}
}

gboolean
tuba_api_conversation_get_unread (TubaAPIConversation* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_unread;
	return result;
}

void
tuba_api_conversation_set_unread (TubaAPIConversation* self,
                                  gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_conversation_get_unread (self);
	if (old_value != value) {
		self->priv->_unread = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_conversation_properties[TUBA_API_CONVERSATION_UNREAD_PROPERTY]);
	}
}

TubaAPIStatus*
tuba_api_conversation_get_last_status (TubaAPIConversation* self)
{
	TubaAPIStatus* result;
	TubaAPIStatus* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_last_status;
	result = _tmp0_;
	return result;
}

void
tuba_api_conversation_set_last_status (TubaAPIConversation* self,
                                       TubaAPIStatus* value)
{
	TubaAPIStatus* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_conversation_get_last_status (self);
	if (old_value != value) {
		TubaAPIStatus* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_last_status);
		self->priv->_last_status = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_conversation_properties[TUBA_API_CONVERSATION_LAST_STATUS_PROPERTY]);
	}
}

static void
tuba_api_conversation_class_init (TubaAPIConversationClass * klass,
                                  gpointer klass_data)
{
	tuba_api_conversation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIConversation_private_offset);
	((TubaEntityClass *) klass)->deserialize_array_type = (GType (*) (TubaEntity*, const gchar*)) tuba_api_conversation_real_deserialize_array_type;
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_conversation_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_conversation_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_conversation_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_CONVERSATION_ID_PROPERTY, tuba_api_conversation_properties[TUBA_API_CONVERSATION_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_CONVERSATION_ACCOUNTS_PROPERTY, tuba_api_conversation_properties[TUBA_API_CONVERSATION_ACCOUNTS_PROPERTY] = g_param_spec_object ("accounts", "accounts", "accounts", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_CONVERSATION_UNREAD_PROPERTY, tuba_api_conversation_properties[TUBA_API_CONVERSATION_UNREAD_PROPERTY] = g_param_spec_boolean ("unread", "unread", "unread", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_CONVERSATION_LAST_STATUS_PROPERTY, tuba_api_conversation_properties[TUBA_API_CONVERSATION_LAST_STATUS_PROPERTY] = g_param_spec_object ("last-status", "last-status", "last-status", TUBA_API_TYPE_STATUS, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_api_conversation_tuba_widgetizable_interface_init (TubaWidgetizableIface * iface,
                                                        gpointer iface_data)
{
	tuba_api_conversation_tuba_widgetizable_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_widget = (GtkWidget* (*) (TubaWidgetizable*)) tuba_api_conversation_real_to_widget;
	iface->open = (void (*) (TubaWidgetizable*)) tuba_api_conversation_real_open;
}

static void
tuba_api_conversation_instance_init (TubaAPIConversation * self,
                                     gpointer klass)
{
	self->priv = tuba_api_conversation_get_instance_private (self);
	self->priv->_unread = FALSE;
	self->priv->_last_status = NULL;
}

static void
tuba_api_conversation_finalize (GObject * obj)
{
	TubaAPIConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_TYPE_CONVERSATION, TubaAPIConversation);
	_g_free0 (self->priv->_id);
	_g_object_unref0 (self->priv->_accounts);
	_g_object_unref0 (self->priv->_last_status);
	G_OBJECT_CLASS (tuba_api_conversation_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_conversation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIConversationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_conversation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIConversation), 0, (GInstanceInitFunc) tuba_api_conversation_instance_init, NULL };
	static const GInterfaceInfo tuba_widgetizable_info = { (GInterfaceInitFunc) tuba_api_conversation_tuba_widgetizable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_api_conversation_type_id;
	tuba_api_conversation_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIConversation", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_api_conversation_type_id, TUBA_TYPE_WIDGETIZABLE, &tuba_widgetizable_info);
	TubaAPIConversation_private_offset = g_type_add_instance_private (tuba_api_conversation_type_id, sizeof (TubaAPIConversationPrivate));
	return tuba_api_conversation_type_id;
}

GType
tuba_api_conversation_get_type (void)
{
	static GType tuba_api_conversation_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_conversation_type_id__once)) {
		GType tuba_api_conversation_type_id;
		tuba_api_conversation_type_id = tuba_api_conversation_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_conversation_type_id__once, tuba_api_conversation_type_id);
	}
	return tuba_api_conversation_type_id__once;
}

static void
_vala_tuba_api_conversation_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	TubaAPIConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_CONVERSATION, TubaAPIConversation);
	switch (property_id) {
		case TUBA_API_CONVERSATION_ID_PROPERTY:
		g_value_set_string (value, tuba_api_conversation_get_id (self));
		break;
		case TUBA_API_CONVERSATION_ACCOUNTS_PROPERTY:
		g_value_set_object (value, tuba_api_conversation_get_accounts (self));
		break;
		case TUBA_API_CONVERSATION_UNREAD_PROPERTY:
		g_value_set_boolean (value, tuba_api_conversation_get_unread (self));
		break;
		case TUBA_API_CONVERSATION_LAST_STATUS_PROPERTY:
		g_value_set_object (value, tuba_api_conversation_get_last_status (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_conversation_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	TubaAPIConversation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_CONVERSATION, TubaAPIConversation);
	switch (property_id) {
		case TUBA_API_CONVERSATION_ID_PROPERTY:
		tuba_api_conversation_set_id (self, g_value_get_string (value));
		break;
		case TUBA_API_CONVERSATION_ACCOUNTS_PROPERTY:
		tuba_api_conversation_set_accounts (self, g_value_get_object (value));
		break;
		case TUBA_API_CONVERSATION_UNREAD_PROPERTY:
		tuba_api_conversation_set_unread (self, g_value_get_boolean (value));
		break;
		case TUBA_API_CONVERSATION_LAST_STATUS_PROPERTY:
		tuba_api_conversation_set_last_status (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

