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

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;

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

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

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

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

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

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

#define TUBA_API_TYPE_ANNOUNCEMENT (tuba_api_announcement_get_type ())
#define TUBA_API_ANNOUNCEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncement))
#define TUBA_API_ANNOUNCEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncementClass))
#define TUBA_API_IS_ANNOUNCEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ANNOUNCEMENT))
#define TUBA_API_IS_ANNOUNCEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ANNOUNCEMENT))
#define TUBA_API_ANNOUNCEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncementClass))

typedef struct _TubaAPIAnnouncement TubaAPIAnnouncement;
typedef struct _TubaAPIAnnouncementClass TubaAPIAnnouncementClass;
typedef struct _TubaAPIAnnouncementPrivate TubaAPIAnnouncementPrivate;

#define TUBA_API_TYPE_EMOJI (tuba_api_emoji_get_type ())
#define TUBA_API_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_EMOJI, TubaAPIEmoji))
#define TUBA_API_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_EMOJI, TubaAPIEmojiClass))
#define TUBA_API_IS_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_EMOJI))
#define TUBA_API_IS_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_EMOJI))
#define TUBA_API_EMOJI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_EMOJI, TubaAPIEmojiClass))

typedef struct _TubaAPIEmoji TubaAPIEmoji;
typedef struct _TubaAPIEmojiClass TubaAPIEmojiClass;

#define TUBA_API_TYPE_EMOJI_REACTION (tuba_api_emoji_reaction_get_type ())
#define TUBA_API_EMOJI_REACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReaction))
#define TUBA_API_EMOJI_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReactionClass))
#define TUBA_API_IS_EMOJI_REACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_EMOJI_REACTION))
#define TUBA_API_IS_EMOJI_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_EMOJI_REACTION))
#define TUBA_API_EMOJI_REACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReactionClass))

typedef struct _TubaAPIEmojiReaction TubaAPIEmojiReaction;
typedef struct _TubaAPIEmojiReactionClass TubaAPIEmojiReactionClass;
enum  {
	TUBA_API_ANNOUNCEMENT_0_PROPERTY,
	TUBA_API_ANNOUNCEMENT_ID_PROPERTY,
	TUBA_API_ANNOUNCEMENT_CONTENT_PROPERTY,
	TUBA_API_ANNOUNCEMENT_PUBLISHED_PROPERTY,
	TUBA_API_ANNOUNCEMENT_PUBLISHED_AT_PROPERTY,
	TUBA_API_ANNOUNCEMENT_UPDATED_AT_PROPERTY,
	TUBA_API_ANNOUNCEMENT_READ_PROPERTY,
	TUBA_API_ANNOUNCEMENT_EMOJIS_PROPERTY,
	TUBA_API_ANNOUNCEMENT_REACTIONS_PROPERTY,
	TUBA_API_ANNOUNCEMENT_EMOJIS_MAP_PROPERTY,
	TUBA_API_ANNOUNCEMENT_NUM_PROPERTIES
};
static GParamSpec* tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_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)))
typedef struct _Block7Data Block7Data;

#define TUBA_WIDGETS_TYPE_ANNOUNCEMENT (tuba_widgets_announcement_get_type ())
#define TUBA_WIDGETS_ANNOUNCEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_ANNOUNCEMENT, TubaWidgetsAnnouncement))
#define TUBA_WIDGETS_ANNOUNCEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_ANNOUNCEMENT, TubaWidgetsAnnouncementClass))
#define TUBA_WIDGETS_IS_ANNOUNCEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_ANNOUNCEMENT))
#define TUBA_WIDGETS_IS_ANNOUNCEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_ANNOUNCEMENT))
#define TUBA_WIDGETS_ANNOUNCEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_ANNOUNCEMENT, TubaWidgetsAnnouncementClass))

typedef struct _TubaWidgetsAnnouncement TubaWidgetsAnnouncement;
typedef struct _TubaWidgetsAnnouncementClass TubaWidgetsAnnouncementClass;

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

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

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#define TUBA_TYPE_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_TYPE_OOPSIE (tuba_oopsie_get_type ())

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

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;

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

typedef struct _TubaDialogsMainWindow TubaDialogsMainWindow;
typedef struct _TubaDialogsMainWindowClass TubaDialogsMainWindowClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaApiAnnouncementOpenRealData TubaApiAnnouncementOpenRealData;

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

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

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

