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

#include <adwaita.h>
#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <libsoup/soup.h>
#include <json-glib/json-glib.h>
#include <gee.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_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;
typedef struct _TubaViewsBasePrivate TubaViewsBasePrivate;

#define TUBA_VIEWS_TYPE_TABBED_BASE (tuba_views_tabbed_base_get_type ())
#define TUBA_VIEWS_TABBED_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_TABBED_BASE, TubaViewsTabbedBase))
#define TUBA_VIEWS_TABBED_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_TABBED_BASE, TubaViewsTabbedBaseClass))
#define TUBA_VIEWS_IS_TABBED_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_TABBED_BASE))
#define TUBA_VIEWS_IS_TABBED_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_TABBED_BASE))
#define TUBA_VIEWS_TABBED_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_TABBED_BASE, TubaViewsTabbedBaseClass))

typedef struct _TubaViewsTabbedBase TubaViewsTabbedBase;
typedef struct _TubaViewsTabbedBaseClass TubaViewsTabbedBaseClass;
typedef struct _TubaViewsTabbedBasePrivate TubaViewsTabbedBasePrivate;

#define TUBA_VIEWS_TYPE_COLLECTIONS (tuba_views_collections_get_type ())
#define TUBA_VIEWS_COLLECTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_COLLECTIONS, TubaViewsCollections))
#define TUBA_VIEWS_COLLECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_COLLECTIONS, TubaViewsCollectionsClass))
#define TUBA_VIEWS_IS_COLLECTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_COLLECTIONS))
#define TUBA_VIEWS_IS_COLLECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_COLLECTIONS))
#define TUBA_VIEWS_COLLECTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_COLLECTIONS, TubaViewsCollectionsClass))

typedef struct _TubaViewsCollections TubaViewsCollections;
typedef struct _TubaViewsCollectionsClass TubaViewsCollectionsClass;
typedef struct _TubaViewsCollectionsPrivate TubaViewsCollectionsPrivate;

