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

#include <glib-object.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <json-glib/json-glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <handy.h>
#include <gio/gio.h>
#include <libsoup/soup.h>

#define TOOTLE_TYPE_WIDGETIZABLE (tootle_widgetizable_get_type ())
#define TOOTLE_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_WIDGETIZABLE, TootleWidgetizable))
#define TOOTLE_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_WIDGETIZABLE))
#define TOOTLE_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TOOTLE_TYPE_WIDGETIZABLE, TootleWidgetizableIface))

typedef struct _TootleWidgetizable TootleWidgetizable;
typedef struct _TootleWidgetizableIface TootleWidgetizableIface;

#define TOOTLE_TYPE_ENTITY (tootle_entity_get_type ())
#define TOOTLE_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ENTITY, TootleEntity))
#define TOOTLE_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ENTITY, TootleEntityClass))
#define TOOTLE_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ENTITY))
#define TOOTLE_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ENTITY))
#define TOOTLE_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ENTITY, TootleEntityClass))

typedef struct _TootleEntity TootleEntity;
typedef struct _TootleEntityClass TootleEntityClass;

#define TOOTLE_API_TYPE_ACCOUNT (tootle_api_account_get_type ())
#define TOOTLE_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccount))
#define TOOTLE_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))
#define TOOTLE_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_ACCOUNT))
#define TOOTLE_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccountClass))

typedef struct _TootleAPIAccount TootleAPIAccount;
typedef struct _TootleAPIAccountClass TootleAPIAccountClass;

#define TOOTLE_TYPE_INSTANCE_ACCOUNT (tootle_instance_account_get_type ())
#define TOOTLE_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccount))
#define TOOTLE_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))
#define TOOTLE_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_INSTANCE_ACCOUNT))
#define TOOTLE_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_INSTANCE_ACCOUNT, TootleInstanceAccountClass))

typedef struct _TootleInstanceAccount TootleInstanceAccount;
typedef struct _TootleInstanceAccountClass TootleInstanceAccountClass;
typedef struct _TootleEntityPrivate TootleEntityPrivate;
typedef struct _TootleAPIAccountPrivate TootleAPIAccountPrivate;

#define TOOTLE_API_TYPE_ACCOUNT_FIELD (tootle_api_account_field_get_type ())
#define TOOTLE_API_ACCOUNT_FIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_ACCOUNT_FIELD, TootleAPIAccountField))
#define TOOTLE_API_ACCOUNT_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_ACCOUNT_FIELD, TootleAPIAccountFieldClass))
#define TOOTLE_API_IS_ACCOUNT_FIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_ACCOUNT_FIELD))
#define TOOTLE_API_IS_ACCOUNT_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_ACCOUNT_FIELD))
#define TOOTLE_API_ACCOUNT_FIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_ACCOUNT_FIELD, TootleAPIAccountFieldClass))

