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

#include <glib-object.h>
#include <gio/gio.h>
#include <glib.h>
#include <stdlib.h>
#include <string.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 PROTON_PLUS_MODELS_TYPE_RUNNER (proton_plus_models_runner_get_type ())
#define PROTON_PLUS_MODELS_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunner))
#define PROTON_PLUS_MODELS_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunnerClass))
#define PROTON_PLUS_MODELS_IS_RUNNER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER))
#define PROTON_PLUS_MODELS_IS_RUNNER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_RUNNER))
#define PROTON_PLUS_MODELS_RUNNER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_RUNNER, ProtonPlusModelsRunnerClass))

typedef struct _ProtonPlusModelsRunner ProtonPlusModelsRunner;
typedef struct _ProtonPlusModelsRunnerClass ProtonPlusModelsRunnerClass;
typedef struct _ProtonPlusModelsRunnerPrivate ProtonPlusModelsRunnerPrivate;

#define PROTON_PLUS_MODELS_TYPE_BASE_RELEASE (proton_plus_models_base_release_get_type ())
#define PROTON_PLUS_MODELS_BASE_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseRelease))
#define PROTON_PLUS_MODELS_BASE_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseReleaseClass))
#define PROTON_PLUS_MODELS_IS_BASE_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE))
#define PROTON_PLUS_MODELS_IS_BASE_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE))
#define PROTON_PLUS_MODELS_BASE_RELEASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_BASE_RELEASE, ProtonPlusModelsBaseReleaseClass))

typedef struct _ProtonPlusModelsBaseRelease ProtonPlusModelsBaseRelease;
typedef struct _ProtonPlusModelsBaseReleaseClass ProtonPlusModelsBaseReleaseClass;

#define PROTON_PLUS_MODELS_TYPE_RELEASE (proton_plus_models_release_get_type ())
#define PROTON_PLUS_MODELS_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_TYPE_RELEASE, ProtonPlusModelsRelease))
#define PROTON_PLUS_MODELS_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_TYPE_RELEASE, ProtonPlusModelsReleaseClass))
#define PROTON_PLUS_MODELS_IS_RELEASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_TYPE_RELEASE))
#define PROTON_PLUS_MODELS_IS_RELEASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_TYPE_RELEASE))
#define PROTON_PLUS_MODELS_RELEASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_TYPE_RELEASE, ProtonPlusModelsReleaseClass))

typedef struct _ProtonPlusModelsRelease ProtonPlusModelsRelease;
typedef struct _ProtonPlusModelsReleaseClass ProtonPlusModelsReleaseClass;
typedef enum  {
	PROTON_PLUS_RETURN_CODE_UNKNOWN_ERROR,
	PROTON_PLUS_RETURN_CODE_RELEASES_LOADED,
	PROTON_PLUS_RETURN_CODE_NOTHING_TO_UPDATE,
	PROTON_PLUS_RETURN_CODE_RUNNERS_UPDATED,
	PROTON_PLUS_RETURN_CODE_RUNNER_UPDATED,
	PROTON_PLUS_RETURN_CODE_VALID_REQUEST,
	PROTON_PLUS_RETURN_CODE_CONNECTION_ISSUE,
	PROTON_PLUS_RETURN_CODE_CONNECTION_REFUSED,
	PROTON_PLUS_RETURN_CODE_CONNECTION_UNKNOWN,
	PROTON_PLUS_RETURN_CODE_API_LIMIT_REACHED,
	PROTON_PLUS_RETURN_CODE_INVALID_ACCESS_TOKEN
} ProtonPlusReturnCode;

#define PROTON_PLUS_TYPE_RETURN_CODE (proton_plus_return_code_get_type ())

#define PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC (proton_plus_models_runners_basic_get_type ())
#define PROTON_PLUS_MODELS_RUNNERS_BASIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC, ProtonPlusModelsRunnersBasic))
#define PROTON_PLUS_MODELS_RUNNERS_BASIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC, ProtonPlusModelsRunnersBasicClass))
#define PROTON_PLUS_MODELS_RUNNERS_IS_BASIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC))
#define PROTON_PLUS_MODELS_RUNNERS_IS_BASIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC))
#define PROTON_PLUS_MODELS_RUNNERS_BASIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC, ProtonPlusModelsRunnersBasicClass))