#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;
enum  {
	TUBA_VIEWS_COLLECTIONS_0_PROPERTY,
	TUBA_VIEWS_COLLECTIONS_NUM_PROPERTIES
};
static GParamSpec* tuba_views_collections_properties[TUBA_VIEWS_COLLECTIONS_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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 _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_DIALOGS_TYPE_COLLECTIONS (tuba_dialogs_collections_get_type ())
#define TUBA_DIALOGS_COLLECTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_COLLECTIONS, TubaDialogsCollections))
#define TUBA_DIALOGS_COLLECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_COLLECTIONS, TubaDialogsCollectionsClass))
#define TUBA_DIALOGS_IS_COLLECTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_COLLECTIONS))
#define TUBA_DIALOGS_IS_COLLECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_COLLECTIONS))
#define TUBA_DIALOGS_COLLECTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_COLLECTIONS, TubaDialogsCollectionsClass))

typedef struct _TubaDialogsCollections TubaDialogsCollections;
typedef struct _TubaDialogsCollectionsClass TubaDialogsCollectionsClass;

#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_COLLECTION (tuba_api_collection_get_type ())
#define TUBA_API_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_COLLECTION, TubaAPICollection))
#define TUBA_API_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_COLLECTION, TubaAPICollectionClass))
#define TUBA_API_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_COLLECTION))
#define TUBA_API_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_COLLECTION))
#define TUBA_API_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_COLLECTION, TubaAPICollectionClass))

typedef struct _TubaAPICollection TubaAPICollection;
typedef struct _TubaAPICollectionClass TubaAPICollectionClass;

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

#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_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 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 ())

#define TUBA_TYPE_NETWORK (tuba_network_get_type ())
#define TUBA_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_NETWORK, TubaNetwork))
#define TUBA_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_NETWORK, TubaNetworkClass))
#define TUBA_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_NETWORK))
#define TUBA_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_NETWORK))
#define TUBA_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_NETWORK, TubaNetworkClass))

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;

#define TUBA_API_TYPE_COLLECTIONS (tuba_api_collections_get_type ())
#define TUBA_API_COLLECTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_COLLECTIONS, TubaAPICollections))
#define TUBA_API_COLLECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_COLLECTIONS, TubaAPICollectionsClass))
#define TUBA_API_IS_COLLECTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_COLLECTIONS))
#define TUBA_API_IS_COLLECTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_COLLECTIONS))
#define TUBA_API_COLLECTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_COLLECTIONS, TubaAPICollectionsClass))

typedef struct _TubaAPICollections TubaAPICollections;
typedef struct _TubaAPICollectionsClass TubaAPICollectionsClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
typedef struct _TubaViewsContentBasePrivate TubaViewsContentBasePrivate;

#define TUBA_API_TYPE_ACCOUNT_ROLE (tuba_api_account_role_get_type ())
#define TUBA_API_ACCOUNT_ROLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT_ROLE, TubaAPIAccountRole))
#define TUBA_API_ACCOUNT_ROLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT_ROLE, TubaAPIAccountRoleClass))
#define TUBA_API_IS_ACCOUNT_ROLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT_ROLE))
#define TUBA_API_IS_ACCOUNT_ROLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT_ROLE))
#define TUBA_API_ACCOUNT_ROLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT_ROLE, TubaAPIAccountRoleClass))

typedef struct _TubaAPIAccountRole TubaAPIAccountRole;
typedef struct _TubaAPIAccountRoleClass TubaAPIAccountRoleClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaViewsCollectionsRefreshCollectionsRealData TubaViewsCollectionsRefreshCollectionsRealData;
typedef struct _TubaViewsCollectionsRefreshInCollectionsRealData TubaViewsCollectionsRefreshInCollectionsRealData;

#define TUBA_VIEWS_TYPE_COLLECTION_LIST (tuba_views_collection_list_get_type ())
#define TUBA_VIEWS_COLLECTION_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_COLLECTION_LIST, TubaViewsCollectionList))
#define TUBA_VIEWS_COLLECTION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_COLLECTION_LIST, TubaViewsCollectionListClass))
#define TUBA_VIEWS_IS_COLLECTION_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_COLLECTION_LIST))
#define TUBA_VIEWS_IS_COLLECTION_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_COLLECTION_LIST))
#define TUBA_VIEWS_COLLECTION_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_COLLECTION_LIST, TubaViewsCollectionListClass))

typedef struct _TubaViewsCollectionList TubaViewsCollectionList;
typedef struct _TubaViewsCollectionListClass TubaViewsCollectionListClass;
typedef struct _TubaViewsCollectionListPrivate TubaViewsCollectionListPrivate;
enum  {
	TUBA_VIEWS_COLLECTION_LIST_0_PROPERTY,
	TUBA_VIEWS_COLLECTION_LIST_NUM_PROPERTIES
};
static GParamSpec* tuba_views_collection_list_properties[TUBA_VIEWS_COLLECTION_LIST_NUM_PROPERTIES];
typedef struct _TubaViewsCollectionListRefreshRealData TubaViewsCollectionListRefreshRealData;

struct _TubaViewsBase {
	AdwBreakpointBin parent_instance;
	TubaViewsBasePrivate * priv;
	AdwHeaderBar* header;
	AdwToolbarView* toolbar_view;
	GtkScrolledWindow* scrolled;
	GtkOverlay* scrolled_overlay;
	GtkRevealer* scroll_to_top_rev;
	GtkButton* scroll_to_top;
	GtkStack* states;
	AdwClamp* content_box;
	GtkButton* status_button;
};

struct _TubaViewsBaseClass {
	AdwBreakpointBinClass parent_class;
	void (*scroll_page) (TubaViewsBase* self, gboolean up);
	void (*unbind_listboxes) (TubaViewsBase* self);
	void (*build_actions) (TubaViewsBase* self);
	void (*build_header) (TubaViewsBase* self);
	void (*clear) (TubaViewsBase* self);
	void (*on_shown) (TubaViewsBase* self);
	void (*on_hidden) (TubaViewsBase* self);
	void (*on_content_changed) (TubaViewsBase* self);
	void (*on_error) (TubaViewsBase* self, gint32 code, const gchar* reason);
};

struct _TubaViewsTabbedBase {
	TubaViewsBase parent_instance;
	TubaViewsTabbedBasePrivate * priv;
	AdwViewSwitcher* switcher;
	AdwViewSwitcherBar* switcher_bar;
	AdwViewStack* stack;
	GtkStack* title_stack;
};

struct _TubaViewsTabbedBaseClass {
	TubaViewsBaseClass parent_class;
	void (*change_tab_alt) (TubaViewsTabbedBase* self, gint id);
	void (*on_view_switched) (TubaViewsTabbedBase* self);
	gboolean (*get_title_stack_page_visible) (TubaViewsTabbedBase* self);
	void (*set_title_stack_page_visible) (TubaViewsTabbedBase* self, gboolean value);
};

struct _TubaViewsCollections {
	TubaViewsTabbedBase parent_instance;
	TubaViewsCollectionsPrivate * priv;
};

struct _TubaViewsCollectionsClass {
	TubaViewsTabbedBaseClass parent_class;
};

struct _TubaViewsCollectionsPrivate {
	TubaViewsContentBase* own;
	TubaViewsContentBase* featured;
	GtkButton* add_collection_button;
};

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 _TubaViewsContentBase {
	TubaViewsBase parent_instance;
	TubaViewsContentBasePrivate * priv;
	GtkListBox* content;
	GListStore* model;
};

struct _TubaViewsContentBaseClass {
	TubaViewsBaseClass parent_class;
	void (*on_scrolled_vadjustment_value_change) (TubaViewsContentBase* self);
	void (*clear_all_but_first) (TubaViewsContentBase* self, gint i);
	void (*attempt_focus_grab) (TubaViewsContentBase* self);
	GtkWidget* (*on_create_model_widget) (TubaViewsContentBase* self, GObject* obj);
	void (*on_bottom_reached) (TubaViewsContentBase* self);
	void (*on_content_item_activated) (TubaViewsContentBase* self, GtkListBoxRow* row);
	gboolean (*get_empty) (TubaViewsContentBase* self);
};

struct _TubaViewsCollectionsRefreshCollectionsRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaViewsCollections* self;
	TubaRequestV2* req;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	TubaAccountStore* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaInstanceAccount* _tmp10_;
	TubaInstanceAccount* _tmp11_;
	TubaRequestV2* _tmp12_;
	TubaRequestV2* _tmp13_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp14_;
	GInputStream* _tmp15_;
	JsonParser* parser;
	GInputStream* _tmp16_;
	JsonParser* _tmp17_;
	JsonNode* node;
	TubaNetwork* _tmp18_;
	JsonParser* _tmp19_;
	JsonNode* _tmp20_;
	TubaAPICollections* collections;
	JsonNode* _tmp21_;
	TubaAPICollections* _tmp22_;
	TubaAPICollection** to_add;
	TubaAPICollection** _tmp23_;
	gint to_add_length1;
	gint _to_add_size_;
	GeeArrayList* _collection_list;
	TubaAPICollections* _tmp24_;
	GeeArrayList* _tmp25_;
	GeeArrayList* _tmp26_;
	gint _collection_size;
	GeeArrayList* _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	gint _collection_index;
	gint _tmp30_;
	gint _tmp31_;
	TubaAPICollection* collection;
	GeeArrayList* _tmp32_;
	gpointer _tmp33_;
	TubaAPICollection* _tmp34_;
	TubaAPICollection* _tmp35_;
	TubaViewsContentBase* _tmp36_;
	GListStore* _tmp37_;
	TubaViewsContentBase* _tmp38_;
	GListStore* _tmp39_;
	guint _tmp40_;
	guint _tmp41_;
	TubaAPICollection** _tmp42_;
	gint _tmp42__length1;
	gint16 _tmp43_;
	TubaAccountStore* _tmp44_;
	TubaInstanceAccount* _tmp45_;
	TubaInstanceAccount* _tmp46_;
	TubaAPIAccountRole* _tmp47_;
	TubaAPIAccountRole* _tmp48_;
	TubaAccountStore* _tmp49_;
	TubaInstanceAccount* _tmp50_;
	TubaInstanceAccount* _tmp51_;
	TubaAPIAccountRole* _tmp52_;
	TubaAPIAccountRole* _tmp53_;
	gint16 _tmp54_;
	gint16 _tmp55_;
	GtkButton* _tmp56_;
	TubaViewsContentBase* _tmp57_;
	GListStore* _tmp58_;
	guint _tmp59_;
	guint _tmp60_;
	GError* e;
	TubaViewsContentBase* _tmp61_;
	GError* _tmp62_;
	GError* _tmp63_;
	const gchar* _tmp64_;
	GError* _inner_error0_;
};