typedef struct _TootleAPIAccountField TootleAPIAccountField;
typedef struct _TootleAPIAccountFieldClass TootleAPIAccountFieldClass;
enum  {
	TOOTLE_API_ACCOUNT_0_PROPERTY,
	TOOTLE_API_ACCOUNT_ID_PROPERTY,
	TOOTLE_API_ACCOUNT_USERNAME_PROPERTY,
	TOOTLE_API_ACCOUNT_ACCT_PROPERTY,
	TOOTLE_API_ACCOUNT_DISPLAY_NAME_PROPERTY,
	TOOTLE_API_ACCOUNT_NOTE_PROPERTY,
	TOOTLE_API_ACCOUNT_HEADER_PROPERTY,
	TOOTLE_API_ACCOUNT_AVATAR_PROPERTY,
	TOOTLE_API_ACCOUNT_URL_PROPERTY,
	TOOTLE_API_ACCOUNT_CREATED_AT_PROPERTY,
	TOOTLE_API_ACCOUNT_FOLLOWERS_COUNT_PROPERTY,
	TOOTLE_API_ACCOUNT_FOLLOWING_COUNT_PROPERTY,
	TOOTLE_API_ACCOUNT_STATUSES_COUNT_PROPERTY,
	TOOTLE_API_ACCOUNT_FIELDS_PROPERTY,
	TOOTLE_API_ACCOUNT_HANDLE_PROPERTY,
	TOOTLE_API_ACCOUNT_DOMAIN_PROPERTY,
	TOOTLE_API_ACCOUNT_NUM_PROPERTIES
};
static GParamSpec* tootle_api_account_properties[TOOTLE_API_ACCOUNT_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 TOOTLE_TYPE_ACCOUNTS (tootle_accounts_get_type ())
#define TOOTLE_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_TYPE_ACCOUNTS, TootleAccounts))
#define TOOTLE_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_TYPE_ACCOUNTS, TootleAccountsClass))
#define TOOTLE_IS_ACCOUNTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_TYPE_ACCOUNTS))
#define TOOTLE_IS_ACCOUNTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_TYPE_ACCOUNTS))
#define TOOTLE_ACCOUNTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_TYPE_ACCOUNTS, TootleAccountsClass))

typedef struct _TootleAccounts TootleAccounts;
typedef struct _TootleAccountsClass TootleAccountsClass;

#define TOOTLE_API_TYPE_STATUS (tootle_api_status_get_type ())
#define TOOTLE_API_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_API_TYPE_STATUS, TootleAPIStatus))
#define TOOTLE_API_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_API_TYPE_STATUS, TootleAPIStatusClass))
#define TOOTLE_API_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_API_TYPE_STATUS))
#define TOOTLE_API_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_API_TYPE_STATUS))
#define TOOTLE_API_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_API_TYPE_STATUS, TootleAPIStatusClass))

typedef struct _TootleAPIStatus TootleAPIStatus;
typedef struct _TootleAPIStatusClass TootleAPIStatusClass;
typedef enum  {
	TOOTLE_API_NOTIFICATION_TYPE_MENTION,
	TOOTLE_API_NOTIFICATION_TYPE_REBLOG,
	TOOTLE_API_NOTIFICATION_TYPE_REBLOG_REMOTE_USER,
	TOOTLE_API_NOTIFICATION_TYPE_FAVOURITE,
	TOOTLE_API_NOTIFICATION_TYPE_FOLLOW,
	TOOTLE_API_NOTIFICATION_TYPE_FOLLOW_REQUEST,
	TOOTLE_API_NOTIFICATION_TYPE_WATCHLIST
} TootleAPINotificationType;

#define TOOTLE_API_TYPE_NOTIFICATION_TYPE (tootle_api_notification_type_get_type ())

#define TOOTLE_WIDGETS_TYPE_STATUS (tootle_widgets_status_get_type ())
#define TOOTLE_WIDGETS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatus))
#define TOOTLE_WIDGETS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatusClass))
#define TOOTLE_WIDGETS_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_WIDGETS_TYPE_STATUS))
#define TOOTLE_WIDGETS_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_WIDGETS_TYPE_STATUS))
#define TOOTLE_WIDGETS_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_WIDGETS_TYPE_STATUS, TootleWidgetsStatusClass))

typedef struct _TootleWidgetsStatus TootleWidgetsStatus;
typedef struct _TootleWidgetsStatusClass TootleWidgetsStatusClass;

#define TOOTLE_VIEWS_TYPE_BASE (tootle_views_base_get_type ())
#define TOOTLE_VIEWS_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_VIEWS_TYPE_BASE, TootleViewsBase))
#define TOOTLE_VIEWS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_VIEWS_TYPE_BASE, TootleViewsBaseClass))
#define TOOTLE_VIEWS_IS_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_VIEWS_TYPE_BASE))
#define TOOTLE_VIEWS_IS_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_VIEWS_TYPE_BASE))
#define TOOTLE_VIEWS_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_VIEWS_TYPE_BASE, TootleViewsBaseClass))

typedef struct _TootleViewsBase TootleViewsBase;
typedef struct _TootleViewsBaseClass TootleViewsBaseClass;

#define TOOTLE_VIEWS_TYPE_TIMELINE (tootle_views_timeline_get_type ())
#define TOOTLE_VIEWS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimeline))
#define TOOTLE_VIEWS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimelineClass))
#define TOOTLE_VIEWS_IS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_VIEWS_TYPE_TIMELINE))
#define TOOTLE_VIEWS_IS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_VIEWS_TYPE_TIMELINE))
#define TOOTLE_VIEWS_TIMELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_VIEWS_TYPE_TIMELINE, TootleViewsTimelineClass))

typedef struct _TootleViewsTimeline TootleViewsTimeline;
typedef struct _TootleViewsTimelineClass TootleViewsTimelineClass;

#define TOOTLE_VIEWS_TYPE_PROFILE (tootle_views_profile_get_type ())
#define TOOTLE_VIEWS_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_VIEWS_TYPE_PROFILE, TootleViewsProfile))
#define TOOTLE_VIEWS_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_VIEWS_TYPE_PROFILE, TootleViewsProfileClass))
#define TOOTLE_VIEWS_IS_PROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_VIEWS_TYPE_PROFILE))
#define TOOTLE_VIEWS_IS_PROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_VIEWS_TYPE_PROFILE))
#define TOOTLE_VIEWS_PROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_VIEWS_TYPE_PROFILE, TootleViewsProfileClass))

typedef struct _TootleViewsProfile TootleViewsProfile;
typedef struct _TootleViewsProfileClass TootleViewsProfileClass;

#define TOOTLE_DIALOGS_TYPE_MAIN_WINDOW (tootle_dialogs_main_window_get_type ())
#define TOOTLE_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindow))
#define TOOTLE_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindowClass))
#define TOOTLE_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW))
#define TOOTLE_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW))
#define TOOTLE_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TOOTLE_DIALOGS_TYPE_MAIN_WINDOW, TootleDialogsMainWindowClass))

typedef struct _TootleDialogsMainWindow TootleDialogsMainWindow;
typedef struct _TootleDialogsMainWindowClass TootleDialogsMainWindowClass;
typedef struct _Block17Data Block17Data;
#define __vala_SoupURI_free0(var) ((var == NULL) ? NULL : (var = (_vala_SoupURI_free (var), NULL)))

typedef enum  {
	TOOTLE_OOPSIE_USER,
	TOOTLE_OOPSIE_PARSING,
	TOOTLE_OOPSIE_INSTANCE,
	TOOTLE_OOPSIE_INTERNAL
} TootleOopsie;
#define TOOTLE_OOPSIE tootle_oopsie_quark ()
struct _TootleWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TootleWidgetizable* self, GError** error);
	void (*open) (TootleWidgetizable* self);
	void (*resolve_open) (TootleWidgetizable* self, TootleInstanceAccount* account);
};