typedef struct _ProtonPlusModelsRunnersBasic ProtonPlusModelsRunnersBasic;
typedef struct _ProtonPlusModelsRunnersBasicClass ProtonPlusModelsRunnersBasicClass;
typedef struct _ProtonPlusModelsRunnersBasicPrivate ProtonPlusModelsRunnersBasicPrivate;
enum  {
	PROTON_PLUS_MODELS_RUNNERS_BASIC_0_PROPERTY,
	PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_PROPERTY,
	PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_TIME_CONDITION_PROPERTY,
	PROTON_PLUS_MODELS_RUNNERS_BASIC_ENDPOINT_PROPERTY,
	PROTON_PLUS_MODELS_RUNNERS_BASIC_PAGE_PROPERTY,
	PROTON_PLUS_MODELS_RUNNERS_BASIC_DIRECTORY_NAME_FORMAT_PROPERTY,
	PROTON_PLUS_MODELS_RUNNERS_BASIC_NUM_PROPERTIES
};
static GParamSpec* proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))

struct _ProtonPlusModelsRunner {
	GObject parent_instance;
	ProtonPlusModelsRunnerPrivate * priv;
	GList* releases;
};

struct _ProtonPlusModelsRunnerClass {
	GObjectClass parent_class;
	void (*load) (ProtonPlusModelsRunner* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	ProtonPlusReturnCode (*load_finish) (ProtonPlusModelsRunner* self, GAsyncResult* _res_, GList** releases);
};

struct _ProtonPlusModelsRunnersBasic {
	ProtonPlusModelsRunner parent_instance;
	ProtonPlusModelsRunnersBasicPrivate * priv;
};

struct _ProtonPlusModelsRunnersBasicClass {
	ProtonPlusModelsRunnerClass parent_class;
	gchar* (*get_directory_name) (ProtonPlusModelsRunnersBasic* self, const gchar* release_name);
};

struct _ProtonPlusModelsRunnersBasicPrivate {
	gint _asset_position;
	gchar* _asset_position_time_condition;
	gchar* _endpoint;
	gint _page;
	gchar* _directory_name_format;
};

static gint ProtonPlusModelsRunnersBasic_private_offset;
static gpointer proton_plus_models_runners_basic_parent_class = NULL;

VALA_EXTERN GType proton_plus_models_runner_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsRunner, g_object_unref)
VALA_EXTERN GType proton_plus_models_base_release_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsBaseRelease, g_object_unref)
VALA_EXTERN GType proton_plus_models_release_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsRelease, g_object_unref)
VALA_EXTERN GType proton_plus_return_code_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType proton_plus_models_runners_basic_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ProtonPlusModelsRunnersBasic, g_object_unref)
VALA_EXTERN gchar* proton_plus_models_runners_basic_get_directory_name (ProtonPlusModelsRunnersBasic* self,
                                                            const gchar* release_name);
static gchar* proton_plus_models_runners_basic_real_get_directory_name (ProtonPlusModelsRunnersBasic* self,
                                                                 const gchar* release_name);
VALA_EXTERN const gchar* proton_plus_models_runners_basic_get_directory_name_format (ProtonPlusModelsRunnersBasic* self);
VALA_EXTERN const gchar* proton_plus_models_runner_get_title (ProtonPlusModelsRunner* self);
VALA_EXTERN ProtonPlusModelsRunnersBasic* proton_plus_models_runners_basic_construct (GType object_type);
VALA_EXTERN ProtonPlusModelsRunner* proton_plus_models_runner_construct (GType object_type);
VALA_EXTERN gint proton_plus_models_runners_basic_get_asset_position (ProtonPlusModelsRunnersBasic* self);
VALA_EXTERN void proton_plus_models_runners_basic_set_asset_position (ProtonPlusModelsRunnersBasic* self,
                                                          gint value);
VALA_EXTERN const gchar* proton_plus_models_runners_basic_get_asset_position_time_condition (ProtonPlusModelsRunnersBasic* self);
VALA_EXTERN void proton_plus_models_runners_basic_set_asset_position_time_condition (ProtonPlusModelsRunnersBasic* self,
                                                                         const gchar* value);
