/* archive-workflow-support.c generated by valac 0.56.19, the Vala compiler
 * generated from archive-workflow-support.vala, do not modify */

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "protonplus_core.h"
#include <gio/gio.h>
#include <glib/gstdio.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

#define PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION (proton_plus_services_archive_operation_get_type ())
#define PROTON_PLUS_SERVICES_ARCHIVE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION, ProtonPlusServicesArchiveOperation))
#define PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION, ProtonPlusServicesArchiveOperationClass))
#define PROTON_PLUS_SERVICES_IS_ARCHIVE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION))
#define PROTON_PLUS_SERVICES_IS_ARCHIVE_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION))
#define PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION, ProtonPlusServicesArchiveOperationClass))

typedef struct _ProtonPlusServicesArchiveOperation ProtonPlusServicesArchiveOperation;
typedef struct _ProtonPlusServicesArchiveOperationClass ProtonPlusServicesArchiveOperationClass;
typedef struct _ProtonPlusServicesArchiveOperationPrivate ProtonPlusServicesArchiveOperationPrivate;
enum  {
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_0_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_OPERATION_PATH_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ARCHIVE_PATH_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_EXTENSION_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_ARCHIVE_PATH_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ASSET_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_FROM_CACHE_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_PUBLISHED_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_STAGING_ROOT_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define PROTON_PLUS_SERVICES_TYPE_ARCHIVE_WORKFLOW_SUPPORT (proton_plus_services_archive_workflow_support_get_type ())
#define PROTON_PLUS_SERVICES_ARCHIVE_WORKFLOW_SUPPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_WORKFLOW_SUPPORT, ProtonPlusServicesArchiveWorkflowSupport))
#define PROTON_PLUS_SERVICES_ARCHIVE_WORKFLOW_SUPPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_WORKFLOW_SUPPORT, ProtonPlusServicesArchiveWorkflowSupportClass))
#define PROTON_PLUS_SERVICES_IS_ARCHIVE_WORKFLOW_SUPPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_WORKFLOW_SUPPORT))
#define PROTON_PLUS_SERVICES_IS_ARCHIVE_WORKFLOW_SUPPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_WORKFLOW_SUPPORT))
#define PROTON_PLUS_SERVICES_ARCHIVE_WORKFLOW_SUPPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PROTON_PLUS_SERVICES_TYPE_ARCHIVE_WORKFLOW_SUPPORT, ProtonPlusServicesArchiveWorkflowSupportClass))

typedef struct _ProtonPlusServicesArchiveWorkflowSupport ProtonPlusServicesArchiveWorkflowSupport;
typedef struct _ProtonPlusServicesArchiveWorkflowSupportClass ProtonPlusServicesArchiveWorkflowSupportClass;
typedef struct _ProtonPlusServicesArchiveWorkflowSupportPrivate ProtonPlusServicesArchiveWorkflowSupportPrivate;
enum  {
	PROTON_PLUS_SERVICES_ARCHIVE_WORKFLOW_SUPPORT_0_PROPERTY,
	PROTON_PLUS_SERVICES_ARCHIVE_WORKFLOW_SUPPORT_NUM_PROPERTIES
};
static GParamSpec* proton_plus_services_archive_workflow_support_properties[PROTON_PLUS_SERVICES_ARCHIVE_WORKFLOW_SUPPORT_NUM_PROPERTIES];
typedef struct _ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData;
typedef struct _ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData;
typedef struct _ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData;
typedef struct _Block44Data Block44Data;
#define _g_checksum_free0(var) ((var == NULL) ? NULL : (var = (g_checksum_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_thread_unref0(var) ((var == NULL) ? NULL : (var = (g_thread_unref (var), NULL)))
typedef struct _ProtonPlusServicesArchiveWorkflowSupportArchiveMatchesAssetData ProtonPlusServicesArchiveWorkflowSupportArchiveMatchesAssetData;
typedef struct _ProtonPlusServicesArchiveWorkflowSupportCleanupPathData ProtonPlusServicesArchiveWorkflowSupportCleanupPathData;
typedef struct _ProtonPlusServicesArchiveWorkflowSupportCleanupData ProtonPlusServicesArchiveWorkflowSupportCleanupData;

struct _ProtonPlusServicesArchiveOperation {
	GObject parent_instance;
	ProtonPlusServicesArchiveOperationPrivate * priv;
};

struct _ProtonPlusServicesArchiveOperationClass {
	GObjectClass parent_class;
};

struct _ProtonPlusServicesArchiveOperationPrivate {
	gchar* _operation_path;
	gchar* _archive_path;
	gchar* _extension;
	gchar* _cache_archive_path;
	ProtonPlusModelsAssetsAsset* _asset;
	gboolean _from_cache;
	gboolean _cache_published;
	gchar* _staging_root;
};

struct _ProtonPlusServicesArchiveWorkflowSupport {
	GObject parent_instance;
	ProtonPlusServicesArchiveWorkflowSupportPrivate * priv;
};

struct _ProtonPlusServicesArchiveWorkflowSupportClass {
	GObjectClass parent_class;
};

struct _ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesArchiveWorkflowSupport* self;
	ProtonPlusServicesInstallJob* job;
	gchar* operation_prefix;
	ProtonPlusServicesArchiveOperation* operation;
	ProtonPlusReturnCode result;
	gchar* extension;
	ProtonPlusModelsAssetsAsset* _tmp0_;
	ProtonPlusModelsAssetsAsset* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* archive_cache_path;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* operation_path;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* archive_key;
	ProtonPlusModelsAssetsAsset* _tmp12_;
	ProtonPlusModelsAssetsAsset* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* cache_archive_path;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* operation_archive_path;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gboolean cache_available;
	const gchar* _tmp30_;
	gboolean _tmp31_;
	const gchar* _tmp32_;
	ProtonPlusModelsAssetsAsset* _tmp33_;
	ProtonPlusModelsAssetsAsset* _tmp34_;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	ProtonPlusServicesArchiveOperation* created;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	const gchar* _tmp40_;
	const gchar* _tmp41_;
	ProtonPlusModelsAssetsAsset* _tmp42_;
	ProtonPlusModelsAssetsAsset* _tmp43_;
	ProtonPlusServicesArchiveOperation* _tmp44_;
	gchar* download_error;
	gboolean downloaded;
	ProtonPlusModelsAssetsAsset* _tmp45_;
	ProtonPlusModelsAssetsAsset* _tmp46_;
	const gchar* _tmp47_;
	const gchar* _tmp48_;
	const gchar* _tmp49_;
	gchar* _tmp50_;
	gboolean _tmp51_;
	const gchar* _tmp52_;
	ProtonPlusServicesArchiveOperation* _tmp53_;
	const gchar* _tmp54_;
	ProtonPlusModelsAssetsAsset* _tmp55_;
	ProtonPlusModelsAssetsAsset* _tmp56_;
	ProtonPlusModelsAssetsAsset* _tmp57_;
	ProtonPlusModelsAssetsAsset* _tmp58_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	ProtonPlusServicesArchiveOperation* _tmp61_;
	const gchar* _tmp62_;
	const gchar* _tmp63_;
	ProtonPlusServicesArchiveOperation* _tmp64_;
	gboolean _tmp65_;
	gboolean _tmp66_;
	ProtonPlusServicesArchiveOperation* _tmp67_;
	ProtonPlusServicesArchiveOperation* _tmp68_;
	ProtonPlusServicesArchiveOperation* _tmp69_;
};

struct _ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesArchiveWorkflowSupport* self;
	ProtonPlusServicesArchiveOperation* operation;
	gboolean result;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	ProtonPlusModelsAssetsAsset* _tmp11_;
	ProtonPlusModelsAssetsAsset* _tmp12_;
	gboolean _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	ProtonPlusModelsAssetsAsset* _tmp24_;
	ProtonPlusModelsAssetsAsset* _tmp25_;
};

struct _ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesArchiveWorkflowSupport* self;
	ProtonPlusReturnCode code;
	ProtonPlusServicesArchiveOperation* operation;
	gboolean discard_cached_archive;
	ProtonPlusReturnCode result;
	ProtonPlusReturnCode _result_;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
};

struct _Block44Data {
	int _ref_count_;
	ProtonPlusServicesArchiveWorkflowSupport* self;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gboolean matches;
	gchar* path;
	ProtonPlusModelsAssetsAsset* asset;
	gpointer _async_data_;
};

struct _ProtonPlusServicesArchiveWorkflowSupportArchiveMatchesAssetData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesArchiveWorkflowSupport* self;
	gchar* path;
	ProtonPlusModelsAssetsAsset* asset;
	gboolean result;
	Block44Data* _data44_;
	GThread* _tmp0_;
	GThread* _tmp1_;
};

struct _ProtonPlusServicesArchiveWorkflowSupportCleanupPathData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesArchiveWorkflowSupport* self;
	gchar* path;
	gboolean _tmp0_;
};

struct _ProtonPlusServicesArchiveWorkflowSupportCleanupData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	ProtonPlusServicesArchiveWorkflowSupport* self;
	ProtonPlusServicesArchiveOperation* operation;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
};

static gint ProtonPlusServicesArchiveOperation_private_offset;
static gpointer proton_plus_services_archive_operation_parent_class = NULL;
static gpointer proton_plus_services_archive_workflow_support_parent_class = NULL;

VALA_EXTERN GType proton_plus_services_archive_operation_get_type (void) G_GNUC_CONST ;
VALA_EXTERN ProtonPlusServicesArchiveOperation* proton_plus_services_archive_operation_new (const gchar* operation_path,
                                                                                const gchar* archive_path,
                                                                                const gchar* extension,
                                                                                const gchar* cache_archive_path,
                                                                                ProtonPlusModelsAssetsAsset* asset,
                                                                                gboolean from_cache);