struct _TootleEntity {
	GObject parent_instance;
	TootleEntityPrivate * priv;
};

struct _TootleEntityClass {
	GObjectClass parent_class;
	gboolean (*is_local) (TootleEntity* self, TootleInstanceAccount* account);
};

struct _TootleAPIAccount {
	TootleEntity parent_instance;
	TootleAPIAccountPrivate * priv;
	gchar* _display_name;
};

struct _TootleAPIAccountClass {
	TootleEntityClass parent_class;
};

struct _TootleAPIAccountPrivate {
	gchar* _id;
	gchar* _username;
	gchar* _acct;
	gchar* _note;
	gchar* _header;
	gchar* _avatar;
	gchar* _url;
	gchar* _created_at;
	gint64 _followers_count;
	gint64 _following_count;
	gint64 _statuses_count;
	GeeArrayList* _fields;
};

struct _Block17Data {
	int _ref_count_;
	TootleAPIAccount* self;
	TootleInstanceAccount* account;
};

static gint TootleAPIAccount_private_offset;
static gpointer tootle_api_account_parent_class = NULL;
extern TootleAccounts* tootle_accounts;
extern TootleDialogsMainWindow* tootle_window;
static TootleWidgetizableIface * tootle_api_account_tootle_widgetizable_parent_iface = NULL;

GQuark tootle_oopsie_quark (void);
GType tootle_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleEntity, g_object_unref)
GType tootle_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIAccount, g_object_unref)
GType tootle_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleInstanceAccount, g_object_unref)
GType tootle_widgetizable_get_type (void) G_GNUC_CONST ;
GType tootle_api_account_field_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIAccountField, g_object_unref)
gboolean tootle_entity_is_local (TootleEntity* self,
                                 TootleInstanceAccount* account);
TootleAPIAccount* tootle_api_account_from (JsonNode* node,
                                           GError** error);
TootleEntity* tootle_entity_from_json (GType type,
                                       JsonNode* node,
                                       GError** error);
gboolean tootle_api_account_is_self (TootleAPIAccount* self);
const gchar* tootle_api_account_get_id (TootleAPIAccount* self);
GType tootle_accounts_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAccounts, g_object_unref)
TootleInstanceAccount* tootle_accounts_get_active (TootleAccounts* self);
static gboolean tootle_api_account_real_is_local (TootleEntity* base,
                                           TootleInstanceAccount* account);
const gchar* tootle_api_account_get_url (TootleAPIAccount* self);
gchar* tootle_api_account_get_domain (TootleAPIAccount* self);
static GtkWidget* tootle_api_account_real_to_widget (TootleWidgetizable* base,
                                              GError** error);
GType tootle_api_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleAPIStatus, g_object_unref)
TootleAPIStatus* tootle_api_status_new_from_account (TootleAPIAccount* account);
TootleAPIStatus* tootle_api_status_construct_from_account (GType object_type,
                                                           TootleAPIAccount* account);
GType tootle_api_notification_type_get_type (void) G_GNUC_CONST ;
TootleWidgetsStatus* tootle_widgets_status_new (TootleAPIStatus* status,
                                                TootleAPINotificationType* kind);
TootleWidgetsStatus* tootle_widgets_status_construct (GType object_type,
                                                      TootleAPIStatus* status,
                                                      TootleAPINotificationType* kind);
GType tootle_widgets_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleWidgetsStatus, g_object_unref)
static void tootle_api_account_real_open (TootleWidgetizable* base);
GType tootle_views_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleViewsBase, g_object_unref)
GType tootle_views_timeline_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleViewsTimeline, g_object_unref)
GType tootle_views_profile_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleViewsProfile, g_object_unref)
TootleViewsProfile* tootle_views_profile_new (TootleAPIAccount* acc);
TootleViewsProfile* tootle_views_profile_construct (GType object_type,
                                                    TootleAPIAccount* acc);
