/* AssignedRow.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from AssignedRow.vala, do not modify */

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <libsoup/soup.h>
#include <json-glib/json-glib.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_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW (tuba_widgets_admin_assigned_to_row_get_type ())
#define TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, TubaWidgetsAdminAssignedToRow))
#define TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, TubaWidgetsAdminAssignedToRowClass))
#define TUBA_WIDGETS_ADMIN_IS_ASSIGNED_TO_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW))
#define TUBA_WIDGETS_ADMIN_IS_ASSIGNED_TO_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW))
#define TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, TubaWidgetsAdminAssignedToRowClass))

typedef struct _TubaWidgetsAdminAssignedToRow TubaWidgetsAdminAssignedToRow;
typedef struct _TubaWidgetsAdminAssignedToRowClass TubaWidgetsAdminAssignedToRowClass;
typedef struct _TubaWidgetsAdminAssignedToRowPrivate TubaWidgetsAdminAssignedToRowPrivate;
enum  {
	TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_0_PROPERTY,
	TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_admin_assigned_to_row_properties[TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#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_ADMIN_TYPE_ACCOUNT (tuba_api_admin_account_get_type ())
#define TUBA_API_ADMIN_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_ADMIN_TYPE_ACCOUNT, TubaAPIAdminAccount))
#define TUBA_API_ADMIN_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_ADMIN_TYPE_ACCOUNT, TubaAPIAdminAccountClass))
#define TUBA_API_ADMIN_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_ADMIN_TYPE_ACCOUNT))
#define TUBA_API_ADMIN_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_ADMIN_TYPE_ACCOUNT))
#define TUBA_API_ADMIN_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_ADMIN_TYPE_ACCOUNT, TubaAPIAdminAccountClass))

typedef struct _TubaAPIAdminAccount TubaAPIAdminAccount;
typedef struct _TubaAPIAdminAccountClass TubaAPIAdminAccountClass;

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

#define TUBA_TYPE_REQUEST (tuba_request_get_type ())
#define TUBA_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST, TubaRequest))
#define TUBA_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST, TubaRequestClass))
#define TUBA_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST))
#define TUBA_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST))
#define TUBA_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST, TubaRequestClass))

typedef struct _TubaRequest TubaRequest;
typedef struct _TubaRequestClass TubaRequestClass;
typedef void (*TubaNetworkSuccessCallback) (GInputStream* in_stream, SoupMessageHeaders* response_headers, gpointer user_data, GError** error);

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

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;

#define TUBA_API_ADMIN_TYPE_REPORT (tuba_api_admin_report_get_type ())
#define TUBA_API_ADMIN_REPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_ADMIN_TYPE_REPORT, TubaAPIAdminReport))
#define TUBA_API_ADMIN_REPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_ADMIN_TYPE_REPORT, TubaAPIAdminReportClass))
#define TUBA_API_ADMIN_IS_REPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_ADMIN_TYPE_REPORT))
#define TUBA_API_ADMIN_IS_REPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_ADMIN_TYPE_REPORT))
#define TUBA_API_ADMIN_REPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_ADMIN_TYPE_REPORT, TubaAPIAdminReportClass))

typedef struct _TubaAPIAdminReport TubaAPIAdminReport;
typedef struct _TubaAPIAdminReportClass TubaAPIAdminReportClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
typedef void (*TubaNetworkErrorCallback) (gint32 code, const gchar* reason, gpointer user_data);
enum  {
	TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_ASSIGNMENT_CHANGED_SIGNAL,
	TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_ON_ERROR_SIGNAL,
	TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_NUM_SIGNALS
};
static guint tuba_widgets_admin_assigned_to_row_signals[TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_NUM_SIGNALS] = {0};

struct _TubaWidgetsAdminAssignedToRow {
	AdwActionRow parent_instance;
	TubaWidgetsAdminAssignedToRowPrivate * priv;
};

struct _TubaWidgetsAdminAssignedToRowClass {
	AdwActionRowClass parent_class;
};

struct _TubaWidgetsAdminAssignedToRowPrivate {
	GtkButton* assign_button;
	gchar* report_id;
	gboolean _is_assigned;
};

static gint TubaWidgetsAdminAssignedToRow_private_offset;
static gpointer tuba_widgets_admin_assigned_to_row_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaNetwork* tuba_network;

VALA_EXTERN GType tuba_widgets_admin_assigned_to_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAdminAssignedToRow, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_admin_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAdminAccount, g_object_unref)
VALA_EXTERN TubaWidgetsAdminAssignedToRow* tuba_widgets_admin_assigned_to_row_new (const gchar* report_id,
                                                                       TubaAPIAdminAccount* assigned_account);
VALA_EXTERN TubaWidgetsAdminAssignedToRow* tuba_widgets_admin_assigned_to_row_construct (GType object_type,
                                                                             const gchar* report_id,
                                                                             TubaAPIAdminAccount* assigned_account);
static void tuba_widgets_admin_assigned_to_row_update_account (TubaWidgetsAdminAssignedToRow* self,
                                                        TubaAPIAdminAccount* assigned_account);
static void tuba_widgets_admin_assigned_to_row_set_is_assigned (TubaWidgetsAdminAssignedToRow* self,
                                                         gboolean value);
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN TubaAPIAccount* tuba_api_admin_account_get_account (TubaAPIAdminAccount* self);
VALA_EXTERN const gchar* tuba_api_account_get_id (TubaAPIAccount* self);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN gchar* tuba_api_account_get_full_handle (TubaAPIAccount* self);
static void tuba_widgets_admin_assigned_to_row_do_assign (TubaWidgetsAdminAssignedToRow* self);
static gboolean tuba_widgets_admin_assigned_to_row_get_is_assigned (TubaWidgetsAdminAssignedToRow* self);
VALA_EXTERN TubaRequest* tuba_request_new_POST (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_POST (GType object_type,
                                          const gchar* url);
VALA_EXTERN GType tuba_request_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequest, g_object_unref)
VALA_EXTERN TubaRequest* tuba_request_with_account (TubaRequest* self,
                                        TubaInstanceAccount* account);
VALA_EXTERN TubaRequest* tuba_request_then (TubaRequest* self,
                                TubaNetworkSuccessCallback cb,
                                gpointer cb_target,
                                GDestroyNotify cb_target_destroy_notify);
static void __lambda223_ (TubaWidgetsAdminAssignedToRow* self,
                   GInputStream* in_stream,
                   GError** error);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream (GInputStream* in_stream,
                                                      GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
VALA_EXTERN GType tuba_api_admin_report_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAdminReport, g_object_unref)
VALA_EXTERN TubaAPIAdminReport* tuba_api_admin_report_from (JsonNode* node,
                                                GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN TubaAPIAdminAccount* tuba_api_admin_report_get_assigned_account (TubaAPIAdminReport* self);
static void ___lambda223__tuba_network_success_callback (GInputStream* in_stream,
                                                  SoupMessageHeaders* response_headers,
                                                  gpointer self,
                                                  GError** error);
VALA_EXTERN TubaRequest* tuba_request_on_error (TubaRequest* self,
                                    TubaNetworkErrorCallback cb,
                                    gpointer cb_target,
                                    GDestroyNotify cb_target_destroy_notify);
static void __lambda224_ (TubaWidgetsAdminAssignedToRow* self,
                   gint32 code,
                   const gchar* message);
static void ___lambda224__tuba_network_error_callback (gint32 code,
                                                const gchar* reason,
                                                gpointer self);
VALA_EXTERN TubaRequest* tuba_request_exec (TubaRequest* self);
static GObject * tuba_widgets_admin_assigned_to_row_constructor (GType type,
                                                          guint n_construct_properties,
                                                          GObjectConstructParam * construct_properties);
static void _tuba_widgets_admin_assigned_to_row_do_assign_gtk_button_clicked (GtkButton* _sender,
                                                                       gpointer self);
static void tuba_widgets_admin_assigned_to_row_finalize (GObject * obj);
static GType tuba_widgets_admin_assigned_to_row_get_type_once (void);
static void _vala_tuba_widgets_admin_assigned_to_row_get_property (GObject * object,
                                                            guint property_id,
                                                            GValue * value,
                                                            GParamSpec * pspec);
static void _vala_tuba_widgets_admin_assigned_to_row_set_property (GObject * object,
                                                            guint property_id,
                                                            const GValue * value,
                                                            GParamSpec * pspec);

static inline gpointer
tuba_widgets_admin_assigned_to_row_get_instance_private (TubaWidgetsAdminAssignedToRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsAdminAssignedToRow_private_offset);
}

TubaWidgetsAdminAssignedToRow*
tuba_widgets_admin_assigned_to_row_construct (GType object_type,
                                              const gchar* report_id,
                                              TubaAPIAdminAccount* assigned_account)
{
	TubaWidgetsAdminAssignedToRow * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (report_id != NULL, NULL);
	self = (TubaWidgetsAdminAssignedToRow*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (report_id);
	_g_free0 (self->priv->report_id);
	self->priv->report_id = _tmp0_;
	tuba_widgets_admin_assigned_to_row_update_account (self, assigned_account);
	return self;
}

TubaWidgetsAdminAssignedToRow*
tuba_widgets_admin_assigned_to_row_new (const gchar* report_id,
                                        TubaAPIAdminAccount* assigned_account)
{
	return tuba_widgets_admin_assigned_to_row_construct (TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, report_id, assigned_account);
}

static void
tuba_widgets_admin_assigned_to_row_update_account (TubaWidgetsAdminAssignedToRow* self,
                                                   TubaAPIAdminAccount* assigned_account)
{
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	g_return_if_fail (self != NULL);
	if (assigned_account == NULL) {
		GtkButton* _tmp0_;
		adw_action_row_set_subtitle ((AdwActionRow*) self, _ ("Nobody"));
		_tmp0_ = self->priv->assign_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp0_, TRUE);
		tuba_widgets_admin_assigned_to_row_set_is_assigned (self, FALSE);
	} else {
		GtkButton* _tmp1_;
		TubaAPIAccount* _tmp2_;
		TubaAPIAccount* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		TubaAccountStore* _tmp6_;
		TubaInstanceAccount* _tmp7_;
		TubaInstanceAccount* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		TubaAPIAccount* _tmp11_;
		TubaAPIAccount* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp1_ = self->priv->assign_button;
		_tmp2_ = tuba_api_admin_account_get_account (assigned_account);
		_tmp3_ = _tmp2_;
		_tmp4_ = tuba_api_account_get_id (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = tuba_accounts;
		_tmp7_ = tuba_account_store_get_active (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = tuba_api_account_get_id ((TubaAPIAccount*) _tmp8_);
		_tmp10_ = _tmp9_;
		gtk_widget_set_visible ((GtkWidget*) _tmp1_, g_strcmp0 (_tmp5_, _tmp10_) == 0);
		_tmp11_ = tuba_api_admin_account_get_account (assigned_account);
		_tmp12_ = _tmp11_;
		_tmp13_ = tuba_api_account_get_full_handle (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = _tmp14_;
		adw_action_row_set_subtitle ((AdwActionRow*) self, _tmp15_);
		_g_free0 (_tmp15_);
		tuba_widgets_admin_assigned_to_row_set_is_assigned (self, TRUE);
	}
	_tmp16_ = adw_action_row_get_subtitle ((AdwActionRow*) self);
	_tmp17_ = _tmp16_;
	g_signal_emit (self, tuba_widgets_admin_assigned_to_row_signals[TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_ASSIGNMENT_CHANGED_SIGNAL], 0, _tmp17_);
}

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
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static void
__lambda223_ (TubaWidgetsAdminAssignedToRow* self,
              GInputStream* in_stream,
              GError** error)
{
	JsonParser* parser = NULL;
	JsonParser* _tmp0_;
	JsonNode* node = NULL;
	TubaNetwork* _tmp1_;
	JsonParser* _tmp2_;
	JsonNode* _tmp3_;
	TubaAPIAdminReport* _tmp4_ = NULL;
	JsonNode* _tmp5_;
	TubaAPIAdminReport* _tmp6_;
	TubaAPIAdminAccount* _tmp7_;
	TubaAPIAdminAccount* _tmp8_;
	GtkButton* _tmp9_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (in_stream != NULL);
	_tmp0_ = tuba_network_get_parser_from_inputstream (in_stream, &_inner_error0_);
	parser = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp1_ = tuba_network;
	_tmp2_ = parser;
	_tmp3_ = tuba_network_parse_node (_tmp1_, _tmp2_);
	node = _tmp3_;
	_tmp5_ = node;
	_tmp6_ = tuba_api_admin_report_from (_tmp5_, &_inner_error0_);
	_tmp4_ = _tmp6_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		__vala_JsonNode_free0 (node);
		_g_object_unref0 (parser);
		return;
	}
	_tmp7_ = tuba_api_admin_report_get_assigned_account (_tmp4_);
	_tmp8_ = _tmp7_;
	tuba_widgets_admin_assigned_to_row_update_account (self, _tmp8_);
	_tmp9_ = self->priv->assign_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, TRUE);
	_g_object_unref0 (_tmp4_);
	__vala_JsonNode_free0 (node);
	_g_object_unref0 (parser);
}

static void
___lambda223__tuba_network_success_callback (GInputStream* in_stream,
                                             SoupMessageHeaders* response_headers,
                                             gpointer self,
                                             GError** error)
{
	__lambda223_ ((TubaWidgetsAdminAssignedToRow*) self, in_stream, error);
}

static void
__lambda224_ (TubaWidgetsAdminAssignedToRow* self,
              gint32 code,
              const gchar* message)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GtkButton* _tmp12_;
	g_return_if_fail (message != NULL);
	_tmp0_ = self->priv->report_id;
	_tmp1_ = string_to_string (_tmp0_);
	_tmp2_ = string_to_string (message);
	_tmp3_ = g_strdup_printf ("%i", code);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strconcat ("Error trying to re-assign ", _tmp1_, ": ", _tmp2_, " ", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	g_warning ("AssignedRow.vala:73: %s", _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	_tmp7_ = string_to_string (message);
	_tmp8_ = g_strdup_printf ("%i", code);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strconcat (_tmp7_, " ", _tmp9_, NULL);
	_tmp11_ = _tmp10_;
	g_signal_emit (self, tuba_widgets_admin_assigned_to_row_signals[TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_ON_ERROR_SIGNAL], 0, _tmp11_);
	_g_free0 (_tmp11_);
	_g_free0 (_tmp9_);
	_tmp12_ = self->priv->assign_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp12_, TRUE);
}

static void
___lambda224__tuba_network_error_callback (gint32 code,
                                           const gchar* reason,
                                           gpointer self)
{
	__lambda224_ ((TubaWidgetsAdminAssignedToRow*) self, code, reason);
}

static void
tuba_widgets_admin_assigned_to_row_do_assign (TubaWidgetsAdminAssignedToRow* self)
{
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gchar* endpoint = NULL;
	gchar* _tmp3_;
	GtkButton* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	TubaRequest* _tmp10_;
	TubaRequest* _tmp11_;
	TubaAccountStore* _tmp12_;
	TubaInstanceAccount* _tmp13_;
	TubaInstanceAccount* _tmp14_;
	TubaRequest* _tmp15_;
	TubaRequest* _tmp16_;
	TubaRequest* _tmp17_;
	TubaRequest* _tmp18_;
	TubaRequest* _tmp19_;
	TubaRequest* _tmp20_;
	TubaRequest* _tmp21_;
	TubaRequest* _tmp22_;
	g_return_if_fail (self != NULL);
	_tmp1_ = tuba_widgets_admin_assigned_to_row_get_is_assigned (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		_tmp0_ = "unassign";
	} else {
		_tmp0_ = "assign_to_self";
	}
	_tmp3_ = g_strdup (_tmp0_);
	endpoint = _tmp3_;
	_tmp4_ = self->priv->assign_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE);
	_tmp5_ = self->priv->report_id;
	_tmp6_ = string_to_string (_tmp5_);
	_tmp7_ = string_to_string (endpoint);
	_tmp8_ = g_strconcat ("/api/v1/admin/reports/", _tmp6_, "/", _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	_tmp10_ = tuba_request_new_POST (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = tuba_accounts;
	_tmp13_ = tuba_account_store_get_active (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = tuba_request_with_account (_tmp11_, _tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = tuba_request_then (_tmp16_, ___lambda223__tuba_network_success_callback, g_object_ref (self), g_object_unref);
	_tmp18_ = _tmp17_;
	_tmp19_ = tuba_request_on_error (_tmp18_, ___lambda224__tuba_network_error_callback, g_object_ref (self), g_object_unref);
	_tmp20_ = _tmp19_;
	_tmp21_ = tuba_request_exec (_tmp20_);
	_tmp22_ = _tmp21_;
	_g_object_unref0 (_tmp22_);
	_g_object_unref0 (_tmp20_);
	_g_object_unref0 (_tmp18_);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (_tmp11_);
	_g_free0 (_tmp9_);
	_g_free0 (endpoint);
}

static gboolean
tuba_widgets_admin_assigned_to_row_get_is_assigned (TubaWidgetsAdminAssignedToRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_assigned;
	return result;
}

static void
tuba_widgets_admin_assigned_to_row_set_is_assigned (TubaWidgetsAdminAssignedToRow* self,
                                                    gboolean value)
{
	g_return_if_fail (self != NULL);
	self->priv->_is_assigned = value;
	if (value) {
		GtkButton* _tmp0_;
		GtkButton* _tmp1_;
		GtkButton* _tmp2_;
		_tmp0_ = self->priv->assign_button;
		gtk_widget_add_css_class ((GtkWidget*) _tmp0_, "destructive-action");
		_tmp1_ = self->priv->assign_button;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp1_, "suggested-action");
		_tmp2_ = self->priv->assign_button;
		gtk_button_set_label (_tmp2_, _ ("Unassign"));
	} else {
		GtkButton* _tmp3_;
		GtkButton* _tmp4_;
		GtkButton* _tmp5_;
		_tmp3_ = self->priv->assign_button;
		gtk_widget_add_css_class ((GtkWidget*) _tmp3_, "suggested-action");
		_tmp4_ = self->priv->assign_button;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp4_, "destructive-action");
		_tmp5_ = self->priv->assign_button;
		gtk_button_set_label (_tmp5_, _ ("Assign"));
	}
}

static void
_tuba_widgets_admin_assigned_to_row_do_assign_gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self)
{
	tuba_widgets_admin_assigned_to_row_do_assign ((TubaWidgetsAdminAssignedToRow*) self);
}

static GObject *
tuba_widgets_admin_assigned_to_row_constructor (GType type,
                                                guint n_construct_properties,
                                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsAdminAssignedToRow * self;
	GtkButton* _tmp0_ = NULL;
	GtkButton* _tmp1_;
	GtkButton* _tmp2_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_admin_assigned_to_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, TubaWidgetsAdminAssignedToRow);
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _ ("Assigned to"));
	adw_action_row_set_subtitle_selectable ((AdwActionRow*) self, TRUE);
	_tmp0_ = (GtkButton*) gtk_button_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp0_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->assign_button);
	self->priv->assign_button = _tmp0_;
	_tmp1_ = self->priv->assign_button;
	g_signal_connect_object (_tmp1_, "clicked", (GCallback) _tuba_widgets_admin_assigned_to_row_do_assign_gtk_button_clicked, self, 0);
	_tmp2_ = self->priv->assign_button;
	adw_action_row_add_suffix ((AdwActionRow*) self, (GtkWidget*) _tmp2_);
	return obj;
}