VALA_EXTERN const gchar* proton_plus_models_runners_basic_get_endpoint (ProtonPlusModelsRunnersBasic* self);
VALA_EXTERN void proton_plus_models_runners_basic_set_endpoint (ProtonPlusModelsRunnersBasic* self,
                                                    const gchar* value);
VALA_EXTERN gint proton_plus_models_runners_basic_get_page (ProtonPlusModelsRunnersBasic* self);
VALA_EXTERN void proton_plus_models_runners_basic_set_page (ProtonPlusModelsRunnersBasic* self,
                                                gint value);
VALA_EXTERN void proton_plus_models_runners_basic_set_directory_name_format (ProtonPlusModelsRunnersBasic* self,
                                                                 const gchar* value);
static GObject * proton_plus_models_runners_basic_constructor (GType type,
                                                        guint n_construct_properties,
                                                        GObjectConstructParam * construct_properties);
static void proton_plus_models_runners_basic_finalize (GObject * obj);
static GType proton_plus_models_runners_basic_get_type_once (void);
static void _vala_proton_plus_models_runners_basic_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec);
static void _vala_proton_plus_models_runners_basic_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

static inline gpointer
proton_plus_models_runners_basic_get_instance_private (ProtonPlusModelsRunnersBasic* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusModelsRunnersBasic_private_offset);
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	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 gchar
string_get (const gchar* self,
            glong index)
{
	gchar _tmp0_;
	gchar result;
	g_return_val_if_fail (self != NULL, '\0');
	_tmp0_ = ((gchar*) self)[index];
	result = _tmp0_;
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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 NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected 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 NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	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 NULL;
}