GType tootle_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TootleDialogsMainWindow, g_object_unref)
TootleViewsBase* tootle_dialogs_main_window_open_view (TootleDialogsMainWindow* self,
                                                       TootleViewsBase* view);
static void tootle_api_account_real_resolve_open (TootleWidgetizable* base,
                                           TootleInstanceAccount* account);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
void tootle_widgetizable_open (TootleWidgetizable* self);
void tootle_instance_account_resolve (TootleInstanceAccount* self,
                                      const gchar* url,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
TootleEntity* tootle_instance_account_resolve_finish (TootleInstanceAccount* self,
                                                      GAsyncResult* _res_,
                                                      GError** error);
static void ___lambda100_ (Block17Data* _data17_,
                    GObject* obj,
                    GAsyncResult* res);
static void ____lambda100__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
TootleAPIAccount* tootle_api_account_new (void);
TootleAPIAccount* tootle_api_account_construct (GType object_type);
TootleEntity* tootle_entity_new (void);
TootleEntity* tootle_entity_construct (GType object_type);
void tootle_api_account_set_id (TootleAPIAccount* self,
                                const gchar* value);
const gchar* tootle_api_account_get_username (TootleAPIAccount* self);
void tootle_api_account_set_username (TootleAPIAccount* self,
                                      const gchar* value);
const gchar* tootle_api_account_get_acct (TootleAPIAccount* self);
void tootle_api_account_set_acct (TootleAPIAccount* self,
                                  const gchar* value);
const gchar* tootle_api_account_get_display_name (TootleAPIAccount* self);
void tootle_api_account_set_display_name (TootleAPIAccount* self,
                                          const gchar* value);
const gchar* tootle_api_account_get_note (TootleAPIAccount* self);
void tootle_api_account_set_note (TootleAPIAccount* self,
                                  const gchar* value);
const gchar* tootle_api_account_get_header (TootleAPIAccount* self);
void tootle_api_account_set_header (TootleAPIAccount* self,
                                    const gchar* value);
const gchar* tootle_api_account_get_avatar (TootleAPIAccount* self);
void tootle_api_account_set_avatar (TootleAPIAccount* self,
                                    const gchar* value);
void tootle_api_account_set_url (TootleAPIAccount* self,
                                 const gchar* value);
const gchar* tootle_api_account_get_created_at (TootleAPIAccount* self);
void tootle_api_account_set_created_at (TootleAPIAccount* self,
                                        const gchar* value);
gint64 tootle_api_account_get_followers_count (TootleAPIAccount* self);
void tootle_api_account_set_followers_count (TootleAPIAccount* self,
                                             gint64 value);
gint64 tootle_api_account_get_following_count (TootleAPIAccount* self);
void tootle_api_account_set_following_count (TootleAPIAccount* self,
                                             gint64 value);
gint64 tootle_api_account_get_statuses_count (TootleAPIAccount* self);
void tootle_api_account_set_statuses_count (TootleAPIAccount* self,
                                            gint64 value);
GeeArrayList* tootle_api_account_get_fields (TootleAPIAccount* self);
void tootle_api_account_set_fields (TootleAPIAccount* self,
                                    GeeArrayList* value);
gchar* tootle_api_account_get_handle (TootleAPIAccount* self);
static void _vala_SoupURI_free (SoupURI* self);
GtkWidget* tootle_widgetizable_to_widget (TootleWidgetizable* self,
                                          GError** error);
void tootle_widgetizable_resolve_open (TootleWidgetizable* self,
                                       TootleInstanceAccount* account);
static void tootle_api_account_finalize (GObject * obj);
static GType tootle_api_account_get_type_once (void);
static void _vala_tootle_api_account_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_tootle_api_account_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
tootle_api_account_get_instance_private (TootleAPIAccount* self)
{
	return G_STRUCT_MEMBER_P (self, TootleAPIAccount_private_offset);
}

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

TootleAPIAccount*
tootle_api_account_from (JsonNode* node,
                         GError** error)
{
	TootleEntity* _tmp0_ = NULL;
	TootleEntity* _tmp1_;
	TootleAPIAccount* _tmp2_;
	GError* _inner_error0_ = NULL;
	TootleAPIAccount* result = NULL;
	g_return_val_if_fail (node != NULL, NULL);
	_tmp1_ = tootle_entity_from_json (TOOTLE_API_TYPE_ACCOUNT, node, &_inner_error0_);
	_tmp0_ = _tmp1_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return NULL;
	}
	_tmp2_ = _g_object_ref0 (TOOTLE_API_IS_ACCOUNT (_tmp0_) ? ((TootleAPIAccount*) _tmp0_) : NULL);
	result = _tmp2_;
	_g_object_unref0 (_tmp0_);
	return result;
}