static void
tuba_widgets_admin_assigned_to_row_class_init (TubaWidgetsAdminAssignedToRowClass * klass,
                                               gpointer klass_data)
{
	tuba_widgets_admin_assigned_to_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsAdminAssignedToRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_admin_assigned_to_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_admin_assigned_to_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_admin_assigned_to_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_admin_assigned_to_row_finalize;
	tuba_widgets_admin_assigned_to_row_signals[TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_ASSIGNMENT_CHANGED_SIGNAL] = g_signal_new ("assignment-changed", TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
	tuba_widgets_admin_assigned_to_row_signals[TUBA_WIDGETS_ADMIN_ASSIGNED_TO_ROW_ON_ERROR_SIGNAL] = g_signal_new ("on-error", TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING);
}

static void
tuba_widgets_admin_assigned_to_row_instance_init (TubaWidgetsAdminAssignedToRow * self,
                                                  gpointer klass)
{
	self->priv = tuba_widgets_admin_assigned_to_row_get_instance_private (self);
	self->priv->_is_assigned = FALSE;
}

static void
tuba_widgets_admin_assigned_to_row_finalize (GObject * obj)
{
	TubaWidgetsAdminAssignedToRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, TubaWidgetsAdminAssignedToRow);
	g_debug ("AssignedRow.vala:6: Destroying AssignedToRow");
	_g_object_unref0 (self->priv->assign_button);
	_g_free0 (self->priv->report_id);
	G_OBJECT_CLASS (tuba_widgets_admin_assigned_to_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_admin_assigned_to_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsAdminAssignedToRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_admin_assigned_to_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsAdminAssignedToRow), 0, (GInstanceInitFunc) tuba_widgets_admin_assigned_to_row_instance_init, NULL };
	GType tuba_widgets_admin_assigned_to_row_type_id;
	tuba_widgets_admin_assigned_to_row_type_id = g_type_register_static (adw_action_row_get_type (), "TubaWidgetsAdminAssignedToRow", &g_define_type_info, 0);
	TubaWidgetsAdminAssignedToRow_private_offset = g_type_add_instance_private (tuba_widgets_admin_assigned_to_row_type_id, sizeof (TubaWidgetsAdminAssignedToRowPrivate));
	return tuba_widgets_admin_assigned_to_row_type_id;
}