static gchar*
proton_plus_models_runners_basic_real_get_directory_name (ProtonPlusModelsRunnersBasic* self,
                                                          const gchar* release_name)
{
	GString* directory_name = NULL;
	const gchar* _tmp1_;
	GString* _tmp2_;
	GString* _tmp3_;
	GString* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gboolean _tmp7_ = FALSE;
	GString* _tmp8_;
	gboolean _tmp16_ = FALSE;
	GString* _tmp17_;
	gboolean _tmp33_ = FALSE;
	GString* _tmp34_;
	GString* _tmp53_;
	const gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* result;
	g_return_val_if_fail (release_name != NULL, NULL);
	if (string_contains (release_name, "Latest")) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (release_name);
		result = _tmp0_;
		return result;
	}
	_tmp1_ = self->priv->_directory_name_format;
	_tmp2_ = g_string_new (_tmp1_);
	directory_name = _tmp2_;
	_tmp3_ = directory_name;
	g_string_replace (_tmp3_, "$release_name", release_name, 0U);
	_tmp4_ = directory_name;
	_tmp5_ = proton_plus_models_runner_get_title ((ProtonPlusModelsRunner*) self);
	_tmp6_ = _tmp5_;
	g_string_replace (_tmp4_, "$title", _tmp6_, 0U);
	_tmp8_ = directory_name;
	if (_tmp8_->len > ((gssize) 0)) {
		GString* _tmp9_;
		const gchar* _tmp10_;
		_tmp9_ = directory_name;
		_tmp10_ = _tmp9_->str;
		_tmp7_ = string_get (_tmp10_, (glong) 0) == '_';
	} else {
		_tmp7_ = FALSE;
	}
	if (_tmp7_) {
		GString* _tmp11_;
		GString* _tmp12_;
		GString* _tmp13_;
		const gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp11_ = directory_name;
		g_string_replace (_tmp11_, "_", "", (guint) 1);
		_tmp12_ = directory_name;
		_tmp13_ = directory_name;
		_tmp14_ = _tmp13_->str;
		_tmp15_ = g_ascii_strdown (_tmp14_, (gssize) -1);
		_g_free0 (_tmp12_->str);
		_tmp12_->str = _tmp15_;
	}
	_tmp17_ = directory_name;
	if (_tmp17_->len > ((gssize) 0)) {
		GString* _tmp18_;
		const gchar* _tmp19_;
		_tmp18_ = directory_name;
		_tmp19_ = _tmp18_->str;
		_tmp16_ = string_get (_tmp19_, (glong) 0) == '!';
	} else {
		_tmp16_ = FALSE;
	}
	if (_tmp16_) {
		GString* _tmp20_;
		gchar** split = NULL;
		GString* _tmp21_;
		const gchar* _tmp22_;
		gchar** _tmp23_;
		gchar** _tmp24_;
		gint split_length1;
		gint _split_size_;
		GString* _tmp25_;
		gchar** _tmp26_;
		gint _tmp26__length1;
		const gchar* _tmp27_;
		gchar** _tmp28_;
		gint _tmp28__length1;
		const gchar* _tmp29_;
		gchar** _tmp30_;
		gint _tmp30__length1;
		const gchar* _tmp31_;
		gchar* _tmp32_;
		_tmp20_ = directory_name;
		g_string_replace (_tmp20_, "!", "", (guint) 1);
		_tmp21_ = directory_name;
		_tmp22_ = _tmp21_->str;
		_tmp24_ = _tmp23_ = g_strsplit (_tmp22_, ":", 0);
		split = _tmp24_;
		split_length1 = _vala_array_length (_tmp23_);
		_split_size_ = split_length1;
		_tmp25_ = directory_name;
		_tmp26_ = split;
		_tmp26__length1 = split_length1;
		_tmp27_ = _tmp26_[0];
		_tmp28_ = split;
		_tmp28__length1 = split_length1;
		_tmp29_ = _tmp28_[1];
		_tmp30_ = split;
		_tmp30__length1 = split_length1;
		_tmp31_ = _tmp30_[2];
		_tmp32_ = string_replace (_tmp27_, _tmp29_, _tmp31_);
		_g_free0 (_tmp25_->str);
		_tmp25_->str = _tmp32_;
		split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp34_ = directory_name;
	if (_tmp34_->len > ((gssize) 0)) {
		GString* _tmp35_;
		const gchar* _tmp36_;
		_tmp35_ = directory_name;
		_tmp36_ = _tmp35_->str;
		_tmp33_ = string_get (_tmp36_, (glong) 0) == '&';
	} else {
		_tmp33_ = FALSE;
	}
	if (_tmp33_) {
		GString* _tmp37_;
		gchar** split = NULL;
		GString* _tmp38_;
		const gchar* _tmp39_;
		gchar** _tmp40_;
		gchar** _tmp41_;
		gint split_length1;
		gint _split_size_;
		const gchar* _tmp42_ = NULL;
		gchar** _tmp43_;
		gint _tmp43__length1;
		const gchar* _tmp44_;
		gchar** _tmp45_;
		gint _tmp45__length1;
		const gchar* _tmp46_;
		GString* _tmp51_;
		gchar* _tmp52_;
		_tmp37_ = directory_name;
		g_string_replace (_tmp37_, "&", "", (guint) 1);
		_tmp38_ = directory_name;
		_tmp39_ = _tmp38_->str;
		_tmp41_ = _tmp40_ = g_strsplit (_tmp39_, ":", 0);
		split = _tmp41_;
		split_length1 = _vala_array_length (_tmp40_);
		_split_size_ = split_length1;
		_tmp43_ = split;
		_tmp43__length1 = split_length1;
		_tmp44_ = _tmp43_[0];
		_tmp45_ = split;
		_tmp45__length1 = split_length1;
		_tmp46_ = _tmp45_[1];
		if (string_contains (_tmp44_, _tmp46_)) {
			gchar** _tmp47_;
			gint _tmp47__length1;
			const gchar* _tmp48_;
			_tmp47_ = split;
			_tmp47__length1 = split_length1;
			_tmp48_ = _tmp47_[2];
			_tmp42_ = _tmp48_;
		} else {
			gchar** _tmp49_;
			gint _tmp49__length1;
			const gchar* _tmp50_;
			_tmp49_ = split;
			_tmp49__length1 = split_length1;
			_tmp50_ = _tmp49_[3];
			_tmp42_ = _tmp50_;
		}
		_tmp51_ = directory_name;
		_tmp52_ = g_strdup (_tmp42_);
		_g_free0 (_tmp51_->str);
		_tmp51_->str = _tmp52_;
		split = (_vala_array_free (split, split_length1, (GDestroyNotify) g_free), NULL);
	}
	_tmp53_ = directory_name;
	_tmp54_ = _tmp53_->str;
	_tmp55_ = g_strdup (_tmp54_);
	result = _tmp55_;
	_g_string_free0 (directory_name);
	return result;
}