gboolean
tootle_api_account_is_self (TootleAPIAccount* self)
{
	const gchar* _tmp0_;
	TootleAccounts* _tmp1_;
	TootleInstanceAccount* _tmp2_;
	TootleInstanceAccount* _tmp3_;
	const gchar* _tmp4_;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_id;
	_tmp1_ = tootle_accounts;
	_tmp2_ = tootle_accounts_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = ((TootleAPIAccount*) _tmp3_)->priv->_id;
	result = g_strcmp0 (_tmp0_, _tmp4_) == 0;
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
tootle_api_account_real_is_local (TootleEntity* base,
                                  TootleInstanceAccount* account)
{
	TootleAPIAccount * self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	gboolean result = FALSE;
	self = (TootleAPIAccount*) base;
	g_return_val_if_fail (account != NULL, FALSE);
	_tmp0_ = self->priv->_url;
	_tmp1_ = tootle_api_account_get_domain ((TootleAPIAccount*) account);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = string_contains (_tmp0_, _tmp3_);
	_g_free0 (_tmp3_);
	result = _tmp4_;
	return result;
}

static GtkWidget*
tootle_api_account_real_to_widget (TootleWidgetizable* base,
                                   GError** error)
{
	TootleAPIAccount * self;
	TootleAPIStatus* status = NULL;
	TootleAPIStatus* _tmp0_;
	TootleAPIStatus* _tmp1_;
	TootleWidgetsStatus* _tmp2_;
	GtkWidget* result = NULL;
	self = (TootleAPIAccount*) base;
	_tmp0_ = tootle_api_status_new_from_account (self);
	status = _tmp0_;
	_tmp1_ = _g_object_ref0 (status);
	_tmp2_ = tootle_widgets_status_new (_tmp1_, NULL);
	g_object_ref_sink (_tmp2_);
	result = (GtkWidget*) _tmp2_;
	_g_object_unref0 (status);
	return result;
}

static void
tootle_api_account_real_open (TootleWidgetizable* base)
{
	TootleAPIAccount * self;
	TootleViewsProfile* view = NULL;
	TootleViewsProfile* _tmp0_;
	TootleDialogsMainWindow* _tmp1_;
	TootleViewsBase* _tmp2_;
	TootleViewsBase* _tmp3_;
	self = (TootleAPIAccount*) base;
	_tmp0_ = tootle_views_profile_new (self);
	g_object_ref_sink (_tmp0_);
	view = _tmp0_;
	_tmp1_ = tootle_window;
	_tmp2_ = tootle_dialogs_main_window_open_view (_tmp1_, (TootleViewsBase*) view);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp3_);
	_g_object_unref0 (view);
}

static Block17Data*
block17_data_ref (Block17Data* _data17_)
{
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}

static void
block17_data_unref (void * _userdata_)
{
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		TootleAPIAccount* self;
		self = _data17_->self;
		_g_object_unref0 (_data17_->account);
		_g_object_unref0 (self);
		g_slice_free (Block17Data, _data17_);
	}
}

static void
___lambda100_ (Block17Data* _data17_,
               GObject* obj,
               GAsyncResult* res)
{
	TootleAPIAccount* self;
	TootleEntity* _tmp0_ = NULL;
	TootleEntity* _tmp1_;
	GError* _inner_error0_ = NULL;
	self = _data17_->self;
	g_return_if_fail (res != NULL);
	_tmp1_ = tootle_instance_account_resolve_finish (_data17_->account, res, &_inner_error0_);
	_tmp0_ = _tmp1_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	tootle_widgetizable_open ((TootleWidgetizable*) _tmp0_);
	_g_object_unref0 (_tmp0_);
}

static void
____lambda100__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda100_ (self, source_object, res);
	block17_data_unref (self);
}

static void
tootle_api_account_real_resolve_open (TootleWidgetizable* base,
                                      TootleInstanceAccount* account)
{
	TootleAPIAccount * self;
	Block17Data* _data17_;
	TootleInstanceAccount* _tmp0_;
	self = (TootleAPIAccount*) base;
	g_return_if_fail (account != NULL);
	_data17_ = g_slice_new0 (Block17Data);
	_data17_->_ref_count_ = 1;
	_data17_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (account);
	_g_object_unref0 (_data17_->account);
	_data17_->account = _tmp0_;
	if (tootle_entity_is_local ((TootleEntity*) self, _data17_->account)) {
		tootle_widgetizable_open ((TootleWidgetizable*) self);
	} else {
		const gchar* _tmp1_;
		_tmp1_ = self->priv->_url;
		tootle_instance_account_resolve (_data17_->account, _tmp1_, ____lambda100__gasync_ready_callback, block17_data_ref (_data17_));
	}
	block17_data_unref (_data17_);
	_data17_ = NULL;
}

TootleAPIAccount*
tootle_api_account_construct (GType object_type)
{
	TootleAPIAccount * self = NULL;
	self = (TootleAPIAccount*) tootle_entity_construct (object_type);
	return self;
}