GType
tuba_widgets_admin_assigned_to_row_get_type (void)
{
	static gsize tuba_widgets_admin_assigned_to_row_type_id__once = 0;
	if (g_once_init_enter (&tuba_widgets_admin_assigned_to_row_type_id__once)) {
		GType tuba_widgets_admin_assigned_to_row_type_id;
		tuba_widgets_admin_assigned_to_row_type_id = tuba_widgets_admin_assigned_to_row_get_type_once ();
		g_once_init_leave (&tuba_widgets_admin_assigned_to_row_type_id__once, tuba_widgets_admin_assigned_to_row_type_id);
	}
	return tuba_widgets_admin_assigned_to_row_type_id__once;
}

static void
_vala_tuba_widgets_admin_assigned_to_row_get_property (GObject * object,
                                                       guint property_id,
                                                       GValue * value,
                                                       GParamSpec * pspec)
{
	TubaWidgetsAdminAssignedToRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, TubaWidgetsAdminAssignedToRow);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_admin_assigned_to_row_set_property (GObject * object,
                                                       guint property_id,
                                                       const GValue * value,
                                                       GParamSpec * pspec)
{
	TubaWidgetsAdminAssignedToRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_ADMIN_TYPE_ASSIGNED_TO_ROW, TubaWidgetsAdminAssignedToRow);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