struct _TubaViewsCollectionsRefreshInCollectionsRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaViewsCollections* self;
	TubaRequestV2* req;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	TubaAccountStore* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaInstanceAccount* _tmp10_;
	TubaInstanceAccount* _tmp11_;
	TubaRequestV2* _tmp12_;
	TubaRequestV2* _tmp13_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp14_;
	GInputStream* _tmp15_;
	JsonParser* parser;
	GInputStream* _tmp16_;
	JsonParser* _tmp17_;
	JsonNode* node;
	TubaNetwork* _tmp18_;
	JsonParser* _tmp19_;
	JsonNode* _tmp20_;
	TubaAPICollections* collections;
	JsonNode* _tmp21_;
	TubaAPICollections* _tmp22_;
	TubaAPICollection** to_add;
	TubaAPICollection** _tmp23_;
	gint to_add_length1;
	gint _to_add_size_;
	GeeArrayList* _collection_list;
	TubaAPICollections* _tmp24_;
	GeeArrayList* _tmp25_;
	GeeArrayList* _tmp26_;
	gint _collection_size;
	GeeArrayList* _tmp27_;
	gint _tmp28_;
	gint _tmp29_;
	gint _collection_index;
	gint _tmp30_;
	gint _tmp31_;
	TubaAPICollection* collection;
	GeeArrayList* _tmp32_;
	gpointer _tmp33_;
	TubaAPICollection* _tmp34_;
	TubaAPICollection* _tmp35_;
	TubaViewsContentBase* _tmp36_;
	GListStore* _tmp37_;
	TubaViewsContentBase* _tmp38_;
	GListStore* _tmp39_;
	guint _tmp40_;
	guint _tmp41_;
	TubaAPICollection** _tmp42_;
	gint _tmp42__length1;
	GError* e;
	TubaViewsContentBase* _tmp43_;
	GError* _tmp44_;
	GError* _tmp45_;
	const gchar* _tmp46_;
	GError* _inner_error0_;
};

struct _TubaViewsCollectionList {
	TubaViewsContentBase parent_instance;
	TubaViewsCollectionListPrivate * priv;
};

struct _TubaViewsCollectionListClass {
	TubaViewsContentBaseClass parent_class;
};

struct _TubaViewsCollectionListPrivate {
	gchar* for_user_id;
};

struct _TubaViewsCollectionListRefreshRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaViewsCollectionList* self;
	gboolean skip_mapped_check;
	gboolean _tmp0_;
	TubaRequestV2* req;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	TubaAccountStore* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaRequestV2* _tmp9_;
	TubaRequestV2* _tmp10_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp11_;
	GInputStream* _tmp12_;
	JsonParser* parser;
	GInputStream* _tmp13_;
	JsonParser* _tmp14_;
	JsonNode* node;
	TubaNetwork* _tmp15_;
	JsonParser* _tmp16_;
	JsonNode* _tmp17_;
	TubaAPICollections* collections;
	JsonNode* _tmp18_;
	TubaAPICollections* _tmp19_;
	TubaAPICollection** to_add;
	TubaAPICollection** _tmp20_;
	gint to_add_length1;
	gint _to_add_size_;
	GeeArrayList* _collection_list;
	TubaAPICollections* _tmp21_;
	GeeArrayList* _tmp22_;
	GeeArrayList* _tmp23_;
	gint _collection_size;
	GeeArrayList* _tmp24_;
	gint _tmp25_;
	gint _tmp26_;
	gint _collection_index;
	gint _tmp27_;
	gint _tmp28_;
	TubaAPICollection* collection;
	GeeArrayList* _tmp29_;
	gpointer _tmp30_;
	TubaAPICollection* _tmp31_;
	TubaAPICollection* _tmp32_;
	GListStore* _tmp33_;
	GListStore* _tmp34_;
	guint _tmp35_;
	guint _tmp36_;
	TubaAPICollection** _tmp37_;
	gint _tmp37__length1;
	GError* e;
	GError* _tmp38_;
	GError* _tmp39_;
	const gchar* _tmp40_;
	GError* _inner_error0_;
};

static gint TubaViewsCollections_private_offset;
static gpointer tuba_views_collections_parent_class = NULL;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaNetwork* tuba_network;
static gint TubaViewsCollectionList_private_offset;
static gpointer tuba_views_collection_list_parent_class = NULL;

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_tabbed_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsTabbedBase, g_object_unref)
VALA_EXTERN GType tuba_views_collections_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsCollections, 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 TubaViewsCollections* tuba_views_collections_new (void);
VALA_EXTERN TubaViewsCollections* tuba_views_collections_construct (GType object_type);
VALA_EXTERN TubaViewsTabbedBase* tuba_views_tabbed_base_new (void);
VALA_EXTERN TubaViewsTabbedBase* tuba_views_tabbed_base_construct (GType object_type);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
static void tuba_views_collections_refresh (TubaViewsCollections* self);
static void _tuba_views_collections_refresh_tuba_application_refresh (TubaApplication* _sender,
                                                               gpointer self);
static void tuba_views_collections_on_add (TubaViewsCollections* self);
static void _tuba_views_collections_on_add_gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self);
VALA_EXTERN TubaViewsContentBase* tuba_views_tabbed_base_add_list_tab (TubaViewsTabbedBase* self,
                                                           const gchar* label,
                                                           const gchar* icon,
                                                           const gchar* empty_state_title);
static void tuba_views_collections_refresh_all (TubaViewsCollections* self,
                                         gboolean skip_mapped_check);
VALA_EXTERN GType tuba_dialogs_collections_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsCollections, g_object_unref)
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_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPICollection, g_object_unref)
VALA_EXTERN TubaDialogsCollections* tuba_dialogs_collections_new (TubaAPICollection* collection);
VALA_EXTERN TubaDialogsCollections* tuba_dialogs_collections_construct (GType object_type,
                                                            TubaAPICollection* collection);
static void _tuba_views_collections_refresh_tuba_dialogs_collections_refresh (TubaDialogsCollections* _sender,
                                                                       gpointer self);
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);
static void tuba_views_collections_refresh_collections_real (TubaViewsCollections* self,
                                                      GAsyncReadyCallback _callback_,
                                                      gpointer _user_data_);