TootleAPIAccount*
tootle_api_account_new (void)
{
	return tootle_api_account_construct (TOOTLE_API_TYPE_ACCOUNT);
}

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

void
tootle_api_account_set_id (TootleAPIAccount* self,
                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_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, tootle_api_account_properties[TOOTLE_API_ACCOUNT_ID_PROPERTY]);
	}
}

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

void
tootle_api_account_set_username (TootleAPIAccount* self,
                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_username (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_username);
		self->priv->_username = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_USERNAME_PROPERTY]);
	}
}

const gchar*
tootle_api_account_get_acct (TootleAPIAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_acct;
	result = _tmp0_;
	return result;
}

void
tootle_api_account_set_acct (TootleAPIAccount* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_acct (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_acct);
		self->priv->_acct = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_ACCT_PROPERTY]);
	}
}

const gchar*
tootle_api_account_get_display_name (TootleAPIAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	const gchar* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp2_ = self->_display_name;
	if (_tmp2_ == NULL) {
		_tmp1_ = TRUE;
	} else {
		const gchar* _tmp3_;
		_tmp3_ = self->_display_name;
		_tmp1_ = g_strcmp0 (_tmp3_, "") == 0;
	}
	if (_tmp1_) {
		const gchar* _tmp4_;
		_tmp4_ = self->priv->_username;
		_tmp0_ = _tmp4_;
	} else {
		const gchar* _tmp5_;
		_tmp5_ = self->_display_name;
		_tmp0_ = _tmp5_;
	}
	result = _tmp0_;
	return result;
}

void
tootle_api_account_set_display_name (TootleAPIAccount* self,
                                     const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->_display_name);
	self->_display_name = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_DISPLAY_NAME_PROPERTY]);
}

const gchar*
tootle_api_account_get_note (TootleAPIAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_note;
	result = _tmp0_;
	return result;
}

void
tootle_api_account_set_note (TootleAPIAccount* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_note (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_note);
		self->priv->_note = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_NOTE_PROPERTY]);
	}
}

const gchar*
tootle_api_account_get_header (TootleAPIAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_header;
	result = _tmp0_;
	return result;
}

void
tootle_api_account_set_header (TootleAPIAccount* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_header (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_header);
		self->priv->_header = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_HEADER_PROPERTY]);
	}
}

const gchar*
tootle_api_account_get_avatar (TootleAPIAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_avatar;
	result = _tmp0_;
	return result;
}

void
tootle_api_account_set_avatar (TootleAPIAccount* self,
                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_avatar (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_avatar);
		self->priv->_avatar = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_AVATAR_PROPERTY]);
	}
}

const gchar*
tootle_api_account_get_url (TootleAPIAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url;
	result = _tmp0_;
	return result;
}

void
tootle_api_account_set_url (TootleAPIAccount* self,
                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_url (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_url);
		self->priv->_url = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_URL_PROPERTY]);
	}
}

const gchar*
tootle_api_account_get_created_at (TootleAPIAccount* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_created_at;
	result = _tmp0_;
	return result;
}

void
tootle_api_account_set_created_at (TootleAPIAccount* self,
                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_created_at (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_created_at);
		self->priv->_created_at = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_CREATED_AT_PROPERTY]);
	}
}

gint64
tootle_api_account_get_followers_count (TootleAPIAccount* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	result = self->priv->_followers_count;
	return result;
}

void
tootle_api_account_set_followers_count (TootleAPIAccount* self,
                                        gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_followers_count (self);
	if (old_value != value) {
		self->priv->_followers_count = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_FOLLOWERS_COUNT_PROPERTY]);
	}
}

gint64
tootle_api_account_get_following_count (TootleAPIAccount* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	result = self->priv->_following_count;
	return result;
}

void
tootle_api_account_set_following_count (TootleAPIAccount* self,
                                        gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_following_count (self);
	if (old_value != value) {
		self->priv->_following_count = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_FOLLOWING_COUNT_PROPERTY]);
	}
}

gint64
tootle_api_account_get_statuses_count (TootleAPIAccount* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, 0LL);
	result = self->priv->_statuses_count;
	return result;
}

void
tootle_api_account_set_statuses_count (TootleAPIAccount* self,
                                       gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_statuses_count (self);
	if (old_value != value) {
		self->priv->_statuses_count = value;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_STATUSES_COUNT_PROPERTY]);
	}
}

GeeArrayList*
tootle_api_account_get_fields (TootleAPIAccount* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_fields;
	result = _tmp0_;
	return result;
}

void
tootle_api_account_set_fields (TootleAPIAccount* self,
                               GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = tootle_api_account_get_fields (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_fields);
		self->priv->_fields = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tootle_api_account_properties[TOOTLE_API_ACCOUNT_FIELDS_PROPERTY]);
	}
}