struct _TubaAPIAnnouncement {
	TubaEntity parent_instance;
	TubaAPIAnnouncementPrivate * priv;
};

struct _TubaAPIAnnouncementClass {
	TubaEntityClass parent_class;
};

struct _TubaAPIAnnouncementPrivate {
	gchar* _id;
	gchar* _content;
	gboolean _published;
	gchar* _published_at;
	gchar* _updated_at;
	gboolean _read;
	GeeArrayList* _emojis;
	GeeArrayList* _reactions;
};

struct _Block7Data {
	int _ref_count_;
	TubaAPIAnnouncement* self;
	GeeHashMap* res;
};

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 _TubaApiAnnouncementOpenRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaAPIAnnouncement* self;
	TubaRequestV2* req;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	TubaAccountStore* _tmp4_;
	TubaInstanceAccount* _tmp5_;
	TubaInstanceAccount* _tmp6_;
	TubaInstanceAccount* _tmp7_;
	TubaRequestV2* _tmp8_;
	TubaRequestV2* _tmp9_;
	TubaRequestV2* _tmp10_;
	GInputStream* _tmp11_;
	GInputStream* _tmp12_;
	GError* e;
	GError* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	GError* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	AdwAlertDialog* dlg;
	TubaApplication* _tmp21_;
	GError* _tmp22_;
	const gchar* _tmp23_;
	AdwAlertDialog* _tmp24_;
	AdwAlertDialog* _tmp25_;
	TubaApplication* _tmp26_;
	TubaDialogsMainWindow* _tmp27_;
	TubaDialogsMainWindow* _tmp28_;
	GError* _inner_error0_;
};

static gint TubaAPIAnnouncement_private_offset;
static gpointer tuba_api_announcement_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaApplication* tuba_app;
static TubaWidgetizableIface * tuba_api_announcement_tuba_widgetizable_parent_iface = NULL;

VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GType tuba_api_announcement_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAnnouncement, g_object_unref)
VALA_EXTERN GType tuba_api_emoji_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmoji, g_object_unref)
VALA_EXTERN GType tuba_api_emoji_reaction_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmojiReaction, g_object_unref)
VALA_EXTERN GType tuba_entity_deserialize_array_type (TubaEntity* self,
                                          const gchar* prop);
static GType tuba_api_announcement_real_deserialize_array_type (TubaEntity* base,
                                                         const gchar* prop);
static GeeHashMap* tuba_api_announcement_gen_emojis_map (TubaAPIAnnouncement* self);
static Block7Data* block7_data_ref (Block7Data* _data7_);
static void block7_data_unref (void * _userdata_);
VALA_EXTERN GeeArrayList* tuba_api_announcement_get_emojis (TubaAPIAnnouncement* self);
static gboolean ___lambda103_ (Block7Data* _data7_,
                        TubaAPIEmoji* e);
VALA_EXTERN const gchar* tuba_api_emoji_get_shortcode (TubaAPIEmoji* self);
VALA_EXTERN const gchar* tuba_api_emoji_get_url (TubaAPIEmoji* self);
static gboolean ____lambda103__gee_forall_func (gpointer g,
                                         gpointer self);
static GtkWidget* tuba_api_announcement_real_to_widget (TubaWidgetizable* base);
VALA_EXTERN TubaWidgetsAnnouncement* tuba_widgets_announcement_new (TubaAPIAnnouncement* t_announcement);
VALA_EXTERN TubaWidgetsAnnouncement* tuba_widgets_announcement_construct (GType object_type,
                                                              TubaAPIAnnouncement* t_announcement);