VALA_EXTERN ProtonPlusServicesArchiveOperation* proton_plus_services_archive_operation_construct (GType object_type,
                                                                                      const gchar* operation_path,
                                                                                      const gchar* archive_path,
                                                                                      const gchar* extension,
                                                                                      const gchar* cache_archive_path,
                                                                                      ProtonPlusModelsAssetsAsset* asset,
                                                                                      gboolean from_cache);
static void proton_plus_services_archive_operation_set_operation_path (ProtonPlusServicesArchiveOperation* self,
                                                                const gchar* value);
static void proton_plus_services_archive_operation_set_archive_path (ProtonPlusServicesArchiveOperation* self,
                                                              const gchar* value);
static void proton_plus_services_archive_operation_set_extension (ProtonPlusServicesArchiveOperation* self,
                                                           const gchar* value);
static void proton_plus_services_archive_operation_set_cache_archive_path (ProtonPlusServicesArchiveOperation* self,
                                                                    const gchar* value);
static void proton_plus_services_archive_operation_set_asset (ProtonPlusServicesArchiveOperation* self,
                                                       ProtonPlusModelsAssetsAsset* value);
static void proton_plus_services_archive_operation_set_from_cache (ProtonPlusServicesArchiveOperation* self,
                                                            gboolean value);
VALA_EXTERN const gchar* proton_plus_services_archive_operation_get_operation_path (ProtonPlusServicesArchiveOperation* self);
VALA_EXTERN const gchar* proton_plus_services_archive_operation_get_archive_path (ProtonPlusServicesArchiveOperation* self);
VALA_EXTERN const gchar* proton_plus_services_archive_operation_get_extension (ProtonPlusServicesArchiveOperation* self);
VALA_EXTERN const gchar* proton_plus_services_archive_operation_get_cache_archive_path (ProtonPlusServicesArchiveOperation* self);
VALA_EXTERN ProtonPlusModelsAssetsAsset* proton_plus_services_archive_operation_get_asset (ProtonPlusServicesArchiveOperation* self);
VALA_EXTERN gboolean proton_plus_services_archive_operation_get_from_cache (ProtonPlusServicesArchiveOperation* self);
VALA_EXTERN gboolean proton_plus_services_archive_operation_get_cache_published (ProtonPlusServicesArchiveOperation* self);
VALA_EXTERN void proton_plus_services_archive_operation_set_cache_published (ProtonPlusServicesArchiveOperation* self,
                                                                 gboolean value);
VALA_EXTERN const gchar* proton_plus_services_archive_operation_get_staging_root (ProtonPlusServicesArchiveOperation* self);
VALA_EXTERN void proton_plus_services_archive_operation_set_staging_root (ProtonPlusServicesArchiveOperation* self,
                                                              const gchar* value);
static void proton_plus_services_archive_operation_finalize (GObject * obj);
static GType proton_plus_services_archive_operation_get_type_once (void);
static void _vala_proton_plus_services_archive_operation_get_property (GObject * object,
                                                                guint property_id,
                                                                GValue * value,
                                                                GParamSpec * pspec);
static void _vala_proton_plus_services_archive_operation_set_property (GObject * object,
                                                                guint property_id,
                                                                const GValue * value,
                                                                GParamSpec * pspec);
VALA_EXTERN GType proton_plus_services_archive_workflow_support_get_type (void) G_GNUC_CONST ;
static void proton_plus_services_archive_workflow_support_prepare_archive_data_free (gpointer _data);
VALA_EXTERN void proton_plus_services_archive_workflow_support_prepare_archive (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                    ProtonPlusServicesInstallJob* job,
                                                                    const gchar* operation_prefix,
                                                                    GAsyncReadyCallback _callback_,
                                                                    gpointer _user_data_);
VALA_EXTERN ProtonPlusReturnCode proton_plus_services_archive_workflow_support_prepare_archive_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                                           GAsyncResult* _res_,
                                                                                           ProtonPlusServicesArchiveOperation** operation);
static gboolean proton_plus_services_archive_workflow_support_prepare_archive_co (ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData* _data_);
static void proton_plus_services_archive_workflow_support_prepare_archive_ready (GObject* source_object,
                                                                          GAsyncResult* _res_,
                                                                          gpointer _user_data_);
static void proton_plus_services_archive_workflow_support_archive_matches_asset (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                          const gchar* path,
                                                                          ProtonPlusModelsAssetsAsset* asset,
                                                                          GAsyncReadyCallback _callback_,
                                                                          gpointer _user_data_);
static gboolean proton_plus_services_archive_workflow_support_archive_matches_asset_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                                     GAsyncResult* _res_);
static void proton_plus_services_archive_workflow_support_cleanup_path (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                 const gchar* path,
                                                                 GAsyncReadyCallback _callback_,
                                                                 gpointer _user_data_);
static void proton_plus_services_archive_workflow_support_cleanup_path_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                        GAsyncResult* _res_);
VALA_EXTERN void proton_plus_services_install_job_set_step (ProtonPlusServicesInstallJob* self,
                                                ProtonPlusServicesInstallJobStep value);
VALA_EXTERN void proton_plus_services_install_job_set_error_message (ProtonPlusServicesInstallJob* self,
                                                         const gchar* value);
static void proton_plus_services_archive_workflow_support_cleanup (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                            ProtonPlusServicesArchiveOperation* operation,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_);
static void proton_plus_services_archive_workflow_support_cleanup_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                   GAsyncResult* _res_);
static void proton_plus_services_archive_workflow_support_publish_archive_data_free (gpointer _data);
VALA_EXTERN void proton_plus_services_archive_workflow_support_publish_archive (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                    ProtonPlusServicesArchiveOperation* operation,
                                                                    GAsyncReadyCallback _callback_,
                                                                    gpointer _user_data_);
VALA_EXTERN gboolean proton_plus_services_archive_workflow_support_publish_archive_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                               GAsyncResult* _res_);
static gboolean proton_plus_services_archive_workflow_support_publish_archive_co (ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData* _data_);
static void proton_plus_services_archive_workflow_support_publish_archive_ready (GObject* source_object,
                                                                          GAsyncResult* _res_,
                                                                          gpointer _user_data_);
static void proton_plus_services_archive_workflow_support_complete_attempt_data_free (gpointer _data);
VALA_EXTERN void proton_plus_services_archive_workflow_support_complete_attempt (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                     ProtonPlusReturnCode code,
                                                                     ProtonPlusServicesArchiveOperation* operation,
                                                                     gboolean discard_cached_archive,
                                                                     GAsyncReadyCallback _callback_,
                                                                     gpointer _user_data_);
VALA_EXTERN ProtonPlusReturnCode proton_plus_services_archive_workflow_support_complete_attempt_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                                            GAsyncResult* _res_);
static gboolean proton_plus_services_archive_workflow_support_complete_attempt_co (ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData* _data_);
static void proton_plus_services_archive_workflow_support_complete_attempt_ready (GObject* source_object,
                                                                           GAsyncResult* _res_,
                                                                           gpointer _user_data_);
static void proton_plus_services_archive_workflow_support_archive_matches_asset_data_free (gpointer _data);
static gboolean proton_plus_services_archive_workflow_support_archive_matches_asset_co (ProtonPlusServicesArchiveWorkflowSupportArchiveMatchesAssetData* _data_);
static Block44Data* block44_data_ref (Block44Data* _data44_);
static void block44_data_unref (void * _userdata_);
static gboolean _proton_plus_services_archive_workflow_support_archive_matches_asset_co_gsource_func (gpointer self);
static void __lambda19_ (Block44Data* _data44_);
static gboolean proton_plus_services_archive_workflow_support_parse_digest (const gchar* value,
                                                                     GChecksumType* checksum_type,
                                                                     gchar** expected_digest);
static gpointer ___lambda19__gthread_func (gpointer self);
static void proton_plus_services_archive_workflow_support_cleanup_path_data_free (gpointer _data);
static gboolean proton_plus_services_archive_workflow_support_cleanup_path_co (ProtonPlusServicesArchiveWorkflowSupportCleanupPathData* _data_);
static void proton_plus_services_archive_workflow_support_cleanup_path_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_);
static void proton_plus_services_archive_workflow_support_cleanup_data_free (gpointer _data);
static gboolean proton_plus_services_archive_workflow_support_cleanup_co (ProtonPlusServicesArchiveWorkflowSupportCleanupData* _data_);
static void proton_plus_services_archive_workflow_support_cleanup_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_);
VALA_EXTERN ProtonPlusServicesArchiveWorkflowSupport* proton_plus_services_archive_workflow_support_new (void);
VALA_EXTERN ProtonPlusServicesArchiveWorkflowSupport* proton_plus_services_archive_workflow_support_construct (GType object_type);
static GType proton_plus_services_archive_workflow_support_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
proton_plus_services_archive_operation_get_instance_private (ProtonPlusServicesArchiveOperation* self)
{
	return G_STRUCT_MEMBER_P (self, ProtonPlusServicesArchiveOperation_private_offset);
}

ProtonPlusServicesArchiveOperation*
proton_plus_services_archive_operation_construct (GType object_type,
                                                  const gchar* operation_path,
                                                  const gchar* archive_path,
                                                  const gchar* extension,
                                                  const gchar* cache_archive_path,
                                                  ProtonPlusModelsAssetsAsset* asset,
                                                  gboolean from_cache)
{
	ProtonPlusServicesArchiveOperation * self = NULL;
	g_return_val_if_fail (operation_path != NULL, NULL);
	g_return_val_if_fail (archive_path != NULL, NULL);
	g_return_val_if_fail (extension != NULL, NULL);
	g_return_val_if_fail (cache_archive_path != NULL, NULL);
	g_return_val_if_fail (asset != NULL, NULL);
	self = (ProtonPlusServicesArchiveOperation*) g_object_new (object_type, NULL);
	proton_plus_services_archive_operation_set_operation_path (self, operation_path);
	proton_plus_services_archive_operation_set_archive_path (self, archive_path);
	proton_plus_services_archive_operation_set_extension (self, extension);
	proton_plus_services_archive_operation_set_cache_archive_path (self, cache_archive_path);
	proton_plus_services_archive_operation_set_asset (self, asset);
	proton_plus_services_archive_operation_set_from_cache (self, from_cache);
	return self;
}