static void tuba_views_collections_refresh_collections_real_finish (TubaViewsCollections* self,
                                                             GAsyncResult* _res_);
static void tuba_views_collections_refresh_in_collections_real (TubaViewsCollections* self,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static void tuba_views_collections_refresh_in_collections_real_finish (TubaViewsCollections* self,
                                                                GAsyncResult* _res_);
static void tuba_views_collections_refresh_collections_real_data_free (gpointer _data);
static gboolean tuba_views_collections_refresh_collections_real_co (TubaViewsCollectionsRefreshCollectionsRealData* _data_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, 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 TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN const gchar* tuba_api_account_get_id (TubaAPIAccount* 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_views_collections_refresh_collections_real_ready (GObject* source_object,
                                                            GAsyncResult* _res_,
                                                            gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
VALA_EXTERN GType tuba_api_collections_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPICollections, g_object_unref)
VALA_EXTERN TubaAPICollections* tuba_api_collections_from (JsonNode* node,
                                               GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN GeeArrayList* tuba_api_collections_get_collections (TubaAPICollections* self);
static void _vala_array_add62 (TubaAPICollection** * array,
                        gint* length,
                        gint* size,
                        TubaAPICollection* value);
VALA_EXTERN GType tuba_api_account_role_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccountRole, g_object_unref)
VALA_EXTERN TubaAPIAccountRole* tuba_api_account_get_role (TubaAPIAccount* self);
VALA_EXTERN gint16 tuba_api_account_role_get_collection_limit (TubaAPIAccountRole* self);
VALA_EXTERN void tuba_views_base_on_error (TubaViewsBase* self,
                               gint32 code,
                               const gchar* reason);
static void tuba_views_collections_refresh_in_collections_real_data_free (gpointer _data);
static gboolean tuba_views_collections_refresh_in_collections_real_co (TubaViewsCollectionsRefreshInCollectionsRealData* _data_);
static void tuba_views_collections_refresh_in_collections_real_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_);
static void _vala_array_add63 (TubaAPICollection** * array,
                        gint* length,
                        gint* size,
                        TubaAPICollection* value);
static GObject * tuba_views_collections_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties);
VALA_EXTERN void tuba_views_base_set_label (TubaViewsBase* self,
                                const gchar* value);
static void tuba_views_collections_finalize (GObject * obj);
static GType tuba_views_collections_get_type_once (void);
VALA_EXTERN GType tuba_views_collection_list_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsCollectionList, g_object_unref)
VALA_EXTERN TubaViewsCollectionList* tuba_views_collection_list_new (const gchar* for_user_id);
VALA_EXTERN TubaViewsCollectionList* tuba_views_collection_list_construct (GType object_type,
                                                               const gchar* for_user_id);
static void tuba_views_collection_list_refresh (TubaViewsCollectionList* self);
static void _tuba_views_collection_list_refresh_tuba_application_refresh (TubaApplication* _sender,
                                                                   gpointer self);
static void tuba_views_collection_list_refresh_real (TubaViewsCollectionList* self,
                                              gboolean skip_mapped_check,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static void tuba_views_collection_list_refresh_real_finish (TubaViewsCollectionList* self,
                                                     GAsyncResult* _res_);
static void tuba_views_collection_list_refresh_real_data_free (gpointer _data);
static gboolean tuba_views_collection_list_refresh_real_co (TubaViewsCollectionListRefreshRealData* _data_);
static void tuba_views_collection_list_refresh_real_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void _vala_array_add64 (TubaAPICollection** * array,
                        gint* length,
                        gint* size,
                        TubaAPICollection* value);
static void tuba_views_collection_list_finalize (GObject * obj);
static GType tuba_views_collection_list_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
tuba_views_collections_get_instance_private (TubaViewsCollections* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsCollections_private_offset);
}

static void
_tuba_views_collections_refresh_tuba_application_refresh (TubaApplication* _sender,
                                                          gpointer self)
{
	tuba_views_collections_refresh ((TubaViewsCollections*) self);
}

static void
_tuba_views_collections_on_add_gtk_button_clicked (GtkButton* _sender,
                                                   gpointer self)
{
	tuba_views_collections_on_add ((TubaViewsCollections*) self);
}

TubaViewsCollections*
tuba_views_collections_construct (GType object_type)
{
	TubaViewsCollections * self = NULL;
	TubaApplication* _tmp0_;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gchar* _tmp3_;
	GtkButton* _tmp4_ = NULL;
	GtkButton* _tmp5_;
	AdwHeaderBar* _tmp6_;
	GtkButton* _tmp7_;
	TubaViewsContentBase* _tmp8_;
	TubaViewsContentBase* _tmp9_;
	self = (TubaViewsCollections*) tuba_views_tabbed_base_construct (object_type);
	_tmp0_ = tuba_app;
	g_signal_connect_object (_tmp0_, "refresh", (GCallback) _tuba_views_collections_refresh_tuba_application_refresh, self, 0);
	_tmp1_ = g_strdup ("suggested-action");
	_tmp2_ = g_new0 (gchar*, 1 + 1);
	_tmp2_[0] = _tmp1_;
	_tmp3_ = g_strdup (_ ("New Collection"));
	_tmp4_ = (GtkButton*) gtk_button_new_from_icon_name ("tuba-plus-large-symbolic");
	gtk_widget_set_css_classes ((GtkWidget*) _tmp4_, _tmp2_);
	_tmp2_ = (_vala_array_free (_tmp2_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp4_, _tmp3_);
	_g_free0 (_tmp3_);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->add_collection_button);
	self->priv->add_collection_button = _tmp4_;
	_tmp5_ = self->priv->add_collection_button;
	g_signal_connect_object (_tmp5_, "clicked", (GCallback) _tuba_views_collections_on_add_gtk_button_clicked, self, 0);
	_tmp6_ = ((TubaViewsBase*) self)->header;
	_tmp7_ = self->priv->add_collection_button;
	adw_header_bar_pack_end (_tmp6_, (GtkWidget*) _tmp7_);
	_tmp8_ = tuba_views_tabbed_base_add_list_tab ((TubaViewsTabbedBase*) self, _ ("Your Collections"), "tuba-shapes-symbolic", _ ("No Collections"));
	_g_object_unref0 (self->priv->own);
	self->priv->own = _tmp8_;
	_tmp9_ = tuba_views_tabbed_base_add_list_tab ((TubaViewsTabbedBase*) self, _ ("Featuring You"), "tuba-person-symbolic", _ ("No Collections"));
	_g_object_unref0 (self->priv->featured);
	self->priv->featured = _tmp9_;
	tuba_views_collections_refresh_all (self, TRUE);
	return self;
}