VALA_EXTERN GType tuba_widgets_announcement_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAnnouncement, g_object_unref)
static void tuba_api_announcement_real_open (TubaWidgetizable* base);
VALA_EXTERN gboolean tuba_api_announcement_get_read (TubaAPIAnnouncement* self);
static void tuba_api_announcement_open_real (TubaAPIAnnouncement* self,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
static void tuba_api_announcement_open_real_finish (TubaAPIAnnouncement* self,
                                             GAsyncResult* _res_);
static void tuba_api_announcement_open_real_data_free (gpointer _data);
static gboolean tuba_api_announcement_open_real_co (TubaApiAnnouncementOpenRealData* _data_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN const gchar* tuba_api_announcement_get_id (TubaAPIAnnouncement* self);
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_api_announcement_open_real_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
VALA_EXTERN void tuba_api_announcement_set_read (TubaAPIAnnouncement* self,
                                     gboolean value);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
VALA_EXTERN AdwAlertDialog* tuba_application_inform (TubaApplication* self,
                                         const gchar* text,
                                         const gchar* msg);
VALA_EXTERN GType tuba_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsMainWindow, g_object_unref)
VALA_EXTERN TubaDialogsMainWindow* tuba_application_get_main_window (TubaApplication* self);
VALA_EXTERN TubaAPIAnnouncement* tuba_api_announcement_new (void);
VALA_EXTERN TubaAPIAnnouncement* tuba_api_announcement_construct (GType object_type);
VALA_EXTERN TubaEntity* tuba_entity_new (void);
VALA_EXTERN TubaEntity* tuba_entity_construct (GType object_type);
VALA_EXTERN void tuba_api_announcement_set_id (TubaAPIAnnouncement* self,
                                   const gchar* value);
VALA_EXTERN const gchar* tuba_api_announcement_get_content (TubaAPIAnnouncement* self);
VALA_EXTERN void tuba_api_announcement_set_content (TubaAPIAnnouncement* self,
                                        const gchar* value);
VALA_EXTERN gboolean tuba_api_announcement_get_published (TubaAPIAnnouncement* self);
VALA_EXTERN void tuba_api_announcement_set_published (TubaAPIAnnouncement* self,
                                          gboolean value);
VALA_EXTERN const gchar* tuba_api_announcement_get_published_at (TubaAPIAnnouncement* self);
VALA_EXTERN void tuba_api_announcement_set_published_at (TubaAPIAnnouncement* self,
                                             const gchar* value);
VALA_EXTERN const gchar* tuba_api_announcement_get_updated_at (TubaAPIAnnouncement* self);
VALA_EXTERN void tuba_api_announcement_set_updated_at (TubaAPIAnnouncement* self,
                                           const gchar* value);
VALA_EXTERN void tuba_api_announcement_set_emojis (TubaAPIAnnouncement* self,
                                       GeeArrayList* value);
VALA_EXTERN GeeArrayList* tuba_api_announcement_get_reactions (TubaAPIAnnouncement* self);
VALA_EXTERN void tuba_api_announcement_set_reactions (TubaAPIAnnouncement* self,
                                          GeeArrayList* value);
VALA_EXTERN GeeHashMap* tuba_api_announcement_get_emojis_map (TubaAPIAnnouncement* self);
VALA_EXTERN GtkWidget* tuba_widgetizable_to_widget (TubaWidgetizable* self);
VALA_EXTERN void tuba_widgetizable_open (TubaWidgetizable* self);
static void tuba_api_announcement_finalize (GObject * obj);
static GType tuba_api_announcement_get_type_once (void);
static void _vala_tuba_api_announcement_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_tuba_api_announcement_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
tuba_api_announcement_get_instance_private (TubaAPIAnnouncement* self)
{
	return G_STRUCT_MEMBER_P (self, TubaAPIAnnouncement_private_offset);
}

static GType
tuba_api_announcement_real_deserialize_array_type (TubaEntity* base,
                                                   const gchar* prop)
{
	TubaAPIAnnouncement * self;
	const gchar* _tmp0_;
	GQuark _tmp2_ = 0U;
	static GQuark _tmp1_label0 = 0;
	static GQuark _tmp1_label1 = 0;
	GType result;
	self = (TubaAPIAnnouncement*) base;
	g_return_val_if_fail (prop != NULL, G_TYPE_INVALID);
	_tmp0_ = prop;
	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("reactions")))) {
		switch (0) {
			default:
			{
				result = TUBA_API_TYPE_EMOJI_REACTION;
				return result;
			}
		}
	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("emojis")))) {
		switch (0) {
			default:
			{
				result = TUBA_API_TYPE_EMOJI;
				return result;
			}
		}
	}
	result = TUBA_ENTITY_CLASS (tuba_api_announcement_parent_class)->deserialize_array_type (G_TYPE_CHECK_INSTANCE_CAST (self, TUBA_TYPE_ENTITY, TubaEntity), prop);
	return result;
}

static Block7Data*
block7_data_ref (Block7Data* _data7_)
{
	g_atomic_int_inc (&_data7_->_ref_count_);
	return _data7_;
}