ProtonPlusServicesArchiveOperation*
proton_plus_services_archive_operation_new (const gchar* operation_path,
                                            const gchar* archive_path,
                                            const gchar* extension,
                                            const gchar* cache_archive_path,
                                            ProtonPlusModelsAssetsAsset* asset,
                                            gboolean from_cache)
{
	return proton_plus_services_archive_operation_construct (PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION, operation_path, archive_path, extension, cache_archive_path, asset, from_cache);
}

const gchar*
proton_plus_services_archive_operation_get_operation_path (ProtonPlusServicesArchiveOperation* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_operation_path;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_archive_operation_set_operation_path (ProtonPlusServicesArchiveOperation* self,
                                                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_archive_operation_get_operation_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_operation_path);
		self->priv->_operation_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_OPERATION_PATH_PROPERTY]);
	}
}

const gchar*
proton_plus_services_archive_operation_get_archive_path (ProtonPlusServicesArchiveOperation* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_archive_path;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_archive_operation_set_archive_path (ProtonPlusServicesArchiveOperation* self,
                                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_archive_operation_get_archive_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_archive_path);
		self->priv->_archive_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ARCHIVE_PATH_PROPERTY]);
	}
}

const gchar*
proton_plus_services_archive_operation_get_extension (ProtonPlusServicesArchiveOperation* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_extension;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_archive_operation_set_extension (ProtonPlusServicesArchiveOperation* self,
                                                      const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_archive_operation_get_extension (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_extension);
		self->priv->_extension = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_EXTENSION_PROPERTY]);
	}
}

const gchar*
proton_plus_services_archive_operation_get_cache_archive_path (ProtonPlusServicesArchiveOperation* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_cache_archive_path;
	result = _tmp0_;
	return result;
}

static void
proton_plus_services_archive_operation_set_cache_archive_path (ProtonPlusServicesArchiveOperation* self,
                                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_archive_operation_get_cache_archive_path (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_cache_archive_path);
		self->priv->_cache_archive_path = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_ARCHIVE_PATH_PROPERTY]);
	}
}

ProtonPlusModelsAssetsAsset*
proton_plus_services_archive_operation_get_asset (ProtonPlusServicesArchiveOperation* self)
{
	ProtonPlusModelsAssetsAsset* result;
	ProtonPlusModelsAssetsAsset* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_asset;
	result = _tmp0_;
	return result;
}

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

static void
proton_plus_services_archive_operation_set_asset (ProtonPlusServicesArchiveOperation* self,
                                                  ProtonPlusModelsAssetsAsset* value)
{
	ProtonPlusModelsAssetsAsset* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_archive_operation_get_asset (self);
	if (old_value != value) {
		ProtonPlusModelsAssetsAsset* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_asset);
		self->priv->_asset = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ASSET_PROPERTY]);
	}
}

gboolean
proton_plus_services_archive_operation_get_from_cache (ProtonPlusServicesArchiveOperation* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_from_cache;
	return result;
}

static void
proton_plus_services_archive_operation_set_from_cache (ProtonPlusServicesArchiveOperation* self,
                                                       gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_archive_operation_get_from_cache (self);
	if (old_value != value) {
		self->priv->_from_cache = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_FROM_CACHE_PROPERTY]);
	}
}

gboolean
proton_plus_services_archive_operation_get_cache_published (ProtonPlusServicesArchiveOperation* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_cache_published;
	return result;
}

void
proton_plus_services_archive_operation_set_cache_published (ProtonPlusServicesArchiveOperation* self,
                                                            gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_archive_operation_get_cache_published (self);
	if (old_value != value) {
		self->priv->_cache_published = value;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_PUBLISHED_PROPERTY]);
	}
}

const gchar*
proton_plus_services_archive_operation_get_staging_root (ProtonPlusServicesArchiveOperation* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_staging_root;
	result = _tmp0_;
	return result;
}

void
proton_plus_services_archive_operation_set_staging_root (ProtonPlusServicesArchiveOperation* self,
                                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = proton_plus_services_archive_operation_get_staging_root (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_staging_root);
		self->priv->_staging_root = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_STAGING_ROOT_PROPERTY]);
	}
}

static void
proton_plus_services_archive_operation_class_init (ProtonPlusServicesArchiveOperationClass * klass,
                                                   gpointer klass_data)
{
	proton_plus_services_archive_operation_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ProtonPlusServicesArchiveOperation_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_proton_plus_services_archive_operation_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_proton_plus_services_archive_operation_set_property;
	G_OBJECT_CLASS (klass)->finalize = proton_plus_services_archive_operation_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_OPERATION_PATH_PROPERTY, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_OPERATION_PATH_PROPERTY] = g_param_spec_string ("operation-path", "operation-path", "operation-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ARCHIVE_PATH_PROPERTY, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ARCHIVE_PATH_PROPERTY] = g_param_spec_string ("archive-path", "archive-path", "archive-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_EXTENSION_PROPERTY, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_EXTENSION_PROPERTY] = g_param_spec_string ("extension", "extension", "extension", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_ARCHIVE_PATH_PROPERTY, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_ARCHIVE_PATH_PROPERTY] = g_param_spec_string ("cache-archive-path", "cache-archive-path", "cache-archive-path", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ASSET_PROPERTY, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ASSET_PROPERTY] = g_param_spec_object ("asset", "asset", "asset", PROTON_PLUS_MODELS_ASSETS_TYPE_ASSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_FROM_CACHE_PROPERTY, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_FROM_CACHE_PROPERTY] = g_param_spec_boolean ("from-cache", "from-cache", "from-cache", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_PUBLISHED_PROPERTY, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_PUBLISHED_PROPERTY] = g_param_spec_boolean ("cache-published", "cache-published", "cache-published", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_STAGING_ROOT_PROPERTY, proton_plus_services_archive_operation_properties[PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_STAGING_ROOT_PROPERTY] = g_param_spec_string ("staging-root", "staging-root", "staging-root", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
proton_plus_services_archive_operation_instance_init (ProtonPlusServicesArchiveOperation * self,
                                                      gpointer klass)
{
	gchar* _tmp0_;
	self->priv = proton_plus_services_archive_operation_get_instance_private (self);
	self->priv->_cache_published = FALSE;
	_tmp0_ = g_strdup ("");
	self->priv->_staging_root = _tmp0_;
}

static void
proton_plus_services_archive_operation_finalize (GObject * obj)
{
	ProtonPlusServicesArchiveOperation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION, ProtonPlusServicesArchiveOperation);
	_g_free0 (self->priv->_operation_path);
	_g_free0 (self->priv->_archive_path);
	_g_free0 (self->priv->_extension);
	_g_free0 (self->priv->_cache_archive_path);
	_g_object_unref0 (self->priv->_asset);
	_g_free0 (self->priv->_staging_root);
	G_OBJECT_CLASS (proton_plus_services_archive_operation_parent_class)->finalize (obj);
}

static GType
proton_plus_services_archive_operation_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesArchiveOperationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_archive_operation_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesArchiveOperation), 0, (GInstanceInitFunc) proton_plus_services_archive_operation_instance_init, NULL };
	GType proton_plus_services_archive_operation_type_id;
	proton_plus_services_archive_operation_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesArchiveOperation", &g_define_type_info, 0);
	ProtonPlusServicesArchiveOperation_private_offset = g_type_add_instance_private (proton_plus_services_archive_operation_type_id, sizeof (ProtonPlusServicesArchiveOperationPrivate));
	return proton_plus_services_archive_operation_type_id;
}

GType
proton_plus_services_archive_operation_get_type (void)
{
	static volatile gsize proton_plus_services_archive_operation_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_archive_operation_type_id__once)) {
		GType proton_plus_services_archive_operation_type_id;
		proton_plus_services_archive_operation_type_id = proton_plus_services_archive_operation_get_type_once ();
		g_once_init_leave (&proton_plus_services_archive_operation_type_id__once, proton_plus_services_archive_operation_type_id);
	}
	return proton_plus_services_archive_operation_type_id__once;
}