gchar*
proton_plus_models_runners_basic_get_directory_name (ProtonPlusModelsRunnersBasic* self,
                                                     const gchar* release_name)
{
	ProtonPlusModelsRunnersBasicClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = PROTON_PLUS_MODELS_RUNNERS_BASIC_GET_CLASS (self);
	if (_klass_->get_directory_name) {
		return _klass_->get_directory_name (self, release_name);
	}
	return NULL;
}

ProtonPlusModelsRunnersBasic*
proton_plus_models_runners_basic_construct (GType object_type)
{
	ProtonPlusModelsRunnersBasic * self = NULL;
	self = (ProtonPlusModelsRunnersBasic*) proton_plus_models_runner_construct (object_type);
	return self;
}

gint
proton_plus_models_runners_basic_get_asset_position (ProtonPlusModelsRunnersBasic* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_asset_position;
	return result;
}

void
proton_plus_models_runners_basic_set_asset_position (ProtonPlusModelsRunnersBasic* self,
                                                     gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_runners_basic_get_asset_position (self);
	if (old_value != value) {
		self->priv->_asset_position = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_PROPERTY]);
	}
}

const gchar*
proton_plus_models_runners_basic_get_asset_position_time_condition (ProtonPlusModelsRunnersBasic* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_asset_position_time_condition;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_runners_basic_set_asset_position_time_condition (ProtonPlusModelsRunnersBasic* self,
                                                                    const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_runners_basic_get_asset_position_time_condition (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_asset_position_time_condition);
		self->priv->_asset_position_time_condition = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_TIME_CONDITION_PROPERTY]);
	}
}

const gchar*
proton_plus_models_runners_basic_get_endpoint (ProtonPlusModelsRunnersBasic* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_endpoint;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_runners_basic_set_endpoint (ProtonPlusModelsRunnersBasic* self,
                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_runners_basic_get_endpoint (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_endpoint);
		self->priv->_endpoint = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_ENDPOINT_PROPERTY]);
	}
}

gint
proton_plus_models_runners_basic_get_page (ProtonPlusModelsRunnersBasic* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_page;
	return result;
}

void
proton_plus_models_runners_basic_set_page (ProtonPlusModelsRunnersBasic* self,
                                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_runners_basic_get_page (self);
	if (old_value != value) {
		self->priv->_page = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_PAGE_PROPERTY]);
	}
}

const gchar*
proton_plus_models_runners_basic_get_directory_name_format (ProtonPlusModelsRunnersBasic* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_directory_name_format;
	result = _tmp0_;
	return result;
}

void
proton_plus_models_runners_basic_set_directory_name_format (ProtonPlusModelsRunnersBasic* self,
                                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_models_runners_basic_get_directory_name_format (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_directory_name_format);
		self->priv->_directory_name_format = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_DIRECTORY_NAME_FORMAT_PROPERTY]);
	}
}

static GObject *
proton_plus_models_runners_basic_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	ProtonPlusModelsRunnersBasic * self;
	parent_class = G_OBJECT_CLASS (proton_plus_models_runners_basic_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC, ProtonPlusModelsRunnersBasic);
	proton_plus_models_runners_basic_set_page (self, 1);
	return obj;
}