TubaViewsCollections*
tuba_views_collections_new (void)
{
	return tuba_views_collections_construct (TUBA_VIEWS_TYPE_COLLECTIONS);
}

static void
_tuba_views_collections_refresh_tuba_dialogs_collections_refresh (TubaDialogsCollections* _sender,
                                                                  gpointer self)
{
	tuba_views_collections_refresh ((TubaViewsCollections*) self);
}

static void
tuba_views_collections_on_add (TubaViewsCollections* self)
{
	TubaDialogsCollections* dlg = NULL;
	TubaDialogsCollections* _tmp0_;
	TubaApplication* _tmp1_;
	TubaDialogsMainWindow* _tmp2_;
	TubaDialogsMainWindow* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_dialogs_collections_new (NULL);
	g_object_ref_sink (_tmp0_);
	dlg = _tmp0_;
	g_signal_connect_object (dlg, "refresh", (GCallback) _tuba_views_collections_refresh_tuba_dialogs_collections_refresh, self, 0);
	_tmp1_ = tuba_app;
	_tmp2_ = tuba_application_get_main_window (_tmp1_);
	_tmp3_ = _tmp2_;
	adw_dialog_present ((AdwDialog*) dlg, (GtkWidget*) _tmp3_);
	_g_object_unref0 (dlg);
}

static void
tuba_views_collections_refresh (TubaViewsCollections* self)
{
	g_return_if_fail (self != NULL);
	tuba_views_collections_refresh_all (self, FALSE);
}

static void
tuba_views_collections_refresh_all (TubaViewsCollections* self,
                                    gboolean skip_mapped_check)
{
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	if (!skip_mapped_check) {
		_tmp0_ = !gtk_widget_get_mapped ((GtkWidget*) self);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		return;
	}
	tuba_views_collections_refresh_collections_real (self, NULL, NULL);
	tuba_views_collections_refresh_in_collections_real (self, NULL, NULL);
}

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

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

static void
tuba_views_collections_refresh_collections_real (TubaViewsCollections* self,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_)
{
	TubaViewsCollectionsRefreshCollectionsRealData* _data_;
	TubaViewsCollections* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaViewsCollectionsRefreshCollectionsRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_collections_refresh_collections_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_views_collections_refresh_collections_real_co (_data_);
}