static void
block7_data_unref (void * _userdata_)
{
	Block7Data* _data7_;
	_data7_ = (Block7Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
		TubaAPIAnnouncement* self;
		self = _data7_->self;
		_g_object_unref0 (_data7_->res);
		_g_object_unref0 (self);
		g_slice_free (Block7Data, _data7_);
	}
}

static gboolean
___lambda103_ (Block7Data* _data7_,
               TubaAPIEmoji* e)
{
	TubaAPIAnnouncement* self;
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gboolean result;
	self = _data7_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = _data7_->res;
	_tmp1_ = tuba_api_emoji_get_shortcode (e);
	_tmp2_ = _tmp1_;
	_tmp3_ = tuba_api_emoji_get_url (e);
	_tmp4_ = _tmp3_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, _tmp4_);
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
____lambda103__gee_forall_func (gpointer g,
                                gpointer self)
{
	gboolean result;
	result = ___lambda103_ (self, (TubaAPIEmoji*) g);
	return result;
}

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

static GeeHashMap*
tuba_api_announcement_gen_emojis_map (TubaAPIAnnouncement* self)
{
	Block7Data* _data7_;
	GeeHashMap* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GeeArrayList* _tmp2_;
	GeeHashMap* _tmp7_;
	GeeHashMap* _tmp8_;
	GeeHashMap* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data7_ = g_slice_new0 (Block7Data);
	_data7_->_ref_count_ = 1;
	_data7_->self = g_object_ref (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_data7_->res = _tmp0_;
	_tmp2_ = self->priv->_emojis;
	if (_tmp2_ != NULL) {
		GeeArrayList* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		_tmp3_ = self->priv->_emojis;
		_tmp4_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ > 0;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		GeeArrayList* _tmp6_;
		_tmp6_ = self->priv->_emojis;
		gee_abstract_collection_foreach ((GeeAbstractCollection*) _tmp6_, ____lambda103__gee_forall_func, _data7_);
	}
	_tmp7_ = _data7_->res;
	_tmp8_ = _g_object_ref0 (_tmp7_);
	result = _tmp8_;
	block7_data_unref (_data7_);
	_data7_ = NULL;
	return result;
}

static GtkWidget*
tuba_api_announcement_real_to_widget (TubaWidgetizable* base)
{
	TubaAPIAnnouncement * self;
	TubaWidgetsAnnouncement* _tmp0_;
	GtkWidget* result;
	self = (TubaAPIAnnouncement*) base;
	_tmp0_ = tuba_widgets_announcement_new (self);
	g_object_ref_sink (_tmp0_);
	result = (GtkWidget*) _tmp0_;
	return result;
}

static void
tuba_api_announcement_real_open (TubaWidgetizable* base)
{
	TubaAPIAnnouncement * self;
	gboolean _tmp0_;
	self = (TubaAPIAnnouncement*) base;
	_tmp0_ = self->priv->_read;
	if (_tmp0_) {
		return;
	}
	tuba_api_announcement_open_real (self, NULL, NULL);
}

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

static void
tuba_api_announcement_open_real (TubaAPIAnnouncement* self,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	TubaApiAnnouncementOpenRealData* _data_;
	TubaAPIAnnouncement* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaApiAnnouncementOpenRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_api_announcement_open_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_api_announcement_open_real_co (_data_);
}

static void
tuba_api_announcement_open_real_finish (TubaAPIAnnouncement* self,
                                        GAsyncResult* _res_)
{
	TubaApiAnnouncementOpenRealData* _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_api_announcement_open_real_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	TubaApiAnnouncementOpenRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_api_announcement_open_real_co (_data_);
}

static gboolean
tuba_api_announcement_open_real_co (TubaApiAnnouncementOpenRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_id;
	_data_->_tmp1_ = string_to_string (_data_->_tmp0_);
	_data_->_tmp2_ = g_strconcat ("/api/v1/announcements/", _data_->_tmp1_, "/dismiss", NULL);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = tuba_accounts;
	_data_->_tmp5_ = tuba_account_store_get_active (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _g_object_ref0 (_data_->_tmp6_);
	_data_->_tmp8_ = NULL;
	_data_->_tmp8_ = tuba_request_v2_new (_data_->_tmp3_, TUBA_REQUEST_V2_METHOD_POST);
	tuba_request_v2_set_account (_data_->_tmp8_, _data_->_tmp7_);
	_g_object_unref0 (_data_->_tmp7_);
	_data_->_tmp9_ = _data_->_tmp8_;
	_g_free0 (_data_->_tmp3_);
	_data_->req = _data_->_tmp9_;
	{
		_data_->_tmp10_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp10_, tuba_api_announcement_open_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp11_ = tuba_request_v2_exec_finish (_data_->_tmp10_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_g_object_unref0 (_data_->_tmp12_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch0_g_io_error_cancelled;
			}
			goto __catch0_g_error;
		}
		tuba_api_announcement_set_read (_data_->self, TRUE);
	}
	goto __finally0;
	__catch0_g_io_error_cancelled:
	{
		g_clear_error (&_data_->_inner_error0_);
		g_debug ("Announcement.vala:56: Message is cancelled.");
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp13_ = _data_->e;
		_data_->_tmp14_ = g_strdup_printf ("%i", _data_->_tmp13_->code);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = _data_->e;
		_data_->_tmp17_ = _data_->_tmp16_->message;
		_data_->_tmp18_ = string_to_string (_data_->_tmp17_);
		_data_->_tmp19_ = g_strconcat ("Error while dismissing announcement: ", _data_->_tmp15_, " ", _data_->_tmp18_, NULL);
		_data_->_tmp20_ = _data_->_tmp19_;
		g_warning ("Announcement.vala:58: %s", _data_->_tmp20_);
		_g_free0 (_data_->_tmp20_);
		_g_free0 (_data_->_tmp15_);
		_data_->_tmp21_ = tuba_app;
		_data_->_tmp22_ = _data_->e;
		_data_->_tmp23_ = _data_->_tmp22_->message;
		_data_->_tmp24_ = tuba_application_inform (_data_->_tmp21_, _ ("Error"), _data_->_tmp23_);
		_data_->dlg = _data_->_tmp24_;
		_data_->_tmp25_ = _data_->dlg;
		_data_->_tmp26_ = tuba_app;
		_data_->_tmp27_ = tuba_application_get_main_window (_data_->_tmp26_);
		_data_->_tmp28_ = _data_->_tmp27_;
		adw_dialog_present ((AdwDialog*) _data_->_tmp25_, (GtkWidget*) _data_->_tmp28_);
		_g_object_unref0 (_data_->dlg);
		_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;
}

TubaAPIAnnouncement*
tuba_api_announcement_construct (GType object_type)
{
	TubaAPIAnnouncement * self = NULL;
	self = (TubaAPIAnnouncement*) tuba_entity_construct (object_type);
	return self;
}

TubaAPIAnnouncement*
tuba_api_announcement_new (void)
{
	return tuba_api_announcement_construct (TUBA_API_TYPE_ANNOUNCEMENT);
}

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

void
tuba_api_announcement_set_id (TubaAPIAnnouncement* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_announcement_get_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_ID_PROPERTY]);
	}
}