gchar*
tootle_api_account_get_handle (TootleAPIAccount* self)
{
	gchar* result;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_acct;
	_tmp1_ = g_strconcat ("@", _tmp0_, NULL);
	result = _tmp1_;
	return result;
}

static void
_vala_SoupURI_free (SoupURI* self)
{
	g_boxed_free (soup_uri_get_type (), self);
}

gchar*
tootle_api_account_get_domain (TootleAPIAccount* self)
{
	gchar* result;
	SoupURI* uri = NULL;
	const gchar* _tmp0_;
	SoupURI* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_url;
	_tmp1_ = soup_uri_new (_tmp0_);
	uri = _tmp1_;
	_tmp2_ = soup_uri_get_host (uri);
	_tmp3_ = g_strdup (_tmp2_);
	result = _tmp3_;
	__vala_SoupURI_free0 (uri);
	return result;
}

static void
tootle_api_account_class_init (TootleAPIAccountClass * klass,
                               gpointer klass_data)
{
	tootle_api_account_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TootleAPIAccount_private_offset);
	((TootleEntityClass *) klass)->is_local = (gboolean (*) (TootleEntity*, TootleInstanceAccount*)) tootle_api_account_real_is_local;
	G_OBJECT_CLASS (klass)->get_property = _vala_tootle_api_account_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tootle_api_account_set_property;
	G_OBJECT_CLASS (klass)->finalize = tootle_api_account_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_ID_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_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), TOOTLE_API_ACCOUNT_USERNAME_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_USERNAME_PROPERTY] = g_param_spec_string ("username", "username", "username", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_ACCT_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_ACCT_PROPERTY] = g_param_spec_string ("acct", "acct", "acct", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_DISPLAY_NAME_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_DISPLAY_NAME_PROPERTY] = g_param_spec_string ("display-name", "display-name", "display-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_NOTE_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_NOTE_PROPERTY] = g_param_spec_string ("note", "note", "note", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_HEADER_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_HEADER_PROPERTY] = g_param_spec_string ("header", "header", "header", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_AVATAR_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_AVATAR_PROPERTY] = g_param_spec_string ("avatar", "avatar", "avatar", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_URL_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_URL_PROPERTY] = g_param_spec_string ("url", "url", "url", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_CREATED_AT_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_CREATED_AT_PROPERTY] = g_param_spec_string ("created-at", "created-at", "created-at", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_FOLLOWERS_COUNT_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_FOLLOWERS_COUNT_PROPERTY] = g_param_spec_int64 ("followers-count", "followers-count", "followers-count", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_FOLLOWING_COUNT_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_FOLLOWING_COUNT_PROPERTY] = g_param_spec_int64 ("following-count", "following-count", "following-count", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_STATUSES_COUNT_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_STATUSES_COUNT_PROPERTY] = g_param_spec_int64 ("statuses-count", "statuses-count", "statuses-count", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_FIELDS_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_FIELDS_PROPERTY] = g_param_spec_object ("fields", "fields", "fields", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_HANDLE_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_HANDLE_PROPERTY] = g_param_spec_string ("handle", "handle", "handle", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TOOTLE_API_ACCOUNT_DOMAIN_PROPERTY, tootle_api_account_properties[TOOTLE_API_ACCOUNT_DOMAIN_PROPERTY] = g_param_spec_string ("domain", "domain", "domain", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tootle_api_account_tootle_widgetizable_interface_init (TootleWidgetizableIface * iface,
                                                       gpointer iface_data)
{
	tootle_api_account_tootle_widgetizable_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_widget = (GtkWidget* (*) (TootleWidgetizable*, GError**)) tootle_api_account_real_to_widget;
	iface->open = (void (*) (TootleWidgetizable*)) tootle_api_account_real_open;
	iface->resolve_open = (void (*) (TootleWidgetizable*, TootleInstanceAccount*)) tootle_api_account_real_resolve_open;
}

static void
tootle_api_account_instance_init (TootleAPIAccount * self,
                                  gpointer klass)
{
	self->priv = tootle_api_account_get_instance_private (self);
	self->_display_name = NULL;
	self->priv->_fields = NULL;
}

static void
tootle_api_account_finalize (GObject * obj)
{
	TootleAPIAccount * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccount);
	_g_free0 (self->priv->_id);
	_g_free0 (self->priv->_username);
	_g_free0 (self->priv->_acct);
	_g_free0 (self->_display_name);
	_g_free0 (self->priv->_note);
	_g_free0 (self->priv->_header);
	_g_free0 (self->priv->_avatar);
	_g_free0 (self->priv->_url);
	_g_free0 (self->priv->_created_at);
	_g_object_unref0 (self->priv->_fields);
	G_OBJECT_CLASS (tootle_api_account_parent_class)->finalize (obj);
}