static void
tuba_views_collections_refresh_collections_real_finish (TubaViewsCollections* self,
                                                        GAsyncResult* _res_)
{
	TubaViewsCollectionsRefreshCollectionsRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

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 void
tuba_views_collections_refresh_collections_real_ready (GObject* source_object,
                                                       GAsyncResult* _res_,
                                                       gpointer _user_data_)
{
	TubaViewsCollectionsRefreshCollectionsRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_collections_refresh_collections_real_co (_data_);
}

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

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

static gboolean
tuba_views_collections_refresh_collections_real_co (TubaViewsCollectionsRefreshCollectionsRealData* _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_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = tuba_api_account_get_id ((TubaAPIAccount*) _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = string_to_string (_data_->_tmp4_);
	_data_->_tmp6_ = g_strconcat ("/api/v1/accounts/", _data_->_tmp5_, "/collections", NULL);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = tuba_accounts;
	_data_->_tmp9_ = tuba_account_store_get_active (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _g_object_ref0 (_data_->_tmp10_);
	_data_->_tmp12_ = NULL;
	_data_->_tmp12_ = tuba_request_v2_new (_data_->_tmp7_, TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp12_, _data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_g_free0 (_data_->_tmp7_);
	_data_->req = _data_->_tmp13_;
	{
		_data_->_tmp14_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp14_, tuba_views_collections_refresh_collections_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp15_ = tuba_request_v2_exec_finish (_data_->_tmp14_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp15_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp16_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp16_, NULL, tuba_views_collections_refresh_collections_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp17_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp17_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp18_ = tuba_network;
		_data_->_tmp19_ = _data_->parser;
		_data_->_tmp20_ = tuba_network_parse_node (_data_->_tmp18_, _data_->_tmp19_);
		_data_->node = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->node;
		_data_->_tmp22_ = tuba_api_collections_from (_data_->_tmp21_, &_data_->_inner_error0_);
		_data_->collections = _data_->_tmp22_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp23_ = g_new0 (TubaAPICollection*, 0 + 1);
		_data_->to_add = _data_->_tmp23_;
		_data_->to_add_length1 = 0;
		_data_->_to_add_size_ = _data_->to_add_length1;
		{
			_data_->_tmp24_ = _data_->collections;
			_data_->_tmp25_ = tuba_api_collections_get_collections (_data_->_tmp24_);
			_data_->_tmp26_ = _data_->_tmp25_;
			_data_->_collection_list = _data_->_tmp26_;
			_data_->_tmp27_ = _data_->_collection_list;
			_data_->_tmp28_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp27_);
			_data_->_tmp29_ = _data_->_tmp28_;
			_data_->_collection_size = _data_->_tmp29_;
			_data_->_collection_index = -1;
			while (TRUE) {
				_data_->_collection_index = _data_->_collection_index + 1;
				_data_->_tmp30_ = _data_->_collection_index;
				_data_->_tmp31_ = _data_->_collection_size;
				if (!(_data_->_tmp30_ < _data_->_tmp31_)) {
					break;
				}
				_data_->_tmp32_ = _data_->_collection_list;
				_data_->_tmp33_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp32_, _data_->_collection_index);
				_data_->collection = (TubaAPICollection*) _data_->_tmp33_;
				_data_->_tmp34_ = _data_->collection;
				_data_->_tmp35_ = _g_object_ref0 (_data_->_tmp34_);
				_vala_array_add62 (&_data_->to_add, &_data_->to_add_length1, &_data_->_to_add_size_, _data_->_tmp35_);
				_g_object_unref0 (_data_->collection);
			}
		}
		_data_->_tmp36_ = _data_->self->priv->own;
		_data_->_tmp37_ = _data_->_tmp36_->model;
		_data_->_tmp38_ = _data_->self->priv->own;
		_data_->_tmp39_ = _data_->_tmp38_->model;
		g_object_get (_data_->_tmp39_, "n-items", &_data_->_tmp40_, NULL);
		_data_->_tmp41_ = _data_->_tmp40_;
		_data_->_tmp42_ = _data_->to_add;
		_data_->_tmp42__length1 = _data_->to_add_length1;
		g_list_store_splice (_data_->_tmp37_, (guint) 0, _data_->_tmp41_, _data_->_tmp42_, (guint) _data_->_tmp42__length1);
		_data_->_tmp44_ = tuba_accounts;
		_data_->_tmp45_ = tuba_account_store_get_active (_data_->_tmp44_);
		_data_->_tmp46_ = _data_->_tmp45_;
		_data_->_tmp47_ = tuba_api_account_get_role ((TubaAPIAccount*) _data_->_tmp46_);
		_data_->_tmp48_ = _data_->_tmp47_;
		if (_data_->_tmp48_ != NULL) {
			_data_->_tmp49_ = tuba_accounts;
			_data_->_tmp50_ = tuba_account_store_get_active (_data_->_tmp49_);
			_data_->_tmp51_ = _data_->_tmp50_;
			_data_->_tmp52_ = tuba_api_account_get_role ((TubaAPIAccount*) _data_->_tmp51_);
			_data_->_tmp53_ = _data_->_tmp52_;
			_data_->_tmp54_ = tuba_api_account_role_get_collection_limit (_data_->_tmp53_);
			_data_->_tmp55_ = _data_->_tmp54_;
			_data_->_tmp43_ = _data_->_tmp55_;
		} else {
			_data_->_tmp43_ = (gint16) 10;
		}
		_data_->_tmp56_ = _data_->self->priv->add_collection_button;
		_data_->_tmp57_ = _data_->self->priv->own;
		_data_->_tmp58_ = _data_->_tmp57_->model;
		g_object_get (_data_->_tmp58_, "n-items", &_data_->_tmp59_, NULL);
		_data_->_tmp60_ = _data_->_tmp59_;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->_tmp56_, _data_->_tmp60_ < ((guint) _data_->_tmp43_));
		_data_->to_add = (_vala_array_free (_data_->to_add, _data_->to_add_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (_data_->collections);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp61_ = _data_->self->priv->own;
		_data_->_tmp62_ = _data_->e;
		_data_->_tmp63_ = _data_->e;
		_data_->_tmp64_ = _data_->_tmp63_->message;
		tuba_views_base_on_error ((TubaViewsBase*) _data_->_tmp61_, (gint32) _data_->_tmp62_->code, _data_->_tmp64_);
		_g_error_free0 (_data_->e);
	}
	__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;
}

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

static void
tuba_views_collections_refresh_in_collections_real (TubaViewsCollections* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	TubaViewsCollectionsRefreshInCollectionsRealData* _data_;
	TubaViewsCollections* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaViewsCollectionsRefreshInCollectionsRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_collections_refresh_in_collections_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_views_collections_refresh_in_collections_real_co (_data_);
}

static void
tuba_views_collections_refresh_in_collections_real_finish (TubaViewsCollections* self,
                                                           GAsyncResult* _res_)
{
	TubaViewsCollectionsRefreshInCollectionsRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_views_collections_refresh_in_collections_real_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_)
{
	TubaViewsCollectionsRefreshInCollectionsRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_collections_refresh_in_collections_real_co (_data_);
}

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

static gboolean
tuba_views_collections_refresh_in_collections_real_co (TubaViewsCollectionsRefreshInCollectionsRealData* _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_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = tuba_api_account_get_id ((TubaAPIAccount*) _data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = string_to_string (_data_->_tmp4_);
	_data_->_tmp6_ = g_strconcat ("/api/v1/accounts/", _data_->_tmp5_, "/in_collections", NULL);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = tuba_accounts;
	_data_->_tmp9_ = tuba_account_store_get_active (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = _g_object_ref0 (_data_->_tmp10_);
	_data_->_tmp12_ = NULL;
	_data_->_tmp12_ = tuba_request_v2_new (_data_->_tmp7_, TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp12_, _data_->_tmp11_);
	_g_object_unref0 (_data_->_tmp11_);
	_data_->_tmp13_ = _data_->_tmp12_;
	_g_free0 (_data_->_tmp7_);
	_data_->req = _data_->_tmp13_;
	{
		_data_->_tmp14_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp14_, tuba_views_collections_refresh_in_collections_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp15_ = tuba_request_v2_exec_finish (_data_->_tmp14_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp15_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp16_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp16_, NULL, tuba_views_collections_refresh_in_collections_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp17_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp17_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp18_ = tuba_network;
		_data_->_tmp19_ = _data_->parser;
		_data_->_tmp20_ = tuba_network_parse_node (_data_->_tmp18_, _data_->_tmp19_);
		_data_->node = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->node;
		_data_->_tmp22_ = tuba_api_collections_from (_data_->_tmp21_, &_data_->_inner_error0_);
		_data_->collections = _data_->_tmp22_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp23_ = g_new0 (TubaAPICollection*, 0 + 1);
		_data_->to_add = _data_->_tmp23_;
		_data_->to_add_length1 = 0;
		_data_->_to_add_size_ = _data_->to_add_length1;
		{
			_data_->_tmp24_ = _data_->collections;
			_data_->_tmp25_ = tuba_api_collections_get_collections (_data_->_tmp24_);
			_data_->_tmp26_ = _data_->_tmp25_;
			_data_->_collection_list = _data_->_tmp26_;
			_data_->_tmp27_ = _data_->_collection_list;
			_data_->_tmp28_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp27_);
			_data_->_tmp29_ = _data_->_tmp28_;
			_data_->_collection_size = _data_->_tmp29_;
			_data_->_collection_index = -1;
			while (TRUE) {
				_data_->_collection_index = _data_->_collection_index + 1;
				_data_->_tmp30_ = _data_->_collection_index;
				_data_->_tmp31_ = _data_->_collection_size;
				if (!(_data_->_tmp30_ < _data_->_tmp31_)) {
					break;
				}
				_data_->_tmp32_ = _data_->_collection_list;
				_data_->_tmp33_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp32_, _data_->_collection_index);
				_data_->collection = (TubaAPICollection*) _data_->_tmp33_;
				_data_->_tmp34_ = _data_->collection;
				_data_->_tmp35_ = _g_object_ref0 (_data_->_tmp34_);
				_vala_array_add63 (&_data_->to_add, &_data_->to_add_length1, &_data_->_to_add_size_, _data_->_tmp35_);
				_g_object_unref0 (_data_->collection);
			}
		}
		_data_->_tmp36_ = _data_->self->priv->featured;
		_data_->_tmp37_ = _data_->_tmp36_->model;
		_data_->_tmp38_ = _data_->self->priv->featured;
		_data_->_tmp39_ = _data_->_tmp38_->model;
		g_object_get (_data_->_tmp39_, "n-items", &_data_->_tmp40_, NULL);
		_data_->_tmp41_ = _data_->_tmp40_;
		_data_->_tmp42_ = _data_->to_add;
		_data_->_tmp42__length1 = _data_->to_add_length1;
		g_list_store_splice (_data_->_tmp37_, (guint) 0, _data_->_tmp41_, _data_->_tmp42_, (guint) _data_->_tmp42__length1);
		_data_->to_add = (_vala_array_free (_data_->to_add, _data_->to_add_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (_data_->collections);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp43_ = _data_->self->priv->featured;
		_data_->_tmp44_ = _data_->e;
		_data_->_tmp45_ = _data_->e;
		_data_->_tmp46_ = _data_->_tmp45_->message;
		tuba_views_base_on_error ((TubaViewsBase*) _data_->_tmp43_, (gint32) _data_->_tmp44_->code, _data_->_tmp46_);
		_g_error_free0 (_data_->e);
	}
	__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;
}

static GObject *
tuba_views_collections_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaViewsCollections * self;
	parent_class = G_OBJECT_CLASS (tuba_views_collections_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_COLLECTIONS, TubaViewsCollections);
	tuba_views_base_set_label ((TubaViewsBase*) self, _ ("Collections"));
	return obj;
}

static void
tuba_views_collections_class_init (TubaViewsCollectionsClass * klass,
                                   gpointer klass_data)
{
	tuba_views_collections_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsCollections_private_offset);
	G_OBJECT_CLASS (klass)->constructor = tuba_views_collections_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_views_collections_finalize;
}

static void
tuba_views_collections_instance_init (TubaViewsCollections * self,
                                      gpointer klass)
{
	self->priv = tuba_views_collections_get_instance_private (self);
}

static void
tuba_views_collections_finalize (GObject * obj)
{
	TubaViewsCollections * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_COLLECTIONS, TubaViewsCollections);
	_g_object_unref0 (self->priv->own);
	_g_object_unref0 (self->priv->featured);
	_g_object_unref0 (self->priv->add_collection_button);
	G_OBJECT_CLASS (tuba_views_collections_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_collections_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsCollectionsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_collections_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsCollections), 0, (GInstanceInitFunc) tuba_views_collections_instance_init, NULL };
	GType tuba_views_collections_type_id;
	tuba_views_collections_type_id = g_type_register_static (TUBA_VIEWS_TYPE_TABBED_BASE, "TubaViewsCollections", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaViewsCollections_private_offset = g_type_add_instance_private (tuba_views_collections_type_id, sizeof (TubaViewsCollectionsPrivate));
	return tuba_views_collections_type_id;
}

GType
tuba_views_collections_get_type (void)
{
	static GType tuba_views_collections_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_collections_type_id__once)) {
		GType tuba_views_collections_type_id;
		tuba_views_collections_type_id = tuba_views_collections_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_collections_type_id__once, tuba_views_collections_type_id);
	}
	return tuba_views_collections_type_id__once;
}

static inline gpointer
tuba_views_collection_list_get_instance_private (TubaViewsCollectionList* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsCollectionList_private_offset);
}