static void
_vala_proton_plus_services_archive_operation_get_property (GObject * object,
                                                           guint property_id,
                                                           GValue * value,
                                                           GParamSpec * pspec)
{
	ProtonPlusServicesArchiveOperation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION, ProtonPlusServicesArchiveOperation);
	switch (property_id) {
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_OPERATION_PATH_PROPERTY:
		g_value_set_string (value, proton_plus_services_archive_operation_get_operation_path (self));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ARCHIVE_PATH_PROPERTY:
		g_value_set_string (value, proton_plus_services_archive_operation_get_archive_path (self));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_EXTENSION_PROPERTY:
		g_value_set_string (value, proton_plus_services_archive_operation_get_extension (self));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_ARCHIVE_PATH_PROPERTY:
		g_value_set_string (value, proton_plus_services_archive_operation_get_cache_archive_path (self));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ASSET_PROPERTY:
		g_value_set_object (value, proton_plus_services_archive_operation_get_asset (self));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_FROM_CACHE_PROPERTY:
		g_value_set_boolean (value, proton_plus_services_archive_operation_get_from_cache (self));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_PUBLISHED_PROPERTY:
		g_value_set_boolean (value, proton_plus_services_archive_operation_get_cache_published (self));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_STAGING_ROOT_PROPERTY:
		g_value_set_string (value, proton_plus_services_archive_operation_get_staging_root (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_proton_plus_services_archive_operation_set_property (GObject * object,
                                                           guint property_id,
                                                           const GValue * value,
                                                           GParamSpec * pspec)
{
	ProtonPlusServicesArchiveOperation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, PROTON_PLUS_SERVICES_TYPE_ARCHIVE_OPERATION, ProtonPlusServicesArchiveOperation);
	switch (property_id) {
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_OPERATION_PATH_PROPERTY:
		proton_plus_services_archive_operation_set_operation_path (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ARCHIVE_PATH_PROPERTY:
		proton_plus_services_archive_operation_set_archive_path (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_EXTENSION_PROPERTY:
		proton_plus_services_archive_operation_set_extension (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_ARCHIVE_PATH_PROPERTY:
		proton_plus_services_archive_operation_set_cache_archive_path (self, g_value_get_string (value));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_ASSET_PROPERTY:
		proton_plus_services_archive_operation_set_asset (self, g_value_get_object (value));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_FROM_CACHE_PROPERTY:
		proton_plus_services_archive_operation_set_from_cache (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_CACHE_PUBLISHED_PROPERTY:
		proton_plus_services_archive_operation_set_cache_published (self, g_value_get_boolean (value));
		break;
		case PROTON_PLUS_SERVICES_ARCHIVE_OPERATION_STAGING_ROOT_PROPERTY:
		proton_plus_services_archive_operation_set_staging_root (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
proton_plus_services_archive_workflow_support_prepare_archive_data_free (gpointer _data)
{
	ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->job);
	_g_free0 (_data_->operation_prefix);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData, _data_);
}

void
proton_plus_services_archive_workflow_support_prepare_archive (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                               ProtonPlusServicesInstallJob* job,
                                                               const gchar* operation_prefix,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData* _data_;
	ProtonPlusServicesArchiveWorkflowSupport* _tmp0_;
	ProtonPlusServicesInstallJob* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (job != NULL);
	g_return_if_fail (operation_prefix != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_archive_workflow_support_prepare_archive_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (job);
	_g_object_unref0 (_data_->job);
	_data_->job = _tmp1_;
	_tmp2_ = g_strdup (operation_prefix);
	_g_free0 (_data_->operation_prefix);
	_data_->operation_prefix = _tmp2_;
	proton_plus_services_archive_workflow_support_prepare_archive_co (_data_);
}

ProtonPlusReturnCode
proton_plus_services_archive_workflow_support_prepare_archive_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                      GAsyncResult* _res_,
                                                                      ProtonPlusServicesArchiveOperation** operation)
{
	ProtonPlusReturnCode result;
	ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	if (operation) {
		*operation = _data_->operation;
	} else {
		_g_object_unref0 (_data_->operation);
	}
	_data_->operation = NULL;
	result = _data_->result;
	return result;
}

static void
proton_plus_services_archive_workflow_support_prepare_archive_ready (GObject* source_object,
                                                                     GAsyncResult* _res_,
                                                                     gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_archive_workflow_support_prepare_archive_co (_data_);
}

static gboolean
proton_plus_services_archive_workflow_support_prepare_archive_co (ProtonPlusServicesArchiveWorkflowSupportPrepareArchiveData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		case 7:
		goto _state_7;
		case 8:
		goto _state_8;
		case 9:
		goto _state_9;
		case 10:
		goto _state_10;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_g_object_unref0 (_data_->operation);
	_data_->operation = NULL;
	_data_->_tmp0_ = proton_plus_services_install_job_get_selected_asset (_data_->job);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = proton_plus_models_assets_asset_get_name (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = proton_plus_utils_archive_helper_get_archive_extension (_data_->_tmp3_, TRUE);
	_data_->extension = _data_->_tmp4_;
	_data_->_tmp5_ = _data_->extension;
	if (_data_->_tmp5_ == NULL) {
		_data_->result = PROTON_PLUS_RETURN_CODE_UNSUPPORTED_EXTENSION;
		_g_free0 (_data_->extension);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = proton_plus_globals_CACHE_PATH;
	_data_->_tmp7_ = g_build_filename (_data_->_tmp6_, "archives", NULL);
	_data_->archive_cache_path = _data_->_tmp7_;
	_data_->_tmp8_ = _data_->archive_cache_path;
	_data_->_state_ = 1;
	proton_plus_utils_filesystem_create_directory_async (_data_->_tmp8_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
	return FALSE;
	_state_1:
	if (!proton_plus_utils_filesystem_create_directory_finish (_data_->_res_)) {
		_data_->result = PROTON_PLUS_RETURN_CODE_FILESYSTEM_ERROR;
		_g_free0 (_data_->archive_cache_path);
		_g_free0 (_data_->extension);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = proton_plus_globals_CACHE_PATH;
	_data_->_tmp10_ = proton_plus_utils_filesystem_create_temporary_directory (_data_->_tmp9_, _data_->operation_prefix);
	_data_->operation_path = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->operation_path;
	if (g_strcmp0 (_data_->_tmp11_, "") == 0) {
		_data_->result = PROTON_PLUS_RETURN_CODE_FILESYSTEM_ERROR;
		_g_free0 (_data_->operation_path);
		_g_free0 (_data_->archive_cache_path);
		_g_free0 (_data_->extension);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp12_ = proton_plus_services_install_job_get_selected_asset (_data_->job);
	_data_->_tmp13_ = _data_->_tmp12_;
	_data_->_tmp14_ = proton_plus_models_assets_asset_get_download_url (_data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_data_->_tmp16_ = g_compute_checksum_for_string (G_CHECKSUM_SHA256, _data_->_tmp15_, (gsize) -1);
	_data_->archive_key = _data_->_tmp16_;
	_data_->_tmp17_ = _data_->archive_cache_path;
	_data_->_tmp18_ = _data_->archive_key;
	_data_->_tmp19_ = _data_->extension;
	_data_->_tmp20_ = g_strdup_printf ("%s%s", _data_->_tmp18_, _data_->_tmp19_);
	_data_->_tmp21_ = _data_->_tmp20_;
	_data_->_tmp22_ = g_build_filename (_data_->_tmp17_, _data_->_tmp21_, NULL);
	_data_->_tmp23_ = _data_->_tmp22_;
	_g_free0 (_data_->_tmp21_);
	_data_->cache_archive_path = _data_->_tmp23_;
	_data_->_tmp24_ = _data_->operation_path;
	_data_->_tmp25_ = _data_->extension;
	_data_->_tmp26_ = g_strdup_printf ("archive%s", _data_->_tmp25_);
	_data_->_tmp27_ = _data_->_tmp26_;
	_data_->_tmp28_ = g_build_filename (_data_->_tmp24_, _data_->_tmp27_, NULL);
	_data_->_tmp29_ = _data_->_tmp28_;
	_g_free0 (_data_->_tmp27_);
	_data_->operation_archive_path = _data_->_tmp29_;
	_data_->_tmp30_ = _data_->cache_archive_path;
	_data_->cache_available = g_file_test (_data_->_tmp30_, G_FILE_TEST_IS_REGULAR);
	if (_data_->cache_available) {
		_data_->_tmp32_ = _data_->cache_archive_path;
		_data_->_tmp33_ = proton_plus_services_install_job_get_selected_asset (_data_->job);
		_data_->_tmp34_ = _data_->_tmp33_;
		_data_->_state_ = 2;
		proton_plus_services_archive_workflow_support_archive_matches_asset (_data_->self, _data_->_tmp32_, _data_->_tmp34_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp31_ = !proton_plus_services_archive_workflow_support_archive_matches_asset_finish (_data_->self, _data_->_res_);
	} else {
		_data_->_tmp31_ = FALSE;
	}
	if (_data_->_tmp31_) {
		_data_->_tmp35_ = _data_->cache_archive_path;
		g_debug ("archive-workflow-support.vala:56: Discarding archive cache entry that " \
"failed integrity validation: %s", _data_->_tmp35_);
		_data_->_tmp36_ = _data_->cache_archive_path;
		if (!proton_plus_utils_filesystem_delete_file (_data_->_tmp36_)) {
			_data_->_tmp37_ = _data_->operation_path;
			_data_->_state_ = 3;
			proton_plus_services_archive_workflow_support_cleanup_path (_data_->self, _data_->_tmp37_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
			return FALSE;
			_state_3:
			proton_plus_services_archive_workflow_support_cleanup_path_finish (_data_->self, _data_->_res_);
			_data_->result = PROTON_PLUS_RETURN_CODE_FILESYSTEM_ERROR;
			_g_free0 (_data_->operation_archive_path);
			_g_free0 (_data_->cache_archive_path);
			_g_free0 (_data_->archive_key);
			_g_free0 (_data_->operation_path);
			_g_free0 (_data_->archive_cache_path);
			_g_free0 (_data_->extension);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->cache_available = FALSE;
	}
	_data_->_tmp38_ = _data_->operation_path;
	_data_->_tmp39_ = _data_->operation_archive_path;
	_data_->_tmp40_ = _data_->extension;
	_data_->_tmp41_ = _data_->cache_archive_path;
	_data_->_tmp42_ = proton_plus_services_install_job_get_selected_asset (_data_->job);
	_data_->_tmp43_ = _data_->_tmp42_;
	_data_->_tmp44_ = proton_plus_services_archive_operation_new (_data_->_tmp38_, _data_->_tmp39_, _data_->_tmp40_, _data_->_tmp41_, _data_->_tmp43_, _data_->cache_available);
	_data_->created = _data_->_tmp44_;
	proton_plus_services_install_job_set_step (_data_->job, PROTON_PLUS_SERVICES_INSTALL_JOB_STEP_DOWNLOADING);
	if (!_data_->cache_available) {
		_data_->_tmp45_ = proton_plus_services_install_job_get_selected_asset (_data_->job);
		_data_->_tmp46_ = _data_->_tmp45_;
		_data_->_tmp47_ = proton_plus_models_assets_asset_get_download_url (_data_->_tmp46_);
		_data_->_tmp48_ = _data_->_tmp47_;
		_data_->_tmp49_ = _data_->operation_archive_path;
		_data_->_tmp50_ = NULL;
		_data_->_state_ = 4;
		proton_plus_services_install_job_download_archive (_data_->job, _data_->_tmp48_, _data_->_tmp49_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
		return FALSE;
		_state_4:
		_data_->_tmp51_ = proton_plus_services_install_job_download_archive_finish (_data_->job, _data_->_res_, &_data_->_tmp50_);
		_g_free0 (_data_->download_error);
		_data_->download_error = _data_->_tmp50_;
		_data_->downloaded = _data_->_tmp51_;
		if (!_data_->downloaded) {
			_data_->_tmp52_ = _data_->download_error;
			proton_plus_services_install_job_set_error_message (_data_->job, _data_->_tmp52_);
			_data_->_tmp53_ = _data_->created;
			_data_->_state_ = 5;
			proton_plus_services_archive_workflow_support_cleanup (_data_->self, _data_->_tmp53_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
			return FALSE;
			_state_5:
			proton_plus_services_archive_workflow_support_cleanup_finish (_data_->self, _data_->_res_);
			_data_->result = PROTON_PLUS_RETURN_CODE_DOWNLOAD_FAILED;
			_g_free0 (_data_->download_error);
			_g_object_unref0 (_data_->created);
			_g_free0 (_data_->operation_archive_path);
			_g_free0 (_data_->cache_archive_path);
			_g_free0 (_data_->archive_key);
			_g_free0 (_data_->operation_path);
			_g_free0 (_data_->archive_cache_path);
			_g_free0 (_data_->extension);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp54_ = _data_->operation_archive_path;
		_data_->_tmp55_ = proton_plus_services_install_job_get_selected_asset (_data_->job);
		_data_->_tmp56_ = _data_->_tmp55_;
		_data_->_state_ = 6;
		proton_plus_services_archive_workflow_support_archive_matches_asset (_data_->self, _data_->_tmp54_, _data_->_tmp56_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
		return FALSE;
		_state_6:
		if (!proton_plus_services_archive_workflow_support_archive_matches_asset_finish (_data_->self, _data_->_res_)) {
			_data_->_tmp57_ = proton_plus_services_install_job_get_selected_asset (_data_->job);
			_data_->_tmp58_ = _data_->_tmp57_;
			_data_->_tmp59_ = proton_plus_models_assets_asset_get_download_url (_data_->_tmp58_);
			_data_->_tmp60_ = _data_->_tmp59_;
			g_debug ("archive-workflow-support.vala:82: Downloaded archive failed integrity " \
"validation: %s", _data_->_tmp60_);
			_data_->_tmp61_ = _data_->created;
			_data_->_state_ = 7;
			proton_plus_services_archive_workflow_support_cleanup (_data_->self, _data_->_tmp61_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
			return FALSE;
			_state_7:
			proton_plus_services_archive_workflow_support_cleanup_finish (_data_->self, _data_->_res_);
			_data_->result = PROTON_PLUS_RETURN_CODE_DOWNLOAD_FAILED;
			_g_free0 (_data_->download_error);
			_g_object_unref0 (_data_->created);
			_g_free0 (_data_->operation_archive_path);
			_g_free0 (_data_->cache_archive_path);
			_g_free0 (_data_->archive_key);
			_g_free0 (_data_->operation_path);
			_g_free0 (_data_->archive_cache_path);
			_g_free0 (_data_->extension);
			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;
		}
		_g_free0 (_data_->download_error);
	} else {
		_data_->_tmp62_ = _data_->cache_archive_path;
		_data_->_tmp63_ = _data_->operation_archive_path;
		_data_->_state_ = 8;
		proton_plus_utils_filesystem_copy_file (_data_->_tmp62_, _data_->_tmp63_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
		return FALSE;
		_state_8:
		if (!proton_plus_utils_filesystem_copy_file_finish (_data_->_res_)) {
			_data_->_tmp64_ = _data_->created;
			_data_->_state_ = 9;
			proton_plus_services_archive_workflow_support_cleanup (_data_->self, _data_->_tmp64_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
			return FALSE;
			_state_9:
			proton_plus_services_archive_workflow_support_cleanup_finish (_data_->self, _data_->_res_);
			_data_->result = PROTON_PLUS_RETURN_CODE_FILESYSTEM_ERROR;
			_g_object_unref0 (_data_->created);
			_g_free0 (_data_->operation_archive_path);
			_g_free0 (_data_->cache_archive_path);
			_g_free0 (_data_->archive_key);
			_g_free0 (_data_->operation_path);
			_g_free0 (_data_->archive_cache_path);
			_g_free0 (_data_->extension);
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
			if (_data_->_state_ != 0) {
				while (!g_task_get_completed (_data_->_async_result)) {
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
				}
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_data_->_tmp65_ = proton_plus_services_install_job_get_canceled (_data_->job);
	_data_->_tmp66_ = _data_->_tmp65_;
	if (_data_->_tmp66_) {
		_data_->_tmp67_ = _data_->created;
		_data_->_state_ = 10;
		proton_plus_services_archive_workflow_support_cleanup (_data_->self, _data_->_tmp67_, proton_plus_services_archive_workflow_support_prepare_archive_ready, _data_);
		return FALSE;
		_state_10:
		proton_plus_services_archive_workflow_support_cleanup_finish (_data_->self, _data_->_res_);
		_data_->result = PROTON_PLUS_RETURN_CODE_EXTRACTION_FAILED;
		_g_object_unref0 (_data_->created);
		_g_free0 (_data_->operation_archive_path);
		_g_free0 (_data_->cache_archive_path);
		_g_free0 (_data_->archive_key);
		_g_free0 (_data_->operation_path);
		_g_free0 (_data_->archive_cache_path);
		_g_free0 (_data_->extension);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp68_ = _data_->created;
	_data_->_tmp69_ = _g_object_ref0 (_data_->_tmp68_);
	_g_object_unref0 (_data_->operation);
	_data_->operation = _data_->_tmp69_;
	_data_->result = PROTON_PLUS_RETURN_CODE_RUNNER_INSTALLED;
	_g_object_unref0 (_data_->created);
	_g_free0 (_data_->operation_archive_path);
	_g_free0 (_data_->cache_archive_path);
	_g_free0 (_data_->archive_key);
	_g_free0 (_data_->operation_path);
	_g_free0 (_data_->archive_cache_path);
	_g_free0 (_data_->extension);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_services_archive_workflow_support_publish_archive_data_free (gpointer _data)
{
	ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->operation);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData, _data_);
}

void
proton_plus_services_archive_workflow_support_publish_archive (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                               ProtonPlusServicesArchiveOperation* operation,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData* _data_;
	ProtonPlusServicesArchiveWorkflowSupport* _tmp0_;
	ProtonPlusServicesArchiveOperation* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (operation != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_archive_workflow_support_publish_archive_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (operation);
	_g_object_unref0 (_data_->operation);
	_data_->operation = _tmp1_;
	proton_plus_services_archive_workflow_support_publish_archive_co (_data_);
}

gboolean
proton_plus_services_archive_workflow_support_publish_archive_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                      GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_services_archive_workflow_support_publish_archive_ready (GObject* source_object,
                                                                     GAsyncResult* _res_,
                                                                     gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_archive_workflow_support_publish_archive_co (_data_);
}

static gboolean
proton_plus_services_archive_workflow_support_publish_archive_co (ProtonPlusServicesArchiveWorkflowSupportPublishArchiveData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = proton_plus_services_archive_operation_get_from_cache (_data_->operation);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_) {
		_data_->_tmp0_ = TRUE;
	} else {
		_data_->_tmp3_ = proton_plus_services_archive_operation_get_cache_published (_data_->operation);
		_data_->_tmp4_ = _data_->_tmp3_;
		_data_->_tmp0_ = _data_->_tmp4_;
	}
	if (_data_->_tmp0_) {
		_data_->result = TRUE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = proton_plus_services_archive_operation_get_archive_path (_data_->operation);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_state_ = 1;
	proton_plus_utils_filesystem_move_file_atomic_if_absent (_data_->_tmp6_, _data_->_tmp8_, proton_plus_services_archive_workflow_support_publish_archive_ready, _data_);
	return FALSE;
	_state_1:
	if (proton_plus_utils_filesystem_move_file_atomic_if_absent_finish (_data_->_res_)) {
		proton_plus_services_archive_operation_set_cache_published (_data_->operation, TRUE);
		_data_->result = TRUE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp9_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = proton_plus_services_archive_operation_get_asset (_data_->operation);
	_data_->_tmp12_ = _data_->_tmp11_;
	_data_->_state_ = 2;
	proton_plus_services_archive_workflow_support_archive_matches_asset (_data_->self, _data_->_tmp10_, _data_->_tmp12_, proton_plus_services_archive_workflow_support_publish_archive_ready, _data_);
	return FALSE;
	_state_2:
	if (proton_plus_services_archive_workflow_support_archive_matches_asset_finish (_data_->self, _data_->_res_)) {
		_data_->result = TRUE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp14_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
	_data_->_tmp15_ = _data_->_tmp14_;
	if (g_file_test (_data_->_tmp15_, G_FILE_TEST_EXISTS)) {
		_data_->_tmp16_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_tmp13_ = !proton_plus_utils_filesystem_delete_file (_data_->_tmp17_);
	} else {
		_data_->_tmp13_ = FALSE;
	}
	if (_data_->_tmp13_) {
		_data_->result = FALSE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp18_ = proton_plus_services_archive_operation_get_archive_path (_data_->operation);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
	_data_->_tmp21_ = _data_->_tmp20_;
	_data_->_state_ = 3;
	proton_plus_utils_filesystem_move_file_atomic_if_absent (_data_->_tmp19_, _data_->_tmp21_, proton_plus_services_archive_workflow_support_publish_archive_ready, _data_);
	return FALSE;
	_state_3:
	if (proton_plus_utils_filesystem_move_file_atomic_if_absent_finish (_data_->_res_)) {
		proton_plus_services_archive_operation_set_cache_published (_data_->operation, TRUE);
		_data_->result = TRUE;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp22_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
	_data_->_tmp23_ = _data_->_tmp22_;
	_data_->_tmp24_ = proton_plus_services_archive_operation_get_asset (_data_->operation);
	_data_->_tmp25_ = _data_->_tmp24_;
	_data_->_state_ = 4;
	proton_plus_services_archive_workflow_support_archive_matches_asset (_data_->self, _data_->_tmp23_, _data_->_tmp25_, proton_plus_services_archive_workflow_support_publish_archive_ready, _data_);
	return FALSE;
	_state_4:
	_data_->result = proton_plus_services_archive_workflow_support_archive_matches_asset_finish (_data_->self, _data_->_res_);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_services_archive_workflow_support_complete_attempt_data_free (gpointer _data)
{
	ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->operation);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData, _data_);
}

void
proton_plus_services_archive_workflow_support_complete_attempt (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                ProtonPlusReturnCode code,
                                                                ProtonPlusServicesArchiveOperation* operation,
                                                                gboolean discard_cached_archive,
                                                                GAsyncReadyCallback _callback_,
                                                                gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData* _data_;
	ProtonPlusServicesArchiveWorkflowSupport* _tmp0_;
	ProtonPlusServicesArchiveOperation* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (operation != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_archive_workflow_support_complete_attempt_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->code = code;
	_tmp1_ = _g_object_ref0 (operation);
	_g_object_unref0 (_data_->operation);
	_data_->operation = _tmp1_;
	_data_->discard_cached_archive = discard_cached_archive;
	proton_plus_services_archive_workflow_support_complete_attempt_co (_data_);
}

ProtonPlusReturnCode
proton_plus_services_archive_workflow_support_complete_attempt_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                       GAsyncResult* _res_)
{
	ProtonPlusReturnCode result;
	ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
proton_plus_services_archive_workflow_support_complete_attempt_ready (GObject* source_object,
                                                                      GAsyncResult* _res_,
                                                                      gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_archive_workflow_support_complete_attempt_co (_data_);
}

static gboolean
proton_plus_services_archive_workflow_support_complete_attempt_co (ProtonPlusServicesArchiveWorkflowSupportCompleteAttemptData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_result_ = _data_->code;
	if (_data_->discard_cached_archive) {
		_data_->_tmp2_ = proton_plus_services_archive_operation_get_from_cache (_data_->operation);
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp1_ = _data_->_tmp3_;
	} else {
		_data_->_tmp1_ = FALSE;
	}
	if (_data_->_tmp1_) {
		_data_->_tmp4_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp0_ = g_file_test (_data_->_tmp5_, G_FILE_TEST_IS_REGULAR);
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		_data_->_tmp6_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
		_data_->_tmp7_ = _data_->_tmp6_;
		g_debug ("archive-workflow-support.vala:136: Discarding archive cache entry afte" \
"r validation failure: %s", _data_->_tmp7_);
		_data_->_tmp8_ = proton_plus_services_archive_operation_get_cache_archive_path (_data_->operation);
		_data_->_tmp9_ = _data_->_tmp8_;
		if (!proton_plus_utils_filesystem_delete_file (_data_->_tmp9_)) {
			_data_->_result_ = PROTON_PLUS_RETURN_CODE_FILESYSTEM_ERROR;
		}
	}
	_data_->_state_ = 1;
	proton_plus_services_archive_workflow_support_cleanup (_data_->self, _data_->operation, proton_plus_services_archive_workflow_support_complete_attempt_ready, _data_);
	return FALSE;
	_state_1:
	proton_plus_services_archive_workflow_support_cleanup_finish (_data_->self, _data_->_res_);
	_data_->result = _data_->_result_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
proton_plus_services_archive_workflow_support_archive_matches_asset (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                     const gchar* path,
                                                                     ProtonPlusModelsAssetsAsset* asset,
                                                                     GAsyncReadyCallback _callback_,
                                                                     gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportArchiveMatchesAssetData* _data_;
	ProtonPlusServicesArchiveWorkflowSupport* _tmp0_;
	gchar* _tmp1_;
	ProtonPlusModelsAssetsAsset* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (asset != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesArchiveWorkflowSupportArchiveMatchesAssetData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_archive_workflow_support_archive_matches_asset_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (path);
	_g_free0 (_data_->path);
	_data_->path = _tmp1_;
	_tmp2_ = _g_object_ref0 (asset);
	_g_object_unref0 (_data_->asset);
	_data_->asset = _tmp2_;
	proton_plus_services_archive_workflow_support_archive_matches_asset_co (_data_);
}

static gboolean
proton_plus_services_archive_workflow_support_archive_matches_asset_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                            GAsyncResult* _res_)
{
	gboolean result;
	ProtonPlusServicesArchiveWorkflowSupportArchiveMatchesAssetData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static Block44Data*
block44_data_ref (Block44Data* _data44_)
{
	g_atomic_int_inc (&_data44_->_ref_count_);
	return _data44_;
}

static void
block44_data_unref (void * _userdata_)
{
	Block44Data* _data44_;
	_data44_ = (Block44Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data44_->_ref_count_)) {
		ProtonPlusServicesArchiveWorkflowSupport* self;
		self = _data44_->self;
		(_data44_->callback_target_destroy_notify == NULL) ? NULL : (_data44_->callback_target_destroy_notify (_data44_->callback_target), NULL);
		_data44_->callback = NULL;
		_data44_->callback_target = NULL;
		_data44_->callback_target_destroy_notify = NULL;
		_g_free0 (_data44_->path);
		_g_object_unref0 (_data44_->asset);
		_g_object_unref0 (self);
		g_slice_free (Block44Data, _data44_);
	}
}

static gboolean
_proton_plus_services_archive_workflow_support_archive_matches_asset_co_gsource_func (gpointer self)
{
	gboolean result;
	result = proton_plus_services_archive_workflow_support_archive_matches_asset_co (self);
	return result;
}

static void
__lambda19_ (Block44Data* _data44_)
{
	ProtonPlusServicesArchiveWorkflowSupport* self;
	GSourceFunc _tmp37_;
	gpointer _tmp37__target;
	GDestroyNotify _tmp37__target_destroy_notify;
	GError* _inner_error0_ = NULL;
	self = _data44_->self;
	{
		GFile* file = NULL;
		GFile* _tmp0_;
		GFileInfo* info = NULL;
		GFile* _tmp1_;
		GFileInfo* _tmp2_;
		GFileInfo* _tmp3_;
		gboolean _tmp5_ = FALSE;
		gint64 _tmp6_;
		gint64 _tmp7_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		GChecksumType checksum_type = 0;
		gchar* expected_digest = NULL;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		GChecksumType _tmp17_ = 0;
		gchar* _tmp18_ = NULL;
		gboolean _tmp19_;
		GChecksum* checksum = NULL;
		GChecksum* _tmp21_;
		GFileInputStream* stream = NULL;
		GFile* _tmp22_;
		GFileInputStream* _tmp23_;
		guint8* buffer = NULL;
		guint8* _tmp24_;
		gint buffer_length1;
		gint _buffer_size_;
		gssize bytes_read = 0L;
		GChecksum* _tmp30_;
		const gchar* _tmp31_;
		gchar* _tmp32_;
		gchar* _tmp33_;
		const gchar* _tmp34_;
		_tmp0_ = g_file_new_for_path (_data44_->path);
		file = _tmp0_;
		_tmp1_ = file;
		_tmp2_ = g_file_query_info (_tmp1_, "standard::type,standard::size", G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL, &_inner_error0_);
		info = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (file);
			goto __catch0_g_error;
		}
		_tmp3_ = info;
		if (g_file_info_get_file_type (_tmp3_) != G_FILE_TYPE_REGULAR) {
			GSourceFunc _tmp4_;
			gpointer _tmp4__target;
			GDestroyNotify _tmp4__target_destroy_notify;
			_tmp4_ = _data44_->callback;
			_tmp4__target = _data44_->callback_target;
			_tmp4__target_destroy_notify = _data44_->callback_target_destroy_notify;
			_data44_->callback = NULL;
			_data44_->callback_target = NULL;
			_data44_->callback_target_destroy_notify = NULL;
			g_idle_add_full (G_PRIORITY_DEFAULT, _tmp4_, _tmp4__target, _tmp4__target_destroy_notify);
			_g_object_unref0 (info);
			_g_object_unref0 (file);
			return;
		}
		_tmp6_ = proton_plus_models_assets_asset_get_download_size (_data44_->asset);
		_tmp7_ = _tmp6_;
		if (_tmp7_ > ((gint64) 0)) {
			GFileInfo* _tmp8_;
			gint64 _tmp9_;
			gint64 _tmp10_;
			_tmp8_ = info;
			_tmp9_ = proton_plus_models_assets_asset_get_download_size (_data44_->asset);
			_tmp10_ = _tmp9_;
			_tmp5_ = g_file_info_get_size (_tmp8_) != _tmp10_;
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			GSourceFunc _tmp11_;
			gpointer _tmp11__target;
			GDestroyNotify _tmp11__target_destroy_notify;
			_tmp11_ = _data44_->callback;
			_tmp11__target = _data44_->callback_target;
			_tmp11__target_destroy_notify = _data44_->callback_target_destroy_notify;
			_data44_->callback = NULL;
			_data44_->callback_target = NULL;
			_data44_->callback_target_destroy_notify = NULL;
			g_idle_add_full (G_PRIORITY_DEFAULT, _tmp11_, _tmp11__target, _tmp11__target_destroy_notify);
			_g_object_unref0 (info);
			_g_object_unref0 (file);
			return;
		}
		_tmp12_ = proton_plus_models_assets_asset_get_digest (_data44_->asset);
		_tmp13_ = _tmp12_;
		if (g_strcmp0 (_tmp13_, "") == 0) {
			GSourceFunc _tmp14_;
			gpointer _tmp14__target;
			GDestroyNotify _tmp14__target_destroy_notify;
			_data44_->matches = TRUE;
			_tmp14_ = _data44_->callback;
			_tmp14__target = _data44_->callback_target;
			_tmp14__target_destroy_notify = _data44_->callback_target_destroy_notify;
			_data44_->callback = NULL;
			_data44_->callback_target = NULL;
			_data44_->callback_target_destroy_notify = NULL;
			g_idle_add_full (G_PRIORITY_DEFAULT, _tmp14_, _tmp14__target, _tmp14__target_destroy_notify);
			_g_object_unref0 (info);
			_g_object_unref0 (file);
			return;
		}
		_tmp15_ = proton_plus_models_assets_asset_get_digest (_data44_->asset);
		_tmp16_ = _tmp15_;
		_tmp19_ = proton_plus_services_archive_workflow_support_parse_digest (_tmp16_, &_tmp17_, &_tmp18_);
		checksum_type = _tmp17_;
		_g_free0 (expected_digest);
		expected_digest = _tmp18_;
		if (!_tmp19_) {
			GSourceFunc _tmp20_;
			gpointer _tmp20__target;
			GDestroyNotify _tmp20__target_destroy_notify;
			_tmp20_ = _data44_->callback;
			_tmp20__target = _data44_->callback_target;
			_tmp20__target_destroy_notify = _data44_->callback_target_destroy_notify;
			_data44_->callback = NULL;
			_data44_->callback_target = NULL;
			_data44_->callback_target_destroy_notify = NULL;
			g_idle_add_full (G_PRIORITY_DEFAULT, _tmp20_, _tmp20__target, _tmp20__target_destroy_notify);
			_g_free0 (expected_digest);
			_g_object_unref0 (info);
			_g_object_unref0 (file);
			return;
		}
		_tmp21_ = g_checksum_new (checksum_type);
		checksum = _tmp21_;
		_tmp22_ = file;
		_tmp23_ = g_file_read (_tmp22_, NULL, &_inner_error0_);
		stream = _tmp23_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_checksum_free0 (checksum);
			_g_free0 (expected_digest);
			_g_object_unref0 (info);
			_g_object_unref0 (file);
			goto __catch0_g_error;
		}
		_tmp24_ = g_new0 (guint8, 64 * 1024);
		buffer = _tmp24_;
		buffer_length1 = 64 * 1024;
		_buffer_size_ = buffer_length1;
		while (TRUE) {
			gssize _tmp25_ = 0L;
			GFileInputStream* _tmp26_;
			guint8* _tmp27_;
			gint _tmp27__length1;
			GChecksum* _tmp28_;
			guint8* _tmp29_;
			gint _tmp29__length1;
			_tmp26_ = stream;
			_tmp27_ = buffer;
			_tmp27__length1 = buffer_length1;
			_tmp25_ = g_input_stream_read ((GInputStream*) _tmp26_, _tmp27_, (gsize) _tmp27__length1, NULL, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				buffer = (g_free (buffer), NULL);
				_g_object_unref0 (stream);
				_g_checksum_free0 (checksum);
				_g_free0 (expected_digest);
				_g_object_unref0 (info);
				_g_object_unref0 (file);
				goto __catch0_g_error;
			}
			bytes_read = _tmp25_;
			if (!(bytes_read > ((gssize) 0))) {
				break;
			}
			_tmp28_ = checksum;
			_tmp29_ = buffer;
			_tmp29__length1 = buffer_length1;
			g_checksum_update (_tmp28_, _tmp29_, (gsize) bytes_read);
		}
		_tmp30_ = checksum;
		_tmp31_ = g_checksum_get_string (_tmp30_);
		_tmp32_ = g_utf8_strdown (_tmp31_, (gssize) -1);
		_tmp33_ = _tmp32_;
		_tmp34_ = expected_digest;
		_data44_->matches = g_strcmp0 (_tmp33_, _tmp34_) == 0;
		_g_free0 (_tmp33_);
		buffer = (g_free (buffer), NULL);
		_g_object_unref0 (stream);
		_g_checksum_free0 (checksum);
		_g_free0 (expected_digest);
		_g_object_unref0 (info);
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp35_;
		const gchar* _tmp36_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp35_ = e;
		_tmp36_ = _tmp35_->message;
		g_debug ("archive-workflow-support.vala:185: Could not validate archive %s: %s", _data44_->path, _tmp36_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	_tmp37_ = _data44_->callback;
	_tmp37__target = _data44_->callback_target;
	_tmp37__target_destroy_notify = _data44_->callback_target_destroy_notify;
	_data44_->callback = NULL;
	_data44_->callback_target = NULL;
	_data44_->callback_target_destroy_notify = NULL;
	g_idle_add_full (G_PRIORITY_DEFAULT, _tmp37_, _tmp37__target, _tmp37__target_destroy_notify);
}

static gpointer
___lambda19__gthread_func (gpointer self)
{
	gpointer result;
	__lambda19_ (self);
	result = NULL;
	block44_data_unref (self);
	return result;
}

static gboolean
proton_plus_services_archive_workflow_support_archive_matches_asset_co (ProtonPlusServicesArchiveWorkflowSupportArchiveMatchesAssetData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data44_ = g_slice_new0 (Block44Data);
	_data_->_data44_->_ref_count_ = 1;
	_data_->_data44_->self = g_object_ref (_data_->self);
	_g_free0 (_data_->_data44_->path);
	_data_->_data44_->path = _data_->path;
	_g_object_unref0 (_data_->_data44_->asset);
	_data_->_data44_->asset = _data_->asset;
	_data_->_data44_->_async_data_ = _data_;
	_data_->_data44_->callback = _proton_plus_services_archive_workflow_support_archive_matches_asset_co_gsource_func;
	_data_->_data44_->callback_target = _data_;
	_data_->_data44_->callback_target_destroy_notify = NULL;
	_data_->_data44_->matches = FALSE;
	_data_->_tmp0_ = g_thread_new ("verify_archive", ___lambda19__gthread_func, block44_data_ref (_data_->_data44_));
	_data_->_tmp1_ = _data_->_tmp0_;
	_g_thread_unref0 (_data_->_tmp1_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	_data_->result = _data_->_data44_->matches;
	block44_data_unref (_data_->_data44_);
	_data_->_data44_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static gboolean
proton_plus_services_archive_workflow_support_parse_digest (const gchar* value,
                                                            GChecksumType* checksum_type,
                                                            gchar** expected_digest)
{
	GChecksumType _vala_checksum_type = 0;
	gchar* _vala_expected_digest = NULL;
	gchar* _tmp0_;
	gchar** parts = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gint parts_length1;
	gint _parts_size_;
	gboolean _tmp6_ = FALSE;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gchar** _tmp10_;
	gint _tmp10__length1;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	GQuark _tmp14_ = 0U;
	static GQuark _tmp13_label0 = 0;
	static GQuark _tmp13_label1 = 0;
	static GQuark _tmp13_label2 = 0;
	static GQuark _tmp13_label3 = 0;
	static GQuark _tmp13_label4 = 0;
	gchar** _tmp15_;
	gint _tmp15__length1;
	const gchar* _tmp16_;
	guint8* _tmp17_;
	gint _tmp17__length1;
	gint _tmp18_ = 0;
	guint8* _tmp19_;
	gint _tmp19__length1;
	gchar** _tmp23_;
	gint _tmp23__length1;
	const gchar* _tmp24_;
	gchar* _tmp25_;
	gboolean result;
	g_return_val_if_fail (value != NULL, FALSE);
	_vala_checksum_type = G_CHECKSUM_SHA256;
	_tmp0_ = g_strdup ("");
	_g_free0 (_vala_expected_digest);
	_vala_expected_digest = _tmp0_;
	_tmp1_ = g_utf8_strdown (value, (gssize) -1);
	_tmp2_ = _tmp1_;
	_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, ":", 2);
	_tmp5_ = _tmp4_;
	_tmp5__length1 = _vala_array_length (_tmp3_);
	_g_free0 (_tmp2_);
	parts = _tmp5_;
	parts_length1 = _tmp5__length1;
	_parts_size_ = parts_length1;
	_tmp7_ = parts;
	_tmp7__length1 = parts_length1;
	if (_tmp7__length1 != 2) {
		_tmp6_ = TRUE;
	} else {
		gchar** _tmp8_;
		gint _tmp8__length1;
		const gchar* _tmp9_;
		_tmp8_ = parts;
		_tmp8__length1 = parts_length1;
		_tmp9_ = _tmp8_[1];
		_tmp6_ = g_strcmp0 (_tmp9_, "") == 0;
	}
	if (_tmp6_) {
		result = FALSE;
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
		if (checksum_type) {
			*checksum_type = _vala_checksum_type;
		}
		if (expected_digest) {
			*expected_digest = _vala_expected_digest;
		} else {
			_g_free0 (_vala_expected_digest);
		}
		return result;
	}
	_tmp10_ = parts;
	_tmp10__length1 = parts_length1;
	_tmp11_ = _tmp10_[0];
	_tmp12_ = _tmp11_;
	_tmp14_ = (NULL == _tmp12_) ? 0 : g_quark_from_string (_tmp12_);
	if (_tmp14_ == ((0 != _tmp13_label0) ? _tmp13_label0 : (_tmp13_label0 = g_quark_from_static_string ("md5")))) {
		switch (0) {
			default:
			{
				_vala_checksum_type = G_CHECKSUM_MD5;
				break;
			}
		}
	} else if (_tmp14_ == ((0 != _tmp13_label1) ? _tmp13_label1 : (_tmp13_label1 = g_quark_from_static_string ("sha1")))) {
		switch (0) {
			default:
			{
				_vala_checksum_type = G_CHECKSUM_SHA1;
				break;
			}
		}
	} else if (_tmp14_ == ((0 != _tmp13_label2) ? _tmp13_label2 : (_tmp13_label2 = g_quark_from_static_string ("sha256")))) {
		switch (0) {
			default:
			{
				_vala_checksum_type = G_CHECKSUM_SHA256;
				break;
			}
		}
	} else if (_tmp14_ == ((0 != _tmp13_label3) ? _tmp13_label3 : (_tmp13_label3 = g_quark_from_static_string ("sha384")))) {
		switch (0) {
			default:
			{
				_vala_checksum_type = G_CHECKSUM_SHA384;
				break;
			}
		}
	} else if (_tmp14_ == ((0 != _tmp13_label4) ? _tmp13_label4 : (_tmp13_label4 = g_quark_from_static_string ("sha512")))) {
		switch (0) {
			default:
			{
				_vala_checksum_type = G_CHECKSUM_SHA512;
				break;
			}
		}
	} else {
		switch (0) {
			default:
			{
				result = FALSE;
				parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
				if (checksum_type) {
					*checksum_type = _vala_checksum_type;
				}
				if (expected_digest) {
					*expected_digest = _vala_expected_digest;
				} else {
					_g_free0 (_vala_expected_digest);
				}
				return result;
			}
		}
	}
	_tmp15_ = parts;
	_tmp15__length1 = parts_length1;
	_tmp16_ = _tmp15_[1];
	_tmp17_ = string_get_data (_tmp16_, &_tmp18_);
	_tmp17__length1 = _tmp18_;
	_tmp19_ = _tmp17_;
	_tmp19__length1 = _tmp17__length1;
	{
		guint8* character_collection = NULL;
		gint character_collection_length1 = 0;
		gint _character_collection_size_ = 0;
		gint character_it = 0;
		character_collection = _tmp19_;
		character_collection_length1 = _tmp19__length1;
		for (character_it = 0; character_it < character_collection_length1; character_it = character_it + 1) {
			guint8 character = 0U;
			character = character_collection[character_it];
			{
				gboolean _tmp20_ = FALSE;
				gboolean _tmp21_ = FALSE;
				if (character >= ((guint8) '0')) {
					_tmp21_ = character <= ((guint8) '9');
				} else {
					_tmp21_ = FALSE;
				}
				if (_tmp21_) {
					_tmp20_ = TRUE;
				} else {
					gboolean _tmp22_ = FALSE;
					if (character >= ((guint8) 'a')) {
						_tmp22_ = character <= ((guint8) 'f');
					} else {
						_tmp22_ = FALSE;
					}
					_tmp20_ = _tmp22_;
				}
				if (!_tmp20_) {
					result = FALSE;
					parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
					if (checksum_type) {
						*checksum_type = _vala_checksum_type;
					}
					if (expected_digest) {
						*expected_digest = _vala_expected_digest;
					} else {
						_g_free0 (_vala_expected_digest);
					}
					return result;
				}
			}
		}
	}
	_tmp23_ = parts;
	_tmp23__length1 = parts_length1;
	_tmp24_ = _tmp23_[1];
	_tmp25_ = g_strdup (_tmp24_);
	_g_free0 (_vala_expected_digest);
	_vala_expected_digest = _tmp25_;
	result = TRUE;
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
	if (checksum_type) {
		*checksum_type = _vala_checksum_type;
	}
	if (expected_digest) {
		*expected_digest = _vala_expected_digest;
	} else {
		_g_free0 (_vala_expected_digest);
	}
	return result;
}

static void
proton_plus_services_archive_workflow_support_cleanup_path_data_free (gpointer _data)
{
	ProtonPlusServicesArchiveWorkflowSupportCleanupPathData* _data_;
	_data_ = _data;
	_g_free0 (_data_->path);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesArchiveWorkflowSupportCleanupPathData, _data_);
}

static void
proton_plus_services_archive_workflow_support_cleanup_path (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                            const gchar* path,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportCleanupPathData* _data_;
	ProtonPlusServicesArchiveWorkflowSupport* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (path != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesArchiveWorkflowSupportCleanupPathData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_archive_workflow_support_cleanup_path_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (path);
	_g_free0 (_data_->path);
	_data_->path = _tmp1_;
	proton_plus_services_archive_workflow_support_cleanup_path_co (_data_);
}

static void
proton_plus_services_archive_workflow_support_cleanup_path_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                                   GAsyncResult* _res_)
{
	ProtonPlusServicesArchiveWorkflowSupportCleanupPathData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
proton_plus_services_archive_workflow_support_cleanup_path_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportCleanupPathData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_archive_workflow_support_cleanup_path_co (_data_);
}

static gboolean
proton_plus_services_archive_workflow_support_cleanup_path_co (ProtonPlusServicesArchiveWorkflowSupportCleanupPathData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	if (g_strcmp0 (_data_->path, "") != 0) {
		_data_->_tmp0_ = g_file_test (_data_->path, G_FILE_TEST_IS_DIR);
	} else {
		_data_->_tmp0_ = FALSE;
	}
	if (_data_->_tmp0_) {
		_data_->_state_ = 1;
		proton_plus_utils_filesystem_delete_directory (_data_->path, proton_plus_services_archive_workflow_support_cleanup_path_ready, _data_);
		return FALSE;
		_state_1:
		proton_plus_utils_filesystem_delete_directory_finish (_data_->_res_);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
proton_plus_services_archive_workflow_support_cleanup_data_free (gpointer _data)
{
	ProtonPlusServicesArchiveWorkflowSupportCleanupData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->operation);
	_g_object_unref0 (_data_->self);
	g_slice_free (ProtonPlusServicesArchiveWorkflowSupportCleanupData, _data_);
}

static void
proton_plus_services_archive_workflow_support_cleanup (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                       ProtonPlusServicesArchiveOperation* operation,
                                                       GAsyncReadyCallback _callback_,
                                                       gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportCleanupData* _data_;
	ProtonPlusServicesArchiveWorkflowSupport* _tmp0_;
	ProtonPlusServicesArchiveOperation* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (operation != NULL);
	_data_ = g_slice_new0 (ProtonPlusServicesArchiveWorkflowSupportCleanupData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, proton_plus_services_archive_workflow_support_cleanup_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (operation);
	_g_object_unref0 (_data_->operation);
	_data_->operation = _tmp1_;
	proton_plus_services_archive_workflow_support_cleanup_co (_data_);
}

static void
proton_plus_services_archive_workflow_support_cleanup_finish (ProtonPlusServicesArchiveWorkflowSupport* self,
                                                              GAsyncResult* _res_)
{
	ProtonPlusServicesArchiveWorkflowSupportCleanupData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
proton_plus_services_archive_workflow_support_cleanup_ready (GObject* source_object,
                                                             GAsyncResult* _res_,
                                                             gpointer _user_data_)
{
	ProtonPlusServicesArchiveWorkflowSupportCleanupData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	proton_plus_services_archive_workflow_support_cleanup_co (_data_);
}

static gboolean
proton_plus_services_archive_workflow_support_cleanup_co (ProtonPlusServicesArchiveWorkflowSupportCleanupData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = proton_plus_services_archive_operation_get_operation_path (_data_->operation);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_state_ = 1;
	proton_plus_services_archive_workflow_support_cleanup_path (_data_->self, _data_->_tmp1_, proton_plus_services_archive_workflow_support_cleanup_ready, _data_);
	return FALSE;
	_state_1:
	proton_plus_services_archive_workflow_support_cleanup_path_finish (_data_->self, _data_->_res_);
	_data_->_tmp3_ = proton_plus_services_archive_operation_get_staging_root (_data_->operation);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (g_strcmp0 (_data_->_tmp4_, "") != 0) {
		_data_->_tmp5_ = proton_plus_services_archive_operation_get_staging_root (_data_->operation);
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp2_ = g_file_test (_data_->_tmp6_, G_FILE_TEST_IS_DIR);
	} else {
		_data_->_tmp2_ = FALSE;
	}
	if (_data_->_tmp2_) {
		_data_->_tmp7_ = proton_plus_services_archive_operation_get_staging_root (_data_->operation);
		_data_->_tmp8_ = _data_->_tmp7_;
		_data_->_state_ = 2;
		proton_plus_utils_filesystem_delete_directory (_data_->_tmp8_, proton_plus_services_archive_workflow_support_cleanup_ready, _data_);
		return FALSE;
		_state_2:
		proton_plus_utils_filesystem_delete_directory_finish (_data_->_res_);
	}
	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;
}

ProtonPlusServicesArchiveWorkflowSupport*
proton_plus_services_archive_workflow_support_construct (GType object_type)
{
	ProtonPlusServicesArchiveWorkflowSupport * self = NULL;
	self = (ProtonPlusServicesArchiveWorkflowSupport*) g_object_new (object_type, NULL);
	return self;
}

ProtonPlusServicesArchiveWorkflowSupport*
proton_plus_services_archive_workflow_support_new (void)
{
	return proton_plus_services_archive_workflow_support_construct (PROTON_PLUS_SERVICES_TYPE_ARCHIVE_WORKFLOW_SUPPORT);
}

static void
proton_plus_services_archive_workflow_support_class_init (ProtonPlusServicesArchiveWorkflowSupportClass * klass,
                                                          gpointer klass_data)
{
	proton_plus_services_archive_workflow_support_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_services_archive_workflow_support_instance_init (ProtonPlusServicesArchiveWorkflowSupport * self,
                                                             gpointer klass)
{
}

static GType
proton_plus_services_archive_workflow_support_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusServicesArchiveWorkflowSupportClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_services_archive_workflow_support_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusServicesArchiveWorkflowSupport), 0, (GInstanceInitFunc) proton_plus_services_archive_workflow_support_instance_init, NULL };
	GType proton_plus_services_archive_workflow_support_type_id;
	proton_plus_services_archive_workflow_support_type_id = g_type_register_static (G_TYPE_OBJECT, "ProtonPlusServicesArchiveWorkflowSupport", &g_define_type_info, 0);
	return proton_plus_services_archive_workflow_support_type_id;
}

GType
proton_plus_services_archive_workflow_support_get_type (void)
{
	static volatile gsize proton_plus_services_archive_workflow_support_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_services_archive_workflow_support_type_id__once)) {
		GType proton_plus_services_archive_workflow_support_type_id;
		proton_plus_services_archive_workflow_support_type_id = proton_plus_services_archive_workflow_support_get_type_once ();
		g_once_init_leave (&proton_plus_services_archive_workflow_support_type_id__once, proton_plus_services_archive_workflow_support_type_id);
	}
	return proton_plus_services_archive_workflow_support_type_id__once;
}

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

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

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

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