static GType
tootle_api_account_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TootleAPIAccountClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tootle_api_account_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TootleAPIAccount), 0, (GInstanceInitFunc) tootle_api_account_instance_init, NULL };
	static const GInterfaceInfo tootle_widgetizable_info = { (GInterfaceInitFunc) tootle_api_account_tootle_widgetizable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tootle_api_account_type_id;
	tootle_api_account_type_id = g_type_register_static (TOOTLE_TYPE_ENTITY, "TootleAPIAccount", &g_define_type_info, 0);
	g_type_add_interface_static (tootle_api_account_type_id, TOOTLE_TYPE_WIDGETIZABLE, &tootle_widgetizable_info);
	TootleAPIAccount_private_offset = g_type_add_instance_private (tootle_api_account_type_id, sizeof (TootleAPIAccountPrivate));
	return tootle_api_account_type_id;
}

GType
tootle_api_account_get_type (void)
{
	static volatile gsize tootle_api_account_type_id__volatile = 0;
	if (g_once_init_enter (&tootle_api_account_type_id__volatile)) {
		GType tootle_api_account_type_id;
		tootle_api_account_type_id = tootle_api_account_get_type_once ();
		g_once_init_leave (&tootle_api_account_type_id__volatile, tootle_api_account_type_id);
	}
	return tootle_api_account_type_id__volatile;
}

static void
_vala_tootle_api_account_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	TootleAPIAccount * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccount);
	switch (property_id) {
		case TOOTLE_API_ACCOUNT_ID_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_id (self));
		break;
		case TOOTLE_API_ACCOUNT_USERNAME_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_username (self));
		break;
		case TOOTLE_API_ACCOUNT_ACCT_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_acct (self));
		break;
		case TOOTLE_API_ACCOUNT_DISPLAY_NAME_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_display_name (self));
		break;
		case TOOTLE_API_ACCOUNT_NOTE_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_note (self));
		break;
		case TOOTLE_API_ACCOUNT_HEADER_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_header (self));
		break;
		case TOOTLE_API_ACCOUNT_AVATAR_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_avatar (self));
		break;
		case TOOTLE_API_ACCOUNT_URL_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_url (self));
		break;
		case TOOTLE_API_ACCOUNT_CREATED_AT_PROPERTY:
		g_value_set_string (value, tootle_api_account_get_created_at (self));
		break;
		case TOOTLE_API_ACCOUNT_FOLLOWERS_COUNT_PROPERTY:
		g_value_set_int64 (value, tootle_api_account_get_followers_count (self));
		break;
		case TOOTLE_API_ACCOUNT_FOLLOWING_COUNT_PROPERTY:
		g_value_set_int64 (value, tootle_api_account_get_following_count (self));
		break;
		case TOOTLE_API_ACCOUNT_STATUSES_COUNT_PROPERTY:
		g_value_set_int64 (value, tootle_api_account_get_statuses_count (self));
		break;
		case TOOTLE_API_ACCOUNT_FIELDS_PROPERTY:
		g_value_set_object (value, tootle_api_account_get_fields (self));
		break;
		case TOOTLE_API_ACCOUNT_HANDLE_PROPERTY:
		g_value_take_string (value, tootle_api_account_get_handle (self));
		break;
		case TOOTLE_API_ACCOUNT_DOMAIN_PROPERTY:
		g_value_take_string (value, tootle_api_account_get_domain (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tootle_api_account_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	TootleAPIAccount * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TOOTLE_API_TYPE_ACCOUNT, TootleAPIAccount);
	switch (property_id) {
		case TOOTLE_API_ACCOUNT_ID_PROPERTY:
		tootle_api_account_set_id (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_USERNAME_PROPERTY:
		tootle_api_account_set_username (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_ACCT_PROPERTY:
		tootle_api_account_set_acct (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_DISPLAY_NAME_PROPERTY:
		tootle_api_account_set_display_name (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_NOTE_PROPERTY:
		tootle_api_account_set_note (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_HEADER_PROPERTY:
		tootle_api_account_set_header (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_AVATAR_PROPERTY:
		tootle_api_account_set_avatar (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_URL_PROPERTY:
		tootle_api_account_set_url (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_CREATED_AT_PROPERTY:
		tootle_api_account_set_created_at (self, g_value_get_string (value));
		break;
		case TOOTLE_API_ACCOUNT_FOLLOWERS_COUNT_PROPERTY:
		tootle_api_account_set_followers_count (self, g_value_get_int64 (value));
		break;
		case TOOTLE_API_ACCOUNT_FOLLOWING_COUNT_PROPERTY:
		tootle_api_account_set_following_count (self, g_value_get_int64 (value));
		break;
		case TOOTLE_API_ACCOUNT_STATUSES_COUNT_PROPERTY:
		tootle_api_account_set_statuses_count (self, g_value_get_int64 (value));
		break;
		case TOOTLE_API_ACCOUNT_FIELDS_PROPERTY:
		tootle_api_account_set_fields (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