static void
_tuba_views_collection_list_refresh_tuba_application_refresh (TubaApplication* _sender,
                                                              gpointer self)
{
	tuba_views_collection_list_refresh ((TubaViewsCollectionList*) self);
}

TubaViewsCollectionList*
tuba_views_collection_list_construct (GType object_type,
                                      const gchar* for_user_id)
{
	TubaViewsCollectionList * self = NULL;
	gchar* _tmp0_;
	TubaApplication* _tmp1_;
	g_return_val_if_fail (for_user_id != NULL, NULL);
	self = (TubaViewsCollectionList*) g_object_new (object_type, "label", _ ("Collections"), "icon", "tuba-shapes-symbolic", "empty-state-title", _ ("No Collections"), "allow-nesting", TRUE, NULL);
	_tmp0_ = g_strdup (for_user_id);
	_g_free0 (self->priv->for_user_id);
	self->priv->for_user_id = _tmp0_;
	_tmp1_ = tuba_app;
	g_signal_connect_object (_tmp1_, "refresh", (GCallback) _tuba_views_collection_list_refresh_tuba_application_refresh, self, 0);
	tuba_views_collection_list_refresh_real (self, TRUE, NULL, NULL);
	return self;
}

TubaViewsCollectionList*
tuba_views_collection_list_new (const gchar* for_user_id)
{
	return tuba_views_collection_list_construct (TUBA_VIEWS_TYPE_COLLECTION_LIST, for_user_id);
}

static void
tuba_views_collection_list_refresh (TubaViewsCollectionList* self)
{
	g_return_if_fail (self != NULL);
	tuba_views_collection_list_refresh_real (self, FALSE, NULL, NULL);
}

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

static void
tuba_views_collection_list_refresh_real (TubaViewsCollectionList* self,
                                         gboolean skip_mapped_check,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	TubaViewsCollectionListRefreshRealData* _data_;
	TubaViewsCollectionList* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaViewsCollectionListRefreshRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_views_collection_list_refresh_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->skip_mapped_check = skip_mapped_check;
	tuba_views_collection_list_refresh_real_co (_data_);
}

static void
tuba_views_collection_list_refresh_real_finish (TubaViewsCollectionList* self,
                                                GAsyncResult* _res_)
{
	TubaViewsCollectionListRefreshRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_views_collection_list_refresh_real_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	TubaViewsCollectionListRefreshRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_views_collection_list_refresh_real_co (_data_);
}

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