static void
proton_plus_models_runners_basic_class_init (ProtonPlusModelsRunnersBasicClass * klass,
                                             gpointer klass_data)
{
	proton_plus_models_runners_basic_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusModelsRunnersBasic_private_offset);
	((ProtonPlusModelsRunnersBasicClass *) klass)->get_directory_name = (gchar* (*) (ProtonPlusModelsRunnersBasic*, const gchar*)) proton_plus_models_runners_basic_real_get_directory_name;
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_models_runners_basic_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_models_runners_basic_set_property;
	G_OBJECT_CLASS (klass)->constructor = proton_plus_models_runners_basic_constructor;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_models_runners_basic_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_PROPERTY, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_PROPERTY] = g_param_spec_int ("asset-position", "asset-position", "asset-position", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_TIME_CONDITION_PROPERTY, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_TIME_CONDITION_PROPERTY] = g_param_spec_string ("asset-position-time-condition", "asset-position-time-condition", "asset-position-time-condition", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_RUNNERS_BASIC_ENDPOINT_PROPERTY, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_ENDPOINT_PROPERTY] = g_param_spec_string ("endpoint", "endpoint", "endpoint", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_RUNNERS_BASIC_PAGE_PROPERTY, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_PAGE_PROPERTY] = g_param_spec_int ("page", "page", "page", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_MODELS_RUNNERS_BASIC_DIRECTORY_NAME_FORMAT_PROPERTY, proton_plus_models_runners_basic_properties[PROTON_PLUS_MODELS_RUNNERS_BASIC_DIRECTORY_NAME_FORMAT_PROPERTY] = g_param_spec_string ("directory-name-format", "directory-name-format", "directory-name-format", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_models_runners_basic_instance_init (ProtonPlusModelsRunnersBasic * self,
                                                gpointer klass)
{
	self->priv = proton_plus_models_runners_basic_get_instance_private (self);
}

static void
proton_plus_models_runners_basic_finalize (GObject * obj)
{
	ProtonPlusModelsRunnersBasic * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC, ProtonPlusModelsRunnersBasic);
	_g_free0 (self->priv->_asset_position_time_condition);
	_g_free0 (self->priv->_endpoint);
	_g_free0 (self->priv->_directory_name_format);
	G_OBJECT_CLASS (proton_plus_models_runners_basic_parent_class)->finalize (obj);
}

static GType
proton_plus_models_runners_basic_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusModelsRunnersBasicClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_models_runners_basic_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusModelsRunnersBasic), 0, (GInstanceInitFunc) proton_plus_models_runners_basic_instance_init, NULL };
	GType proton_plus_models_runners_basic_type_id;
	proton_plus_models_runners_basic_type_id = g_type_register_static (PROTON_PLUS_MODELS_TYPE_RUNNER, "ProtonPlusModelsRunnersBasic", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	ProtonPlusModelsRunnersBasic_private_offset = g_type_add_instance_private (proton_plus_models_runners_basic_type_id, sizeof (ProtonPlusModelsRunnersBasicPrivate));
	return proton_plus_models_runners_basic_type_id;
}

GType
proton_plus_models_runners_basic_get_type (void)
{
	static volatile gsize proton_plus_models_runners_basic_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_models_runners_basic_type_id__once)) {
		GType proton_plus_models_runners_basic_type_id;
		proton_plus_models_runners_basic_type_id = proton_plus_models_runners_basic_get_type_once ();
		g_once_init_leave (&proton_plus_models_runners_basic_type_id__once, proton_plus_models_runners_basic_type_id);
	}
	return proton_plus_models_runners_basic_type_id__once;
}

static void
_vala_proton_plus_models_runners_basic_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec)
{
	ProtonPlusModelsRunnersBasic * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC, ProtonPlusModelsRunnersBasic);
	switch (property_id) {
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_PROPERTY:
		g_value_set_int (value, proton_plus_models_runners_basic_get_asset_position (self));
		break;
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_TIME_CONDITION_PROPERTY:
		g_value_set_string (value, proton_plus_models_runners_basic_get_asset_position_time_condition (self));
		break;
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_ENDPOINT_PROPERTY:
		g_value_set_string (value, proton_plus_models_runners_basic_get_endpoint (self));
		break;
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_PAGE_PROPERTY:
		g_value_set_int (value, proton_plus_models_runners_basic_get_page (self));
		break;
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_DIRECTORY_NAME_FORMAT_PROPERTY:
		g_value_set_string (value, proton_plus_models_runners_basic_get_directory_name_format (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_models_runners_basic_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec)
{
	ProtonPlusModelsRunnersBasic * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_MODELS_RUNNERS_TYPE_BASIC, ProtonPlusModelsRunnersBasic);
	switch (property_id) {
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_PROPERTY:
		proton_plus_models_runners_basic_set_asset_position (self, g_value_get_int (value));
		break;
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_ASSET_POSITION_TIME_CONDITION_PROPERTY:
		proton_plus_models_runners_basic_set_asset_position_time_condition (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_ENDPOINT_PROPERTY:
		proton_plus_models_runners_basic_set_endpoint (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_PAGE_PROPERTY:
		proton_plus_models_runners_basic_set_page (self, g_value_get_int (value));
		break;
		case PROTON_PLUS_MODELS_RUNNERS_BASIC_DIRECTORY_NAME_FORMAT_PROPERTY:
		proton_plus_models_runners_basic_set_directory_name_format (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gssize
_vala_array_length (gpointer array)
{
	gssize length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