const gchar*
tuba_api_announcement_get_content (TubaAPIAnnouncement* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_content;
	result = _tmp0_;
	return result;
}

void
tuba_api_announcement_set_content (TubaAPIAnnouncement* self,
                                   const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_announcement_get_content (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_content);
		self->priv->_content = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_CONTENT_PROPERTY]);
	}
}

gboolean
tuba_api_announcement_get_published (TubaAPIAnnouncement* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_published;
	return result;
}

void
tuba_api_announcement_set_published (TubaAPIAnnouncement* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_announcement_get_published (self);
	if (old_value != value) {
		self->priv->_published = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_PUBLISHED_PROPERTY]);
	}
}

const gchar*
tuba_api_announcement_get_published_at (TubaAPIAnnouncement* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_published_at;
	result = _tmp0_;
	return result;
}

void
tuba_api_announcement_set_published_at (TubaAPIAnnouncement* self,
                                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_announcement_get_published_at (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_published_at);
		self->priv->_published_at = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_PUBLISHED_AT_PROPERTY]);
	}
}

const gchar*
tuba_api_announcement_get_updated_at (TubaAPIAnnouncement* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_updated_at;
	result = _tmp0_;
	return result;
}

void
tuba_api_announcement_set_updated_at (TubaAPIAnnouncement* self,
                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_announcement_get_updated_at (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_updated_at);
		self->priv->_updated_at = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_UPDATED_AT_PROPERTY]);
	}
}

gboolean
tuba_api_announcement_get_read (TubaAPIAnnouncement* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_read;
	return result;
}