static gboolean
tuba_views_collection_list_refresh_real_co (TubaViewsCollectionListRefreshRealData* _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:
	if (!_data_->skip_mapped_check) {
		_data_->_tmp0_ = !gtk_widget_get_mapped ((GtkWidget*) _data_->self);
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_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;
	}
	_data_->_tmp1_ = _data_->self->priv->for_user_id;
	_data_->_tmp2_ = string_to_string (_data_->_tmp1_);
	_data_->_tmp3_ = g_strconcat ("/api/v1/accounts/", _data_->_tmp2_, "/collections", NULL);
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = tuba_accounts;
	_data_->_tmp6_ = tuba_account_store_get_active (_data_->_tmp5_);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp7_);
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = tuba_request_v2_new (_data_->_tmp4_, TUBA_REQUEST_V2_METHOD_GET);
	tuba_request_v2_set_account (_data_->_tmp9_, _data_->_tmp8_);
	_g_object_unref0 (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_g_free0 (_data_->_tmp4_);
	_data_->req = _data_->_tmp10_;
	{
		_data_->_tmp11_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp11_, tuba_views_collection_list_refresh_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp12_ = tuba_request_v2_exec_finish (_data_->_tmp11_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp12_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp13_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp13_, NULL, tuba_views_collection_list_refresh_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp14_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp14_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp15_ = tuba_network;
		_data_->_tmp16_ = _data_->parser;
		_data_->_tmp17_ = tuba_network_parse_node (_data_->_tmp15_, _data_->_tmp16_);
		_data_->node = _data_->_tmp17_;
		_data_->_tmp18_ = _data_->node;
		_data_->_tmp19_ = tuba_api_collections_from (_data_->_tmp18_, &_data_->_inner_error0_);
		_data_->collections = _data_->_tmp19_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp20_ = g_new0 (TubaAPICollection*, 0 + 1);
		_data_->to_add = _data_->_tmp20_;
		_data_->to_add_length1 = 0;
		_data_->_to_add_size_ = _data_->to_add_length1;
		{
			_data_->_tmp21_ = _data_->collections;
			_data_->_tmp22_ = tuba_api_collections_get_collections (_data_->_tmp21_);
			_data_->_tmp23_ = _data_->_tmp22_;
			_data_->_collection_list = _data_->_tmp23_;
			_data_->_tmp24_ = _data_->_collection_list;
			_data_->_tmp25_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp24_);
			_data_->_tmp26_ = _data_->_tmp25_;
			_data_->_collection_size = _data_->_tmp26_;
			_data_->_collection_index = -1;
			while (TRUE) {
				_data_->_collection_index = _data_->_collection_index + 1;
				_data_->_tmp27_ = _data_->_collection_index;
				_data_->_tmp28_ = _data_->_collection_size;
				if (!(_data_->_tmp27_ < _data_->_tmp28_)) {
					break;
				}
				_data_->_tmp29_ = _data_->_collection_list;
				_data_->_tmp30_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp29_, _data_->_collection_index);
				_data_->collection = (TubaAPICollection*) _data_->_tmp30_;
				_data_->_tmp31_ = _data_->collection;
				_data_->_tmp32_ = _g_object_ref0 (_data_->_tmp31_);
				_vala_array_add64 (&_data_->to_add, &_data_->to_add_length1, &_data_->_to_add_size_, _data_->_tmp32_);
				_g_object_unref0 (_data_->collection);
			}
		}
		_data_->_tmp33_ = ((TubaViewsContentBase*) _data_->self)->model;
		_data_->_tmp34_ = ((TubaViewsContentBase*) _data_->self)->model;
		g_object_get (_data_->_tmp34_, "n-items", &_data_->_tmp35_, NULL);
		_data_->_tmp36_ = _data_->_tmp35_;
		_data_->_tmp37_ = _data_->to_add;
		_data_->_tmp37__length1 = _data_->to_add_length1;
		g_list_store_splice (_data_->_tmp33_, (guint) 0, _data_->_tmp36_, _data_->_tmp37_, (guint) _data_->_tmp37__length1);
		_data_->to_add = (_vala_array_free (_data_->to_add, _data_->to_add_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (_data_->collections);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp38_ = _data_->e;
		_data_->_tmp39_ = _data_->e;
		_data_->_tmp40_ = _data_->_tmp39_->message;
		tuba_views_base_on_error ((TubaViewsBase*) _data_->self, (gint32) _data_->_tmp38_->code, _data_->_tmp40_);
		_g_error_free0 (_data_->e);
	}
	__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;
}

static void
tuba_views_collection_list_class_init (TubaViewsCollectionListClass * klass,
                                       gpointer klass_data)
{
	tuba_views_collection_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsCollectionList_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tuba_views_collection_list_finalize;
}

static void
tuba_views_collection_list_instance_init (TubaViewsCollectionList * self,
                                          gpointer klass)
{
	self->priv = tuba_views_collection_list_get_instance_private (self);
}

static void
tuba_views_collection_list_finalize (GObject * obj)
{
	TubaViewsCollectionList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_COLLECTION_LIST, TubaViewsCollectionList);
	_g_free0 (self->priv->for_user_id);
	G_OBJECT_CLASS (tuba_views_collection_list_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_collection_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsCollectionListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_collection_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsCollectionList), 0, (GInstanceInitFunc) tuba_views_collection_list_instance_init, NULL };
	GType tuba_views_collection_list_type_id;
	tuba_views_collection_list_type_id = g_type_register_static (TUBA_VIEWS_TYPE_CONTENT_BASE, "TubaViewsCollectionList", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaViewsCollectionList_private_offset = g_type_add_instance_private (tuba_views_collection_list_type_id, sizeof (TubaViewsCollectionListPrivate));
	return tuba_views_collection_list_type_id;
}

GType
tuba_views_collection_list_get_type (void)
{
	static GType tuba_views_collection_list_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_collection_list_type_id__once)) {
		GType tuba_views_collection_list_type_id;
		tuba_views_collection_list_type_id = tuba_views_collection_list_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_collection_list_type_id__once, tuba_views_collection_list_type_id);
	}
	return tuba_views_collection_list_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);
}