void
tuba_api_announcement_set_read (TubaAPIAnnouncement* self,
                                gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_announcement_get_read (self);
	if (old_value != value) {
		self->priv->_read = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_READ_PROPERTY]);
	}
}

GeeArrayList*
tuba_api_announcement_get_emojis (TubaAPIAnnouncement* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_emojis;
	result = _tmp0_;
	return result;
}

void
tuba_api_announcement_set_emojis (TubaAPIAnnouncement* self,
                                  GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_announcement_get_emojis (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_emojis);
		self->priv->_emojis = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_EMOJIS_PROPERTY]);
	}
}

GeeArrayList*
tuba_api_announcement_get_reactions (TubaAPIAnnouncement* self)
{
	GeeArrayList* result;
	GeeArrayList* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_reactions;
	result = _tmp0_;
	return result;
}

void
tuba_api_announcement_set_reactions (TubaAPIAnnouncement* self,
                                     GeeArrayList* value)
{
	GeeArrayList* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_api_announcement_get_reactions (self);
	if (old_value != value) {
		GeeArrayList* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_reactions);
		self->priv->_reactions = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_REACTIONS_PROPERTY]);
	}
}

GeeHashMap*
tuba_api_announcement_get_emojis_map (TubaAPIAnnouncement* self)
{
	GeeHashMap* result;
	GeeHashMap* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = tuba_api_announcement_gen_emojis_map (self);
	result = _tmp0_;
	return result;
}

static void
tuba_api_announcement_class_init (TubaAPIAnnouncementClass * klass,
                                  gpointer klass_data)
{
	tuba_api_announcement_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaAPIAnnouncement_private_offset);
	((TubaEntityClass *) klass)->deserialize_array_type = (GType (*) (TubaEntity*, const gchar*)) tuba_api_announcement_real_deserialize_array_type;
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_api_announcement_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_api_announcement_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_api_announcement_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_ID_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_CONTENT_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_CONTENT_PROPERTY] = g_param_spec_string ("content", "content", "content", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_PUBLISHED_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_PUBLISHED_PROPERTY] = g_param_spec_boolean ("published", "published", "published", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_PUBLISHED_AT_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_PUBLISHED_AT_PROPERTY] = g_param_spec_string ("published-at", "published-at", "published-at", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_UPDATED_AT_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_UPDATED_AT_PROPERTY] = g_param_spec_string ("updated-at", "updated-at", "updated-at", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_READ_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_READ_PROPERTY] = g_param_spec_boolean ("read", "read", "read", TRUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_EMOJIS_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_EMOJIS_PROPERTY] = g_param_spec_object ("emojis", "emojis", "emojis", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_REACTIONS_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_REACTIONS_PROPERTY] = g_param_spec_object ("reactions", "reactions", "reactions", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_API_ANNOUNCEMENT_EMOJIS_MAP_PROPERTY, tuba_api_announcement_properties[TUBA_API_ANNOUNCEMENT_EMOJIS_MAP_PROPERTY] = g_param_spec_object ("emojis-map", "emojis-map", "emojis-map", GEE_TYPE_HASH_MAP, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_api_announcement_tuba_widgetizable_interface_init (TubaWidgetizableIface * iface,
                                                        gpointer iface_data)
{
	tuba_api_announcement_tuba_widgetizable_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_widget = (GtkWidget* (*) (TubaWidgetizable*)) tuba_api_announcement_real_to_widget;
	iface->open = (void (*) (TubaWidgetizable*)) tuba_api_announcement_real_open;
}

static void
tuba_api_announcement_instance_init (TubaAPIAnnouncement * self,
                                     gpointer klass)
{
	self->priv = tuba_api_announcement_get_instance_private (self);
	self->priv->_published = TRUE;
	self->priv->_read = TRUE;
	self->priv->_reactions = NULL;
}

static void
tuba_api_announcement_finalize (GObject * obj)
{
	TubaAPIAnnouncement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncement);
	_g_free0 (self->priv->_id);
	_g_free0 (self->priv->_content);
	_g_free0 (self->priv->_published_at);
	_g_free0 (self->priv->_updated_at);
	_g_object_unref0 (self->priv->_emojis);
	_g_object_unref0 (self->priv->_reactions);
	G_OBJECT_CLASS (tuba_api_announcement_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_api_announcement_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaAPIAnnouncementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_api_announcement_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaAPIAnnouncement), 0, (GInstanceInitFunc) tuba_api_announcement_instance_init, NULL };
	static const GInterfaceInfo tuba_widgetizable_info = { (GInterfaceInitFunc) tuba_api_announcement_tuba_widgetizable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_api_announcement_type_id;
	tuba_api_announcement_type_id = g_type_register_static (TUBA_TYPE_ENTITY, "TubaAPIAnnouncement", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_api_announcement_type_id, TUBA_TYPE_WIDGETIZABLE, &tuba_widgetizable_info);
	TubaAPIAnnouncement_private_offset = g_type_add_instance_private (tuba_api_announcement_type_id, sizeof (TubaAPIAnnouncementPrivate));
	return tuba_api_announcement_type_id;
}

GType
tuba_api_announcement_get_type (void)
{
	static GType tuba_api_announcement_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_api_announcement_type_id__once)) {
		GType tuba_api_announcement_type_id;
		tuba_api_announcement_type_id = tuba_api_announcement_get_type_once ();
		g_once_init_leave_pointer (&tuba_api_announcement_type_id__once, tuba_api_announcement_type_id);
	}
	return tuba_api_announcement_type_id__once;
}

static void
_vala_tuba_api_announcement_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	TubaAPIAnnouncement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncement);
	switch (property_id) {
		case TUBA_API_ANNOUNCEMENT_ID_PROPERTY:
		g_value_set_string (value, tuba_api_announcement_get_id (self));
		break;
		case TUBA_API_ANNOUNCEMENT_CONTENT_PROPERTY:
		g_value_set_string (value, tuba_api_announcement_get_content (self));
		break;
		case TUBA_API_ANNOUNCEMENT_PUBLISHED_PROPERTY:
		g_value_set_boolean (value, tuba_api_announcement_get_published (self));
		break;
		case TUBA_API_ANNOUNCEMENT_PUBLISHED_AT_PROPERTY:
		g_value_set_string (value, tuba_api_announcement_get_published_at (self));
		break;
		case TUBA_API_ANNOUNCEMENT_UPDATED_AT_PROPERTY:
		g_value_set_string (value, tuba_api_announcement_get_updated_at (self));
		break;
		case TUBA_API_ANNOUNCEMENT_READ_PROPERTY:
		g_value_set_boolean (value, tuba_api_announcement_get_read (self));
		break;
		case TUBA_API_ANNOUNCEMENT_EMOJIS_PROPERTY:
		g_value_set_object (value, tuba_api_announcement_get_emojis (self));
		break;
		case TUBA_API_ANNOUNCEMENT_REACTIONS_PROPERTY:
		g_value_set_object (value, tuba_api_announcement_get_reactions (self));
		break;
		case TUBA_API_ANNOUNCEMENT_EMOJIS_MAP_PROPERTY:
		g_value_take_object (value, tuba_api_announcement_get_emojis_map (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_api_announcement_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	TubaAPIAnnouncement * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_API_TYPE_ANNOUNCEMENT, TubaAPIAnnouncement);
	switch (property_id) {
		case TUBA_API_ANNOUNCEMENT_ID_PROPERTY:
		tuba_api_announcement_set_id (self, g_value_get_string (value));
		break;
		case TUBA_API_ANNOUNCEMENT_CONTENT_PROPERTY:
		tuba_api_announcement_set_content (self, g_value_get_string (value));
		break;
		case TUBA_API_ANNOUNCEMENT_PUBLISHED_PROPERTY:
		tuba_api_announcement_set_published (self, g_value_get_boolean (value));
		break;
		case TUBA_API_ANNOUNCEMENT_PUBLISHED_AT_PROPERTY:
		tuba_api_announcement_set_published_at (self, g_value_get_string (value));
		break;
		case TUBA_API_ANNOUNCEMENT_UPDATED_AT_PROPERTY:
		tuba_api_announcement_set_updated_at (self, g_value_get_string (value));
		break;
		case TUBA_API_ANNOUNCEMENT_READ_PROPERTY:
		tuba_api_announcement_set_read (self, g_value_get_boolean (value));
		break;
		case TUBA_API_ANNOUNCEMENT_EMOJIS_PROPERTY:
		tuba_api_announcement_set_emojis (self, g_value_get_object (value));
		break;
		case TUBA_API_ANNOUNCEMENT_REACTIONS_PROPERTY:
		tuba_api_announcement_set_reactions (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

