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

/* Copyright 2016 Software Freedom Conservancy Inc.
 * Copyright 2019 Jens Georg <mail@jensge.org>
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution.
 */

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <glib-object.h>
#include <gobject/gvaluecollector.h>
#include "shotwell-plugin-dev-1.0.h"
#include "shotwell-plugin-common.h"
#include <gio/gio.h>
#include <json-glib/json-glib.h>
#include "shotwell-publishing.h"
#include <gtk/gtk.h>
#include <float.h>
#include <math.h>
#include "shotwell-authenticator.h"

#define PUBLISHING_GOOGLE_PHOTOS_DEFAULT_ALBUM_NAME N_ ("Shotwell Connect")
#define PUBLISHING_GOOGLE_PHOTOS_MAX_BATCH_SIZE 50
#define PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_PARAMETERS_ORIGINAL_SIZE -1
#define PUBLISHING_GOOGLE_PHOTOS_MEDIA_CREATION_TRANSACTION_ENDPOINT_URL "https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate"
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_CREATION_TRANSACTION_ENDPOINT_URL "https://photoslibrary.googleapis.com/v1/albums"
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_DIRECTORY_TRANSACTION_ENDPOINT_URL "https://photoslibrary.googleapis.com/v1/albums"
#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 PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM (publishing_google_photos_album_get_type ())
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM, PublishingGooglePhotosAlbum))
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM, PublishingGooglePhotosAlbumClass))
#define PUBLISHING_GOOGLE_PHOTOS_IS_ALBUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM))
#define PUBLISHING_GOOGLE_PHOTOS_IS_ALBUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM))
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM, PublishingGooglePhotosAlbumClass))

typedef struct _PublishingGooglePhotosAlbum PublishingGooglePhotosAlbum;
typedef struct _PublishingGooglePhotosAlbumClass PublishingGooglePhotosAlbumClass;
typedef struct _PublishingGooglePhotosAlbumPrivate PublishingGooglePhotosAlbumPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _PublishingGooglePhotosParamSpecAlbum PublishingGooglePhotosParamSpecAlbum;

#define PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS (publishing_google_photos_publishing_parameters_get_type ())
#define PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS, PublishingGooglePhotosPublishingParameters))
#define PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS, PublishingGooglePhotosPublishingParametersClass))
#define PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS))
#define PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS))
#define PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_PARAMETERS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS, PublishingGooglePhotosPublishingParametersClass))

typedef struct _PublishingGooglePhotosPublishingParameters PublishingGooglePhotosPublishingParameters;
typedef struct _PublishingGooglePhotosPublishingParametersClass PublishingGooglePhotosPublishingParametersClass;
typedef struct _PublishingGooglePhotosPublishingParametersPrivate PublishingGooglePhotosPublishingParametersPrivate;
typedef struct _PublishingGooglePhotosParamSpecPublishingParameters PublishingGooglePhotosParamSpecPublishingParameters;

#define PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION (publishing_google_photos_media_creation_transaction_get_type ())
#define PUBLISHING_GOOGLE_PHOTOS_MEDIA_CREATION_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION, PublishingGooglePhotosMediaCreationTransaction))
#define PUBLISHING_GOOGLE_PHOTOS_MEDIA_CREATION_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION, PublishingGooglePhotosMediaCreationTransactionClass))
#define PUBLISHING_GOOGLE_PHOTOS_IS_MEDIA_CREATION_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION))
#define PUBLISHING_GOOGLE_PHOTOS_IS_MEDIA_CREATION_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION))
#define PUBLISHING_GOOGLE_PHOTOS_MEDIA_CREATION_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION, PublishingGooglePhotosMediaCreationTransactionClass))

typedef struct _PublishingGooglePhotosMediaCreationTransaction PublishingGooglePhotosMediaCreationTransaction;
typedef struct _PublishingGooglePhotosMediaCreationTransactionClass PublishingGooglePhotosMediaCreationTransactionClass;
typedef struct _PublishingGooglePhotosMediaCreationTransactionPrivate PublishingGooglePhotosMediaCreationTransactionPrivate;
#define _publishing_rest_support_transaction_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_transaction_unref (var), NULL)))
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData;

#define PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION (publishing_google_photos_album_creation_transaction_get_type ())
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_CREATION_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION, PublishingGooglePhotosAlbumCreationTransaction))
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_CREATION_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION, PublishingGooglePhotosAlbumCreationTransactionClass))
#define PUBLISHING_GOOGLE_PHOTOS_IS_ALBUM_CREATION_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION))
#define PUBLISHING_GOOGLE_PHOTOS_IS_ALBUM_CREATION_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION))
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_CREATION_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION, PublishingGooglePhotosAlbumCreationTransactionClass))

typedef struct _PublishingGooglePhotosAlbumCreationTransaction PublishingGooglePhotosAlbumCreationTransaction;
typedef struct _PublishingGooglePhotosAlbumCreationTransactionClass PublishingGooglePhotosAlbumCreationTransactionClass;
typedef struct _PublishingGooglePhotosAlbumCreationTransactionPrivate PublishingGooglePhotosAlbumCreationTransactionPrivate;
typedef struct _PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData;

#define PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_DIRECTORY_TRANSACTION (publishing_google_photos_album_directory_transaction_get_type ())
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_DIRECTORY_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_DIRECTORY_TRANSACTION, PublishingGooglePhotosAlbumDirectoryTransaction))
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_DIRECTORY_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_DIRECTORY_TRANSACTION, PublishingGooglePhotosAlbumDirectoryTransactionClass))
#define PUBLISHING_GOOGLE_PHOTOS_IS_ALBUM_DIRECTORY_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_DIRECTORY_TRANSACTION))
#define PUBLISHING_GOOGLE_PHOTOS_IS_ALBUM_DIRECTORY_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_DIRECTORY_TRANSACTION))
#define PUBLISHING_GOOGLE_PHOTOS_ALBUM_DIRECTORY_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_DIRECTORY_TRANSACTION, PublishingGooglePhotosAlbumDirectoryTransactionClass))

typedef struct _PublishingGooglePhotosAlbumDirectoryTransaction PublishingGooglePhotosAlbumDirectoryTransaction;
typedef struct _PublishingGooglePhotosAlbumDirectoryTransactionClass PublishingGooglePhotosAlbumDirectoryTransactionClass;
typedef struct _PublishingGooglePhotosAlbumDirectoryTransactionPrivate PublishingGooglePhotosAlbumDirectoryTransactionPrivate;
enum  {
	PUBLISHING_GOOGLE_PHOTOS_PUBLISHER_0_PROPERTY,
	PUBLISHING_GOOGLE_PHOTOS_PUBLISHER_NUM_PROPERTIES
};
static GParamSpec* publishing_google_photos_publisher_properties[PUBLISHING_GOOGLE_PHOTOS_PUBLISHER_NUM_PROPERTIES];
#define _publishing_google_photos_publishing_parameters_unref0(var) ((var == NULL) ? NULL : (var = (publishing_google_photos_publishing_parameters_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _publishing_rest_support_session_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_session_unref (var), NULL)))
#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL)))
#define _json_array_unref0(var) ((var == NULL) ? NULL : (var = (json_array_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _PublishingGooglePhotosPublisherDoPublishingProcessData PublishingGooglePhotosPublisherDoPublishingProcessData;

#define PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_OPTIONS_PANE (publishing_google_photos_publishing_options_pane_get_type ())
#define PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_OPTIONS_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_OPTIONS_PANE, PublishingGooglePhotosPublishingOptionsPane))
#define PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_OPTIONS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_OPTIONS_PANE, PublishingGooglePhotosPublishingOptionsPaneClass))
#define PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_OPTIONS_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_OPTIONS_PANE))
#define PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_OPTIONS_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_OPTIONS_PANE))
#define PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_OPTIONS_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_OPTIONS_PANE, PublishingGooglePhotosPublishingOptionsPaneClass))

typedef struct _PublishingGooglePhotosPublishingOptionsPane PublishingGooglePhotosPublishingOptionsPane;
typedef struct _PublishingGooglePhotosPublishingOptionsPaneClass PublishingGooglePhotosPublishingOptionsPaneClass;
typedef struct _PublishingGooglePhotosPublisherDoCreateAlbumData PublishingGooglePhotosPublisherDoCreateAlbumData;

#define PUBLISHING_GOOGLE_PHOTOS_TYPE_UPLOADER (publishing_google_photos_uploader_get_type ())
#define PUBLISHING_GOOGLE_PHOTOS_UPLOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_UPLOADER, PublishingGooglePhotosUploader))
#define PUBLISHING_GOOGLE_PHOTOS_UPLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_UPLOADER, PublishingGooglePhotosUploaderClass))
#define PUBLISHING_GOOGLE_PHOTOS_IS_UPLOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_UPLOADER))
#define PUBLISHING_GOOGLE_PHOTOS_IS_UPLOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_GOOGLE_PHOTOS_TYPE_UPLOADER))
#define PUBLISHING_GOOGLE_PHOTOS_UPLOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_GOOGLE_PHOTOS_TYPE_UPLOADER, PublishingGooglePhotosUploaderClass))

typedef struct _PublishingGooglePhotosUploader PublishingGooglePhotosUploader;
typedef struct _PublishingGooglePhotosUploaderClass PublishingGooglePhotosUploaderClass;
#define _publishing_rest_support_batch_uploader_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_batch_uploader_unref (var), NULL)))
typedef struct _PublishingGooglePhotosPublisherDoUploadData PublishingGooglePhotosPublisherDoUploadData;
typedef struct _PublishingGooglePhotosUploaderPrivate PublishingGooglePhotosUploaderPrivate;
typedef struct _PublishingGooglePhotosPublisherDoMediaCreationBatchData PublishingGooglePhotosPublisherDoMediaCreationBatchData;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _PublishingGooglePhotosAlbum {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingGooglePhotosAlbumPrivate * priv;
	gchar* name;
	gchar* id;
};

struct _PublishingGooglePhotosAlbumClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingGooglePhotosAlbum *self);
};

struct _PublishingGooglePhotosParamSpecAlbum {
	GParamSpec parent_instance;
};

struct _PublishingGooglePhotosPublishingParameters {
	GTypeInstance parent_instance;
	volatile int ref_count;
	PublishingGooglePhotosPublishingParametersPrivate * priv;
};

struct _PublishingGooglePhotosPublishingParametersClass {
	GTypeClass parent_class;
	void (*finalize) (PublishingGooglePhotosPublishingParameters *self);
};

struct _PublishingGooglePhotosPublishingParametersPrivate {
	gchar* target_album_name;
	gchar* target_album_id;
	gboolean album_public;
	gboolean strip_metadata;
	gint major_axis_size_pixels;
	gint major_axis_size_selection_id;
	gchar* user_name;
	PublishingGooglePhotosAlbum** albums;
	gint albums_length1;
	gint _albums_size_;
	SpitPublishingPublisherMediaType media_type;
};

struct _PublishingGooglePhotosParamSpecPublishingParameters {
	GParamSpec parent_instance;
};

struct _PublishingGooglePhotosMediaCreationTransaction {
	PublishingRESTSupportGooglePublisherAuthenticatedTransaction parent_instance;
	PublishingGooglePhotosMediaCreationTransactionPrivate * priv;
};

struct _PublishingGooglePhotosMediaCreationTransactionClass {
	PublishingRESTSupportGooglePublisherAuthenticatedTransactionClass parent_class;
};

struct _PublishingGooglePhotosMediaCreationTransactionPrivate {
	gchar** upload_tokens;
	gint upload_tokens_length1;
	gint _upload_tokens_size_;
	gchar** titles;
	gint titles_length1;
	gint _titles_size_;
	gchar* album_id;
};

struct _PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingGooglePhotosMediaCreationTransaction* self;
	JsonBuilder* builder;
	JsonBuilder* _tmp0_;
	JsonBuilder* _tmp1_;
	JsonBuilder* _tmp2_;
	JsonBuilder* _tmp3_;
	const gchar* _tmp4_;
	JsonBuilder* _tmp5_;
	JsonBuilder* _tmp6_;
	gint i;
	gboolean _tmp7_;
	gint _tmp8_;
	gchar** _tmp9_;
	gint _tmp9__length1;
	JsonBuilder* _tmp10_;
	JsonBuilder* _tmp11_;
	JsonBuilder* _tmp12_;
	gchar** _tmp13_;
	gint _tmp13__length1;
	const gchar* _tmp14_;
	JsonBuilder* _tmp15_;
	JsonBuilder* _tmp16_;
	JsonBuilder* _tmp17_;
	JsonBuilder* _tmp18_;
	gchar** _tmp19_;
	gint _tmp19__length1;
	const gchar* _tmp20_;
	JsonBuilder* _tmp21_;
	JsonBuilder* _tmp22_;
	JsonBuilder* _tmp23_;
	JsonBuilder* _tmp24_;
	JsonBuilder* _tmp25_;
	JsonNode* _tmp26_;
	JsonNode* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	GError* _inner_error0_;
};

struct _PublishingGooglePhotosAlbumCreationTransaction {
	PublishingRESTSupportGooglePublisherAuthenticatedTransaction parent_instance;
	PublishingGooglePhotosAlbumCreationTransactionPrivate * priv;
};

struct _PublishingGooglePhotosAlbumCreationTransactionClass {
	PublishingRESTSupportGooglePublisherAuthenticatedTransactionClass parent_class;
};

struct _PublishingGooglePhotosAlbumCreationTransactionPrivate {
	gchar* title;
};

struct _PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingGooglePhotosAlbumCreationTransaction* self;
	JsonBuilder* builder;
	JsonBuilder* _tmp0_;
	const gchar* _tmp1_;
	JsonNode* _tmp2_;
	JsonNode* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GError* _inner_error0_;
};

struct _PublishingGooglePhotosAlbumDirectoryTransaction {
	PublishingRESTSupportGooglePublisherAuthenticatedTransaction parent_instance;
	PublishingGooglePhotosAlbumDirectoryTransactionPrivate * priv;
};

struct _PublishingGooglePhotosAlbumDirectoryTransactionClass {
	PublishingRESTSupportGooglePublisherAuthenticatedTransactionClass parent_class;
};

struct _PublishingGooglePhotosPublisherPrivate {
	SpitPublishingAuthenticator* authenticator;
	gboolean running;
	PublishingGooglePhotosPublishingParameters* publishing_parameters;
	SpitPublishingProgressCallback progress_reporter;
	gpointer progress_reporter_target;
	GDestroyNotify progress_reporter_target_destroy_notify;
	gsize creation_offset;
};

struct _Block1Data {
	int _ref_count_;
	PublishingGooglePhotosPublisher* self;
	PublishingGooglePhotosAlbum** albums;
	gint albums_length1;
	gint _albums_size_;
	gpointer _async_data_;
};

struct _PublishingGooglePhotosPublisherDoPublishingProcessData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingGooglePhotosPublisher* self;
	Block1Data* _data1_;
	PublishingGooglePhotosPublishingParameters* _tmp0_;
	SpitPublishingAuthenticator* _tmp1_;
	GHashTable* _tmp2_;
	GHashTable* _tmp3_;
	gconstpointer _tmp4_;
	const gchar* _tmp5_;
	SpitPublishingPluginHost* _tmp6_;
	SpitPublishingPluginHost* _tmp7_;
	PublishingGooglePhotosAlbum** _tmp8_;
	PublishingGooglePhotosAlbumDirectoryTransaction* txn;
	PublishingRESTSupportGoogleSession* _tmp9_;
	PublishingRESTSupportGoogleSession* _tmp10_;
	PublishingGooglePhotosAlbumDirectoryTransaction* _tmp11_;
	PublishingGooglePhotosAlbumDirectoryTransaction* _tmp12_;
	gchar* pagination_token;
	gboolean _tmp13_;
	const gchar* _tmp14_;
	PublishingGooglePhotosAlbumDirectoryTransaction* _tmp15_;
	JsonNode* json;
	PublishingGooglePhotosAlbumDirectoryTransaction* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	JsonNode* _tmp19_;
	JsonNode* _tmp20_;
	JsonObject* object;
	JsonNode* _tmp21_;
	JsonObject* _tmp22_;
	JsonObject* _tmp23_;
	JsonObject* _tmp24_;
	JsonObject* _tmp25_;
	GError* _tmp26_;
	JsonObject* _tmp27_;
	JsonObject* _tmp28_;
	JsonNode* _tmp29_;
	const gchar* _tmp30_;
	gchar* _tmp31_;
	JsonArray* response_albums;
	JsonObject* _tmp32_;
	JsonNode* _tmp33_;
	JsonArray* _tmp34_;
	JsonArray* _tmp35_;
	JsonArray* _tmp36_;
	const gchar* _tmp37_;
	const gchar* _tmp38_;
	PublishingRESTSupportGoogleSession* _tmp39_;
	PublishingRESTSupportGoogleSession* _tmp40_;
	const gchar* _tmp41_;
	PublishingGooglePhotosAlbumDirectoryTransaction* _tmp42_;
	PublishingGooglePhotosPublishingParameters* _tmp43_;
	PublishingGooglePhotosAlbum** _tmp44_;
	gint _tmp44__length1;
	GError* err;
	PublishingGooglePhotosAlbumDirectoryTransaction* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	PublishingGooglePhotosAlbumDirectoryTransaction* _tmp48_;
	PublishingGooglePhotosAlbumDirectoryTransaction* _tmp49_;
	SpitPublishingPluginHost* _tmp50_;
	GError* _tmp51_;
	GError* _inner_error0_;
};

struct _PublishingGooglePhotosPublisherDoCreateAlbumData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingGooglePhotosPublisher* self;
	PublishingGooglePhotosPublishingParameters* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	SpitPublishingPluginHost* _tmp3_;
	PublishingGooglePhotosAlbumCreationTransaction* txn;
	PublishingRESTSupportGoogleSession* _tmp4_;
	PublishingRESTSupportGoogleSession* _tmp5_;
	PublishingGooglePhotosPublishingParameters* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp9_;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp10_;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp11_;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	JsonNode* node;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	JsonNode* _tmp18_;
	JsonNode* _tmp19_;
	JsonObject* object;
	JsonNode* _tmp20_;
	JsonObject* _tmp21_;
	JsonObject* _tmp22_;
	PublishingGooglePhotosPublishingParameters* _tmp23_;
	JsonObject* _tmp24_;
	const gchar* _tmp25_;
	GError* err;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp26_;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp30_;
	SpitPublishingPluginHost* _tmp31_;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp32_;
	SpitPublishingPluginHost* _tmp33_;
	GError* _tmp34_;
	GError* _inner_error0_;
};

struct _PublishingGooglePhotosPublisherDoUploadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingGooglePhotosPublisher* self;
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	PublishingGooglePhotosPublishingParameters* _tmp2_;
	PublishingGooglePhotosPublishingParameters* _tmp3_;
	gpointer _tmp4_;
	GDestroyNotify _tmp5_;
	SpitPublishingProgressCallback _tmp6_;
	SpitPublishingPublishable** publishables;
	SpitPublishingPluginHost* _tmp7_;
	gint _tmp8_;
	SpitPublishingPublishable** _tmp9_;
	gint publishables_length1;
	gint _publishables_size_;
	PublishingGooglePhotosUploader* uploader;
	PublishingRESTSupportGoogleSession* _tmp10_;
	PublishingRESTSupportGoogleSession* _tmp11_;
	SpitPublishingPublishable** _tmp12_;
	gint _tmp12__length1;
	PublishingGooglePhotosPublishingParameters* _tmp13_;
	PublishingGooglePhotosUploader* _tmp14_;
	PublishingGooglePhotosUploader* _tmp15_;
	PublishingGooglePhotosUploader* _tmp16_;
	PublishingGooglePhotosUploader* _tmp17_;
	GError* err;
	GError* _tmp18_;
	const gchar* _tmp19_;
	SpitPublishingPluginHost* _tmp20_;
	GError* _tmp21_;
	GError* _inner_error0_;
};

struct _PublishingGooglePhotosUploader {
	PublishingRESTSupportBatchUploader parent_instance;
	PublishingGooglePhotosUploaderPrivate * priv;
	gchar** upload_tokens;
	gint upload_tokens_length1;
	gint _upload_tokens_size_;
	gchar** titles;
	gint titles_length1;
	gint _titles_size_;
};

struct _PublishingGooglePhotosUploaderClass {
	PublishingRESTSupportBatchUploaderClass parent_class;
};

struct _PublishingGooglePhotosPublisherDoMediaCreationBatchData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	PublishingGooglePhotosPublisher* self;
	PublishingRESTSupportBatchUploader* uploader;
	PublishingGooglePhotosUploader* u;
	PublishingGooglePhotosUploader* _tmp0_;
	PublishingGooglePhotosUploader* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gsize _tmp3_;
	PublishingGooglePhotosUploader* _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	PublishingGooglePhotosUploader* _tmp6_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gsize end;
	PublishingGooglePhotosMediaCreationTransaction* txn;
	PublishingRESTSupportGoogleSession* _tmp8_;
	PublishingRESTSupportGoogleSession* _tmp9_;
	PublishingGooglePhotosUploader* _tmp10_;
	gchar** _tmp11_;
	gint _tmp11__length1;
	PublishingGooglePhotosUploader* _tmp12_;
	gchar** _tmp13_;
	gint _tmp13__length1;
	PublishingGooglePhotosPublishingParameters* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	PublishingGooglePhotosMediaCreationTransaction* _tmp17_;
	PublishingGooglePhotosMediaCreationTransaction* _tmp18_;
	PublishingGooglePhotosMediaCreationTransaction* _tmp19_;
	SpitPublishingPluginHost* _tmp20_;
	SpitPublishingPluginHost* _tmp21_;
	GError* err;
	GError* _tmp22_;
	const gchar* _tmp23_;
	SpitPublishingPluginHost* _tmp24_;
	GError* _tmp25_;
	GError* _inner_error0_;
};

static gpointer publishing_google_photos_album_parent_class = NULL;
static gint PublishingGooglePhotosPublishingParameters_private_offset;
static gpointer publishing_google_photos_publishing_parameters_parent_class = NULL;
static gint PublishingGooglePhotosMediaCreationTransaction_private_offset;
static gpointer publishing_google_photos_media_creation_transaction_parent_class = NULL;
static gint PublishingGooglePhotosAlbumCreationTransaction_private_offset;
static gpointer publishing_google_photos_album_creation_transaction_parent_class = NULL;
static gpointer publishing_google_photos_album_directory_transaction_parent_class = NULL;
static gint PublishingGooglePhotosPublisher_private_offset;
static gpointer publishing_google_photos_publisher_parent_class = NULL;

VALA_EXTERN gpointer publishing_google_photos_album_ref (gpointer instance);
VALA_EXTERN void publishing_google_photos_album_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_google_photos_param_spec_album (const gchar* name,
                                                       const gchar* nick,
                                                       const gchar* blurb,
                                                       GType object_type,
                                                       GParamFlags flags);
VALA_EXTERN void publishing_google_photos_value_set_album (GValue* value,
                                               gpointer v_object);
VALA_EXTERN void publishing_google_photos_value_take_album (GValue* value,
                                                gpointer v_object);
VALA_EXTERN gpointer publishing_google_photos_value_get_album (const GValue* value);
VALA_EXTERN GType publishing_google_photos_album_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingGooglePhotosAlbum* publishing_google_photos_album_new (const gchar* name,
                                                                 const gchar* id);
VALA_EXTERN PublishingGooglePhotosAlbum* publishing_google_photos_album_construct (GType object_type,
                                                                       const gchar* name,
                                                                       const gchar* id);
static void publishing_google_photos_album_finalize (PublishingGooglePhotosAlbum * obj);
static GType publishing_google_photos_album_get_type_once (void);
VALA_EXTERN gpointer publishing_google_photos_publishing_parameters_ref (gpointer instance);
VALA_EXTERN void publishing_google_photos_publishing_parameters_unref (gpointer instance);
VALA_EXTERN GParamSpec* publishing_google_photos_param_spec_publishing_parameters (const gchar* name,
                                                                       const gchar* nick,
                                                                       const gchar* blurb,
                                                                       GType object_type,
                                                                       GParamFlags flags);
VALA_EXTERN void publishing_google_photos_value_set_publishing_parameters (GValue* value,
                                                               gpointer v_object);
VALA_EXTERN void publishing_google_photos_value_take_publishing_parameters (GValue* value,
                                                                gpointer v_object);
VALA_EXTERN gpointer publishing_google_photos_value_get_publishing_parameters (const GValue* value);
VALA_EXTERN GType publishing_google_photos_publishing_parameters_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingGooglePhotosPublishingParameters* publishing_google_photos_publishing_parameters_new (void);
VALA_EXTERN PublishingGooglePhotosPublishingParameters* publishing_google_photos_publishing_parameters_construct (GType object_type);
VALA_EXTERN gchar* publishing_google_photos_publishing_parameters_get_target_album_name (PublishingGooglePhotosPublishingParameters* self);
VALA_EXTERN void publishing_google_photos_publishing_parameters_set_target_album_name (PublishingGooglePhotosPublishingParameters* self,
                                                                           const gchar* target_album_name);
VALA_EXTERN void publishing_google_photos_publishing_parameters_set_target_album_entry_id (PublishingGooglePhotosPublishingParameters* self,
                                                                               const gchar* target_album_id);
VALA_EXTERN gchar* publishing_google_photos_publishing_parameters_get_target_album_entry_id (PublishingGooglePhotosPublishingParameters* self);
VALA_EXTERN gchar* publishing_google_photos_publishing_parameters_get_user_name (PublishingGooglePhotosPublishingParameters* self);
VALA_EXTERN void publishing_google_photos_publishing_parameters_set_user_name (PublishingGooglePhotosPublishingParameters* self,
                                                                   const gchar* user_name);
VALA_EXTERN PublishingGooglePhotosAlbum** publishing_google_photos_publishing_parameters_get_albums (PublishingGooglePhotosPublishingParameters* self,
                                                                                         gint* result_length1);
static PublishingGooglePhotosAlbum** _vala_array_dup4 (PublishingGooglePhotosAlbum** self,
                                                gssize length);
VALA_EXTERN void publishing_google_photos_publishing_parameters_set_albums (PublishingGooglePhotosPublishingParameters* self,
                                                                PublishingGooglePhotosAlbum** albums,
                                                                gint albums_length1);
static PublishingGooglePhotosAlbum** _vala_array_dup5 (PublishingGooglePhotosAlbum** self,
                                                gssize length);
VALA_EXTERN void publishing_google_photos_publishing_parameters_set_major_axis_size_pixels (PublishingGooglePhotosPublishingParameters* self,
                                                                                gint pixels);
VALA_EXTERN gint publishing_google_photos_publishing_parameters_get_major_axis_size_pixels (PublishingGooglePhotosPublishingParameters* self);
VALA_EXTERN void publishing_google_photos_publishing_parameters_set_major_axis_size_selection_id (PublishingGooglePhotosPublishingParameters* self,
                                                                                      gint selection_id);
VALA_EXTERN gint publishing_google_photos_publishing_parameters_get_major_axis_size_selection_id (PublishingGooglePhotosPublishingParameters* self);
VALA_EXTERN void publishing_google_photos_publishing_parameters_set_strip_metadata (PublishingGooglePhotosPublishingParameters* self,
                                                                        gboolean strip_metadata);
VALA_EXTERN gboolean publishing_google_photos_publishing_parameters_get_strip_metadata (PublishingGooglePhotosPublishingParameters* self);
VALA_EXTERN void publishing_google_photos_publishing_parameters_set_media_type (PublishingGooglePhotosPublishingParameters* self,
                                                                    SpitPublishingPublisherMediaType media_type);
VALA_EXTERN SpitPublishingPublisherMediaType publishing_google_photos_publishing_parameters_get_media_type (PublishingGooglePhotosPublishingParameters* self);
static void publishing_google_photos_publishing_parameters_finalize (PublishingGooglePhotosPublishingParameters * obj);
static GType publishing_google_photos_publishing_parameters_get_type_once (void);
VALA_EXTERN GType publishing_google_photos_media_creation_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingGooglePhotosMediaCreationTransaction* publishing_google_photos_media_creation_transaction_new (PublishingRESTSupportGoogleSession* session,
                                                                                                         gchar** upload_tokens,
                                                                                                         gint upload_tokens_length1,
                                                                                                         gchar** titles,
                                                                                                         gint titles_length1,
                                                                                                         const gchar* album_id);
VALA_EXTERN PublishingGooglePhotosMediaCreationTransaction* publishing_google_photos_media_creation_transaction_construct (GType object_type,
                                                                                                               PublishingRESTSupportGoogleSession* session,
                                                                                                               gchar** upload_tokens,
                                                                                                               gint upload_tokens_length1,
                                                                                                               gchar** titles,
                                                                                                               gint titles_length1,
                                                                                                               const gchar* album_id);
static gchar** _vala_array_dup6 (gchar** self,
                          gssize length);
static gchar** _vala_array_dup7 (gchar** self,
                          gssize length);
static void publishing_google_photos_media_creation_transaction_real_execute_async_data_free (gpointer _data);
static void publishing_google_photos_media_creation_transaction_real_execute_async (PublishingRESTSupportTransaction* base,
                                                                             GAsyncReadyCallback _callback_,
                                                                             gpointer _user_data_);
static gboolean publishing_google_photos_media_creation_transaction_real_execute_async_co (PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData* _data_);
static void _vala_JsonNode_free (JsonNode* self);
static void publishing_google_photos_media_creation_transaction_execute_async_ready (GObject* source_object,
                                                                              GAsyncResult* _res_,
                                                                              gpointer _user_data_);
static void publishing_google_photos_media_creation_transaction_finalize (PublishingRESTSupportTransaction * obj);
static GType publishing_google_photos_media_creation_transaction_get_type_once (void);
VALA_EXTERN GType publishing_google_photos_album_creation_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingGooglePhotosAlbumCreationTransaction* publishing_google_photos_album_creation_transaction_new (PublishingRESTSupportGoogleSession* session,
                                                                                                         const gchar* title);
VALA_EXTERN PublishingGooglePhotosAlbumCreationTransaction* publishing_google_photos_album_creation_transaction_construct (GType object_type,
                                                                                                               PublishingRESTSupportGoogleSession* session,
                                                                                                               const gchar* title);
static void publishing_google_photos_album_creation_transaction_real_execute_async_data_free (gpointer _data);
static void publishing_google_photos_album_creation_transaction_real_execute_async (PublishingRESTSupportTransaction* base,
                                                                             GAsyncReadyCallback _callback_,
                                                                             gpointer _user_data_);
static gboolean publishing_google_photos_album_creation_transaction_real_execute_async_co (PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData* _data_);
static void publishing_google_photos_album_creation_transaction_execute_async_ready (GObject* source_object,
                                                                              GAsyncResult* _res_,
                                                                              gpointer _user_data_);
static void publishing_google_photos_album_creation_transaction_finalize (PublishingRESTSupportTransaction * obj);
static GType publishing_google_photos_album_creation_transaction_get_type_once (void);
VALA_EXTERN GType publishing_google_photos_album_directory_transaction_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingGooglePhotosAlbumDirectoryTransaction* publishing_google_photos_album_directory_transaction_new (PublishingRESTSupportGoogleSession* session,
                                                                                                           const gchar* token);
VALA_EXTERN PublishingGooglePhotosAlbumDirectoryTransaction* publishing_google_photos_album_directory_transaction_construct (GType object_type,
                                                                                                                 PublishingRESTSupportGoogleSession* session,
                                                                                                                 const gchar* token);
static GType publishing_google_photos_album_directory_transaction_get_type_once (void);
static void publishing_google_photos_publisher_load_parameters_from_configuration_system (PublishingGooglePhotosPublisher* self,
                                                                                   PublishingGooglePhotosPublishingParameters* parameters);
static void publishing_google_photos_publisher_save_parameters_to_configuration_system (PublishingGooglePhotosPublisher* self,
                                                                                 PublishingGooglePhotosPublishingParameters* parameters);
static void publishing_google_photos_publisher_real_on_login_flow_complete (PublishingRESTSupportGooglePublisher* base);
static void publishing_google_photos_publisher_do_publishing_process (PublishingGooglePhotosPublisher* self,
                                                               GAsyncReadyCallback _callback_,
                                                               gpointer _user_data_);
static void publishing_google_photos_publisher_do_publishing_process_finish (PublishingGooglePhotosPublisher* self,
                                                                      GAsyncResult* _res_);
static void publishing_google_photos_publisher_do_publishing_process_data_free (gpointer _data);
static gboolean publishing_google_photos_publisher_do_publishing_process_co (PublishingGooglePhotosPublisherDoPublishingProcessData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void publishing_google_photos_publisher_do_publishing_process_ready (GObject* source_object,
                                                                     GAsyncResult* _res_,
                                                                     gpointer _user_data_);
static void _____lambda4_ (Block1Data* _data1_,
                    JsonArray* a,
                    guint b,
                    JsonNode* element);
static JsonNode* _vala_JsonNode_copy (JsonNode* self);
static void _vala_array_add35 (PublishingGooglePhotosAlbum** * array,
                        gint* length,
                        gint* size,
                        PublishingGooglePhotosAlbum* value);
static void ______lambda4__json_array_foreach (JsonArray* array,
                                        guint index_,
                                        JsonNode* element_node,
                                        gpointer self);
static void publishing_google_photos_publisher_show_publishing_options_pane (PublishingGooglePhotosPublisher* self);
VALA_EXTERN GType publishing_google_photos_publishing_options_pane_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingGooglePhotosPublishingOptionsPane* publishing_google_photos_publishing_options_pane_new (PublishingGooglePhotosPublishingParameters* parameters,
                                                                                                   gboolean can_logout);
VALA_EXTERN PublishingGooglePhotosPublishingOptionsPane* publishing_google_photos_publishing_options_pane_construct (GType object_type,
                                                                                                         PublishingGooglePhotosPublishingParameters* parameters,
                                                                                                         gboolean can_logout);
static void publishing_google_photos_publisher_on_publishing_options_publish (PublishingGooglePhotosPublisher* self);
static void _publishing_google_photos_publisher_on_publishing_options_publish_publishing_google_photos_publishing_options_pane_publish (PublishingGooglePhotosPublishingOptionsPane* _sender,
                                                                                                                                 gpointer self);
static void publishing_google_photos_publisher_on_publishing_options_logout (PublishingGooglePhotosPublisher* self);
static void _publishing_google_photos_publisher_on_publishing_options_logout_publishing_google_photos_publishing_options_pane_logout (PublishingGooglePhotosPublishingOptionsPane* _sender,
                                                                                                                               gpointer self);
static void publishing_google_photos_publisher_do_upload (PublishingGooglePhotosPublisher* self,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static void publishing_google_photos_publisher_do_upload_finish (PublishingGooglePhotosPublisher* self,
                                                          GAsyncResult* _res_);
static void publishing_google_photos_publisher_do_create_album (PublishingGooglePhotosPublisher* self,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static void publishing_google_photos_publisher_do_create_album_finish (PublishingGooglePhotosPublisher* self,
                                                                GAsyncResult* _res_);
static void publishing_google_photos_publisher_do_create_album_data_free (gpointer _data);
static gboolean publishing_google_photos_publisher_do_create_album_co (PublishingGooglePhotosPublisherDoCreateAlbumData* _data_);
static void publishing_google_photos_publisher_do_create_album_ready (GObject* source_object,
                                                               GAsyncResult* _res_,
                                                               gpointer _user_data_);
static void publishing_google_photos_publisher_real_do_logout (PublishingRESTSupportGooglePublisher* base);
static void publishing_google_photos_publisher_do_upload_data_free (gpointer _data);
static gboolean publishing_google_photos_publisher_do_upload_co (PublishingGooglePhotosPublisherDoUploadData* _data_);
VALA_EXTERN GType publishing_google_photos_uploader_get_type (void) G_GNUC_CONST ;
VALA_EXTERN PublishingGooglePhotosUploader* publishing_google_photos_uploader_new (PublishingRESTSupportGoogleSession* session,
                                                                       SpitPublishingPublishable** publishables,
                                                                       gint publishables_length1,
                                                                       PublishingGooglePhotosPublishingParameters* parameters);
VALA_EXTERN PublishingGooglePhotosUploader* publishing_google_photos_uploader_construct (GType object_type,
                                                                             PublishingRESTSupportGoogleSession* session,
                                                                             SpitPublishingPublishable** publishables,
                                                                             gint publishables_length1,
                                                                             PublishingGooglePhotosPublishingParameters* parameters);
static void publishing_google_photos_publisher_on_upload_status_updated (PublishingGooglePhotosPublisher* self,
                                                                  gint file_number,
                                                                  gdouble completed_fraction);
static void _publishing_google_photos_publisher_on_upload_status_updated_spit_publishing_progress_callback (gint file_number,
                                                                                                     gdouble fraction_complete,
                                                                                                     gpointer self);
static void publishing_google_photos_publisher_do_upload_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
static void publishing_google_photos_publisher_do_media_creation_batch (PublishingGooglePhotosPublisher* self,
                                                                 PublishingRESTSupportBatchUploader* uploader,
                                                                 GAsyncReadyCallback _callback_,
                                                                 gpointer _user_data_);
static void publishing_google_photos_publisher_do_media_creation_batch_finish (PublishingGooglePhotosPublisher* self,
                                                                        GAsyncResult* _res_);
static void publishing_google_photos_publisher_do_media_creation_batch_data_free (gpointer _data);
static gboolean publishing_google_photos_publisher_do_media_creation_batch_co (PublishingGooglePhotosPublisherDoMediaCreationBatchData* _data_);
static void publishing_google_photos_publisher_do_media_creation_batch_ready (GObject* source_object,
                                                                       GAsyncResult* _res_,
                                                                       gpointer _user_data_);
static gboolean publishing_google_photos_publisher_real_is_running (PublishingRESTSupportGooglePublisher* base);
static void publishing_google_photos_publisher_real_start (PublishingRESTSupportGooglePublisher* base);
static void publishing_google_photos_publisher_real_stop (PublishingRESTSupportGooglePublisher* base);
static SpitPublishingAuthenticator* publishing_google_photos_publisher_real_get_authenticator (PublishingRESTSupportGooglePublisher* base);
static void publishing_google_photos_publisher_finalize (GObject * obj);
static GType publishing_google_photos_publisher_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);

PublishingGooglePhotosAlbum*
publishing_google_photos_album_construct (GType object_type,
                                          const gchar* name,
                                          const gchar* id)
{
	PublishingGooglePhotosAlbum* self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (id != NULL, NULL);
	self = (PublishingGooglePhotosAlbum*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup (name);
	_g_free0 (self->name);
	self->name = _tmp0_;
	_tmp1_ = g_strdup (id);
	_g_free0 (self->id);
	self->id = _tmp1_;
	return self;
}

PublishingGooglePhotosAlbum*
publishing_google_photos_album_new (const gchar* name,
                                    const gchar* id)
{
	return publishing_google_photos_album_construct (PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM, name, id);
}

static void
publishing_google_photos_value_album_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
publishing_google_photos_value_album_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		publishing_google_photos_album_unref (value->data[0].v_pointer);
	}
}

static void
publishing_google_photos_value_album_copy_value (const GValue* src_value,
                                                 GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = publishing_google_photos_album_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
publishing_google_photos_value_album_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
publishing_google_photos_value_album_collect_value (GValue* value,
                                                    guint n_collect_values,
                                                    GTypeCValue* collect_values,
                                                    guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		PublishingGooglePhotosAlbum * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = publishing_google_photos_album_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
publishing_google_photos_value_album_lcopy_value (const GValue* value,
                                                  guint n_collect_values,
                                                  GTypeCValue* collect_values,
                                                  guint collect_flags)
{
	PublishingGooglePhotosAlbum ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = publishing_google_photos_album_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
publishing_google_photos_param_spec_album (const gchar* name,
                                           const gchar* nick,
                                           const gchar* blurb,
                                           GType object_type,
                                           GParamFlags flags)
{
	PublishingGooglePhotosParamSpecAlbum* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
publishing_google_photos_value_get_album (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM), NULL);
	return value->data[0].v_pointer;
}

void
publishing_google_photos_value_set_album (GValue* value,
                                          gpointer v_object)
{
	PublishingGooglePhotosAlbum * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		publishing_google_photos_album_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_google_photos_album_unref (old);
	}
}

void
publishing_google_photos_value_take_album (GValue* value,
                                           gpointer v_object)
{
	PublishingGooglePhotosAlbum * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_google_photos_album_unref (old);
	}
}

static void
publishing_google_photos_album_class_init (PublishingGooglePhotosAlbumClass * klass,
                                           gpointer klass_data)
{
	publishing_google_photos_album_parent_class = g_type_class_peek_parent (klass);
	((PublishingGooglePhotosAlbumClass *) klass)->finalize = publishing_google_photos_album_finalize;
}

static void
publishing_google_photos_album_instance_init (PublishingGooglePhotosAlbum * self,
                                              gpointer klass)
{
	self->ref_count = 1;
}

static void
publishing_google_photos_album_finalize (PublishingGooglePhotosAlbum * obj)
{
	PublishingGooglePhotosAlbum * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM, PublishingGooglePhotosAlbum);
	g_signal_handlers_destroy (self);
	_g_free0 (self->name);
	_g_free0 (self->id);
}

static GType
publishing_google_photos_album_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_google_photos_value_album_init, publishing_google_photos_value_album_free_value, publishing_google_photos_value_album_copy_value, publishing_google_photos_value_album_peek_pointer, "p", publishing_google_photos_value_album_collect_value, "p", publishing_google_photos_value_album_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingGooglePhotosAlbumClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_google_photos_album_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingGooglePhotosAlbum), 0, (GInstanceInitFunc) publishing_google_photos_album_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType publishing_google_photos_album_type_id;
	publishing_google_photos_album_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingGooglePhotosAlbum", &g_define_type_info, &g_define_type_fundamental_info, 0);
	return publishing_google_photos_album_type_id;
}

GType
publishing_google_photos_album_get_type (void)
{
	static volatile gsize publishing_google_photos_album_type_id__once = 0;
	if (g_once_init_enter (&publishing_google_photos_album_type_id__once)) {
		GType publishing_google_photos_album_type_id;
		publishing_google_photos_album_type_id = publishing_google_photos_album_get_type_once ();
		g_once_init_leave (&publishing_google_photos_album_type_id__once, publishing_google_photos_album_type_id);
	}
	return publishing_google_photos_album_type_id__once;
}

gpointer
publishing_google_photos_album_ref (gpointer instance)
{
	PublishingGooglePhotosAlbum * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
publishing_google_photos_album_unref (gpointer instance)
{
	PublishingGooglePhotosAlbum * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_GOOGLE_PHOTOS_ALBUM_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
publishing_google_photos_publishing_parameters_get_instance_private (PublishingGooglePhotosPublishingParameters* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingGooglePhotosPublishingParameters_private_offset);
}

PublishingGooglePhotosPublishingParameters*
publishing_google_photos_publishing_parameters_construct (GType object_type)
{
	PublishingGooglePhotosPublishingParameters* self = NULL;
	gchar* _tmp0_;
	self = (PublishingGooglePhotosPublishingParameters*) g_type_create_instance (object_type);
	_tmp0_ = g_strdup ("[unknown]");
	_g_free0 (self->priv->user_name);
	self->priv->user_name = _tmp0_;
	_g_free0 (self->priv->target_album_name);
	self->priv->target_album_name = NULL;
	_g_free0 (self->priv->target_album_id);
	self->priv->target_album_id = NULL;
	self->priv->major_axis_size_selection_id = 0;
	self->priv->major_axis_size_pixels = PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_PARAMETERS_ORIGINAL_SIZE;
	self->priv->album_public = FALSE;
	self->priv->albums = (_vala_array_free (self->priv->albums, self->priv->albums_length1, (GDestroyNotify) publishing_google_photos_album_unref), NULL);
	self->priv->albums = NULL;
	self->priv->albums_length1 = 0;
	self->priv->_albums_size_ = self->priv->albums_length1;
	self->priv->strip_metadata = FALSE;
	self->priv->media_type = SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_PHOTO;
	return self;
}

PublishingGooglePhotosPublishingParameters*
publishing_google_photos_publishing_parameters_new (void)
{
	return publishing_google_photos_publishing_parameters_construct (PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS);
}

gchar*
publishing_google_photos_publishing_parameters_get_target_album_name (PublishingGooglePhotosPublishingParameters* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self), NULL);
	_tmp0_ = self->priv->target_album_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

void
publishing_google_photos_publishing_parameters_set_target_album_name (PublishingGooglePhotosPublishingParameters* self,
                                                                      const gchar* target_album_name)
{
	gchar* _tmp0_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self));
	_tmp0_ = g_strdup (target_album_name);
	_g_free0 (self->priv->target_album_name);
	self->priv->target_album_name = _tmp0_;
}

void
publishing_google_photos_publishing_parameters_set_target_album_entry_id (PublishingGooglePhotosPublishingParameters* self,
                                                                          const gchar* target_album_id)
{
	gchar* _tmp0_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self));
	g_return_if_fail (target_album_id != NULL);
	_tmp0_ = g_strdup (target_album_id);
	_g_free0 (self->priv->target_album_id);
	self->priv->target_album_id = _tmp0_;
}

gchar*
publishing_google_photos_publishing_parameters_get_target_album_entry_id (PublishingGooglePhotosPublishingParameters* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self), NULL);
	_tmp0_ = self->priv->target_album_id;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

gchar*
publishing_google_photos_publishing_parameters_get_user_name (PublishingGooglePhotosPublishingParameters* self)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self), NULL);
	_tmp0_ = self->priv->user_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

void
publishing_google_photos_publishing_parameters_set_user_name (PublishingGooglePhotosPublishingParameters* self,
                                                              const gchar* user_name)
{
	gchar* _tmp0_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self));
	g_return_if_fail (user_name != NULL);
	_tmp0_ = g_strdup (user_name);
	_g_free0 (self->priv->user_name);
	self->priv->user_name = _tmp0_;
}

static gpointer
_publishing_google_photos_album_ref0 (gpointer self)
{
	return self ? publishing_google_photos_album_ref (self) : NULL;
}

static PublishingGooglePhotosAlbum**
_vala_array_dup4 (PublishingGooglePhotosAlbum** self,
                  gssize length)
{
	if (length >= 0) {
		PublishingGooglePhotosAlbum** result;
		gssize i;
		result = g_new0 (PublishingGooglePhotosAlbum*, length + 1);
		for (i = 0; i < length; i++) {
			PublishingGooglePhotosAlbum* _tmp0_;
			_tmp0_ = _publishing_google_photos_album_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

PublishingGooglePhotosAlbum**
publishing_google_photos_publishing_parameters_get_albums (PublishingGooglePhotosPublishingParameters* self,
                                                           gint* result_length1)
{
	PublishingGooglePhotosAlbum** _tmp0_;
	gint _tmp0__length1;
	PublishingGooglePhotosAlbum** _tmp1_;
	gint _tmp1__length1;
	PublishingGooglePhotosAlbum** _tmp2_;
	gint _tmp2__length1;
	PublishingGooglePhotosAlbum** result;
	g_return_val_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self), NULL);
	_tmp0_ = self->priv->albums;
	_tmp0__length1 = self->priv->albums_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup4 (_tmp0_, _tmp0__length1) : _tmp0_;
	_tmp1__length1 = _tmp0__length1;
	_tmp2_ = _tmp1_;
	_tmp2__length1 = _tmp1__length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static PublishingGooglePhotosAlbum**
_vala_array_dup5 (PublishingGooglePhotosAlbum** self,
                  gssize length)
{
	if (length >= 0) {
		PublishingGooglePhotosAlbum** result;
		gssize i;
		result = g_new0 (PublishingGooglePhotosAlbum*, length + 1);
		for (i = 0; i < length; i++) {
			PublishingGooglePhotosAlbum* _tmp0_;
			_tmp0_ = _publishing_google_photos_album_ref0 (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

void
publishing_google_photos_publishing_parameters_set_albums (PublishingGooglePhotosPublishingParameters* self,
                                                           PublishingGooglePhotosAlbum** albums,
                                                           gint albums_length1)
{
	PublishingGooglePhotosAlbum** _tmp0_;
	gint _tmp0__length1;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self));
	_tmp0_ = (albums != NULL) ? _vala_array_dup5 (albums, albums_length1) : albums;
	_tmp0__length1 = albums_length1;
	self->priv->albums = (_vala_array_free (self->priv->albums, self->priv->albums_length1, (GDestroyNotify) publishing_google_photos_album_unref), NULL);
	self->priv->albums = _tmp0_;
	self->priv->albums_length1 = _tmp0__length1;
	self->priv->_albums_size_ = self->priv->albums_length1;
}

void
publishing_google_photos_publishing_parameters_set_major_axis_size_pixels (PublishingGooglePhotosPublishingParameters* self,
                                                                           gint pixels)
{
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self));
	self->priv->major_axis_size_pixels = pixels;
}

gint
publishing_google_photos_publishing_parameters_get_major_axis_size_pixels (PublishingGooglePhotosPublishingParameters* self)
{
	gint result;
	g_return_val_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self), -1);
	result = self->priv->major_axis_size_pixels;
	return result;
}

void
publishing_google_photos_publishing_parameters_set_major_axis_size_selection_id (PublishingGooglePhotosPublishingParameters* self,
                                                                                 gint selection_id)
{
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self));
	self->priv->major_axis_size_selection_id = selection_id;
}

gint
publishing_google_photos_publishing_parameters_get_major_axis_size_selection_id (PublishingGooglePhotosPublishingParameters* self)
{
	gint result;
	g_return_val_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self), -1);
	result = self->priv->major_axis_size_selection_id;
	return result;
}

void
publishing_google_photos_publishing_parameters_set_strip_metadata (PublishingGooglePhotosPublishingParameters* self,
                                                                   gboolean strip_metadata)
{
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self));
	self->priv->strip_metadata = strip_metadata;
}

gboolean
publishing_google_photos_publishing_parameters_get_strip_metadata (PublishingGooglePhotosPublishingParameters* self)
{
	gboolean result;
	g_return_val_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self), FALSE);
	result = self->priv->strip_metadata;
	return result;
}

void
publishing_google_photos_publishing_parameters_set_media_type (PublishingGooglePhotosPublishingParameters* self,
                                                               SpitPublishingPublisherMediaType media_type)
{
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self));
	self->priv->media_type = media_type;
}

SpitPublishingPublisherMediaType
publishing_google_photos_publishing_parameters_get_media_type (PublishingGooglePhotosPublishingParameters* self)
{
	SpitPublishingPublisherMediaType result;
	g_return_val_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (self), 0);
	result = self->priv->media_type;
	return result;
}

static void
publishing_google_photos_value_publishing_parameters_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
publishing_google_photos_value_publishing_parameters_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		publishing_google_photos_publishing_parameters_unref (value->data[0].v_pointer);
	}
}

static void
publishing_google_photos_value_publishing_parameters_copy_value (const GValue* src_value,
                                                                 GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = publishing_google_photos_publishing_parameters_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
publishing_google_photos_value_publishing_parameters_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
publishing_google_photos_value_publishing_parameters_collect_value (GValue* value,
                                                                    guint n_collect_values,
                                                                    GTypeCValue* collect_values,
                                                                    guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		PublishingGooglePhotosPublishingParameters * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = publishing_google_photos_publishing_parameters_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
publishing_google_photos_value_publishing_parameters_lcopy_value (const GValue* value,
                                                                  guint n_collect_values,
                                                                  GTypeCValue* collect_values,
                                                                  guint collect_flags)
{
	PublishingGooglePhotosPublishingParameters ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = publishing_google_photos_publishing_parameters_ref (value->data[0].v_pointer);
	}
	return NULL;
}

GParamSpec*
publishing_google_photos_param_spec_publishing_parameters (const gchar* name,
                                                           const gchar* nick,
                                                           const gchar* blurb,
                                                           GType object_type,
                                                           GParamFlags flags)
{
	PublishingGooglePhotosParamSpecPublishingParameters* spec;
	g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

gpointer
publishing_google_photos_value_get_publishing_parameters (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS), NULL);
	return value->data[0].v_pointer;
}

void
publishing_google_photos_value_set_publishing_parameters (GValue* value,
                                                          gpointer v_object)
{
	PublishingGooglePhotosPublishingParameters * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		publishing_google_photos_publishing_parameters_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_google_photos_publishing_parameters_unref (old);
	}
}

void
publishing_google_photos_value_take_publishing_parameters (GValue* value,
                                                           gpointer v_object)
{
	PublishingGooglePhotosPublishingParameters * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		publishing_google_photos_publishing_parameters_unref (old);
	}
}

static void
publishing_google_photos_publishing_parameters_class_init (PublishingGooglePhotosPublishingParametersClass * klass,
                                                           gpointer klass_data)
{
	publishing_google_photos_publishing_parameters_parent_class = g_type_class_peek_parent (klass);
	((PublishingGooglePhotosPublishingParametersClass *) klass)->finalize = publishing_google_photos_publishing_parameters_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingGooglePhotosPublishingParameters_private_offset);
}

static void
publishing_google_photos_publishing_parameters_instance_init (PublishingGooglePhotosPublishingParameters * self,
                                                              gpointer klass)
{
	self->priv = publishing_google_photos_publishing_parameters_get_instance_private (self);
	self->ref_count = 1;
}

static void
publishing_google_photos_publishing_parameters_finalize (PublishingGooglePhotosPublishingParameters * obj)
{
	PublishingGooglePhotosPublishingParameters * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHING_PARAMETERS, PublishingGooglePhotosPublishingParameters);
	g_signal_handlers_destroy (self);
	_g_free0 (self->priv->target_album_name);
	_g_free0 (self->priv->target_album_id);
	_g_free0 (self->priv->user_name);
	self->priv->albums = (_vala_array_free (self->priv->albums, self->priv->albums_length1, (GDestroyNotify) publishing_google_photos_album_unref), NULL);
}

static GType
publishing_google_photos_publishing_parameters_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { publishing_google_photos_value_publishing_parameters_init, publishing_google_photos_value_publishing_parameters_free_value, publishing_google_photos_value_publishing_parameters_copy_value, publishing_google_photos_value_publishing_parameters_peek_pointer, "p", publishing_google_photos_value_publishing_parameters_collect_value, "p", publishing_google_photos_value_publishing_parameters_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (PublishingGooglePhotosPublishingParametersClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_google_photos_publishing_parameters_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingGooglePhotosPublishingParameters), 0, (GInstanceInitFunc) publishing_google_photos_publishing_parameters_instance_init, &g_define_type_value_table };
	static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
	GType publishing_google_photos_publishing_parameters_type_id;
	publishing_google_photos_publishing_parameters_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingGooglePhotosPublishingParameters", &g_define_type_info, &g_define_type_fundamental_info, 0);
	PublishingGooglePhotosPublishingParameters_private_offset = g_type_add_instance_private (publishing_google_photos_publishing_parameters_type_id, sizeof (PublishingGooglePhotosPublishingParametersPrivate));
	return publishing_google_photos_publishing_parameters_type_id;
}

GType
publishing_google_photos_publishing_parameters_get_type (void)
{
	static volatile gsize publishing_google_photos_publishing_parameters_type_id__once = 0;
	if (g_once_init_enter (&publishing_google_photos_publishing_parameters_type_id__once)) {
		GType publishing_google_photos_publishing_parameters_type_id;
		publishing_google_photos_publishing_parameters_type_id = publishing_google_photos_publishing_parameters_get_type_once ();
		g_once_init_leave (&publishing_google_photos_publishing_parameters_type_id__once, publishing_google_photos_publishing_parameters_type_id);
	}
	return publishing_google_photos_publishing_parameters_type_id__once;
}

gpointer
publishing_google_photos_publishing_parameters_ref (gpointer instance)
{
	PublishingGooglePhotosPublishingParameters * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

void
publishing_google_photos_publishing_parameters_unref (gpointer instance)
{
	PublishingGooglePhotosPublishingParameters * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		PUBLISHING_GOOGLE_PHOTOS_PUBLISHING_PARAMETERS_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static inline gpointer
publishing_google_photos_media_creation_transaction_get_instance_private (PublishingGooglePhotosMediaCreationTransaction* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingGooglePhotosMediaCreationTransaction_private_offset);
}

static gchar**
_vala_array_dup6 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

static gchar**
_vala_array_dup7 (gchar** self,
                  gssize length)
{
	if (length >= 0) {
		gchar** result;
		gssize i;
		result = g_new0 (gchar*, length + 1);
		for (i = 0; i < length; i++) {
			gchar* _tmp0_;
			_tmp0_ = g_strdup (self[i]);
			result[i] = _tmp0_;
		}
		return result;
	}
	return NULL;
}

PublishingGooglePhotosMediaCreationTransaction*
publishing_google_photos_media_creation_transaction_construct (GType object_type,
                                                               PublishingRESTSupportGoogleSession* session,
                                                               gchar** upload_tokens,
                                                               gint upload_tokens_length1,
                                                               gchar** titles,
                                                               gint titles_length1,
                                                               const gchar* album_id)
{
	PublishingGooglePhotosMediaCreationTransaction* self = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	gchar* _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (session, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_SESSION), NULL);
	g_return_val_if_fail (album_id != NULL, NULL);
	self = (PublishingGooglePhotosMediaCreationTransaction*) publishing_rest_support_google_publisher_authenticated_transaction_construct (object_type, session, PUBLISHING_GOOGLE_PHOTOS_MEDIA_CREATION_TRANSACTION_ENDPOINT_URL, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST);
	_vala_assert (upload_tokens_length1 == titles_length1, "upload_tokens.length == titles.length");
	_tmp0_ = (upload_tokens != NULL) ? _vala_array_dup6 (upload_tokens, upload_tokens_length1) : upload_tokens;
	_tmp0__length1 = upload_tokens_length1;
	self->priv->upload_tokens = (_vala_array_free (self->priv->upload_tokens, self->priv->upload_tokens_length1, (GDestroyNotify) g_free), NULL);
	self->priv->upload_tokens = _tmp0_;
	self->priv->upload_tokens_length1 = _tmp0__length1;
	self->priv->_upload_tokens_size_ = self->priv->upload_tokens_length1;
	_tmp1_ = g_strdup (album_id);
	_g_free0 (self->priv->album_id);
	self->priv->album_id = _tmp1_;
	_tmp2_ = (titles != NULL) ? _vala_array_dup7 (titles, titles_length1) : titles;
	_tmp2__length1 = titles_length1;
	self->priv->titles = (_vala_array_free (self->priv->titles, self->priv->titles_length1, (GDestroyNotify) g_free), NULL);
	self->priv->titles = _tmp2_;
	self->priv->titles_length1 = _tmp2__length1;
	self->priv->_titles_size_ = self->priv->titles_length1;
	return self;
}

PublishingGooglePhotosMediaCreationTransaction*
publishing_google_photos_media_creation_transaction_new (PublishingRESTSupportGoogleSession* session,
                                                         gchar** upload_tokens,
                                                         gint upload_tokens_length1,
                                                         gchar** titles,
                                                         gint titles_length1,
                                                         const gchar* album_id)
{
	return publishing_google_photos_media_creation_transaction_construct (PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION, session, upload_tokens, upload_tokens_length1, titles, titles_length1, album_id);
}

static void
publishing_google_photos_media_creation_transaction_real_execute_async_data_free (gpointer _data)
{
	PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData* _data_;
	_data_ = _data;
	_publishing_rest_support_transaction_unref0 (_data_->self);
	g_slice_free (PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData, _data_);
}

static gpointer
_publishing_rest_support_transaction_ref0 (gpointer self)
{
	return self ? publishing_rest_support_transaction_ref (self) : NULL;
}

static void
publishing_google_photos_media_creation_transaction_real_execute_async (PublishingRESTSupportTransaction* base,
                                                                        GAsyncReadyCallback _callback_,
                                                                        gpointer _user_data_)
{
	PublishingGooglePhotosMediaCreationTransaction * self;
	PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData* _data_;
	PublishingGooglePhotosMediaCreationTransaction* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION, PublishingGooglePhotosMediaCreationTransaction);
	_data_ = g_slice_new0 (PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_google_photos_media_creation_transaction_real_execute_async_data_free);
	_tmp0_ = _publishing_rest_support_transaction_ref0 (self);
	_data_->self = _tmp0_;
	publishing_google_photos_media_creation_transaction_real_execute_async_co (_data_);
}

static void
publishing_google_photos_media_creation_transaction_execute_finish (PublishingRESTSupportTransaction* base,
                                                                    GAsyncResult* _res_,
                                                                    GError** error)
{
	PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static void
publishing_google_photos_media_creation_transaction_execute_async_ready (GObject* source_object,
                                                                         GAsyncResult* _res_,
                                                                         gpointer _user_data_)
{
	PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_google_photos_media_creation_transaction_real_execute_async_co (_data_);
}

static gboolean
publishing_google_photos_media_creation_transaction_real_execute_async_co (PublishingGooglePhotosMediaCreationTransactionExecuteAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = json_builder_new ();
	_data_->builder = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->builder;
	json_builder_begin_object (_data_->_tmp1_);
	_data_->_tmp2_ = _data_->builder;
	json_builder_set_member_name (_data_->_tmp2_, "albumId");
	_data_->_tmp3_ = _data_->builder;
	_data_->_tmp4_ = _data_->self->priv->album_id;
	json_builder_add_string_value (_data_->_tmp3_, _data_->_tmp4_);
	_data_->_tmp5_ = _data_->builder;
	json_builder_set_member_name (_data_->_tmp5_, "newMediaItems");
	_data_->_tmp6_ = _data_->builder;
	json_builder_begin_array (_data_->_tmp6_);
	{
		_data_->i = 0;
		{
			_data_->_tmp7_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp7_) {
					_data_->_tmp8_ = _data_->i;
					_data_->i = _data_->_tmp8_ + 1;
				}
				_data_->_tmp7_ = FALSE;
				_data_->_tmp9_ = _data_->self->priv->upload_tokens;
				_data_->_tmp9__length1 = _data_->self->priv->upload_tokens_length1;
				if (!(_data_->i < _data_->_tmp9__length1)) {
					break;
				}
				_data_->_tmp10_ = _data_->builder;
				json_builder_begin_object (_data_->_tmp10_);
				_data_->_tmp11_ = _data_->builder;
				json_builder_set_member_name (_data_->_tmp11_, "description");
				_data_->_tmp12_ = _data_->builder;
				_data_->_tmp13_ = _data_->self->priv->titles;
				_data_->_tmp13__length1 = _data_->self->priv->titles_length1;
				_data_->_tmp14_ = _data_->_tmp13_[_data_->i];
				json_builder_add_string_value (_data_->_tmp12_, _data_->_tmp14_);
				_data_->_tmp15_ = _data_->builder;
				json_builder_set_member_name (_data_->_tmp15_, "simpleMediaItem");
				_data_->_tmp16_ = _data_->builder;
				json_builder_begin_object (_data_->_tmp16_);
				_data_->_tmp17_ = _data_->builder;
				json_builder_set_member_name (_data_->_tmp17_, "uploadToken");
				_data_->_tmp18_ = _data_->builder;
				_data_->_tmp19_ = _data_->self->priv->upload_tokens;
				_data_->_tmp19__length1 = _data_->self->priv->upload_tokens_length1;
				_data_->_tmp20_ = _data_->_tmp19_[_data_->i];
				json_builder_add_string_value (_data_->_tmp18_, _data_->_tmp20_);
				_data_->_tmp21_ = _data_->builder;
				json_builder_end_object (_data_->_tmp21_);
				_data_->_tmp22_ = _data_->builder;
				json_builder_end_object (_data_->_tmp22_);
			}
		}
	}
	_data_->_tmp23_ = _data_->builder;
	json_builder_end_array (_data_->_tmp23_);
	_data_->_tmp24_ = _data_->builder;
	json_builder_end_object (_data_->_tmp24_);
	_data_->_tmp25_ = _data_->builder;
	_data_->_tmp26_ = json_builder_get_root (_data_->_tmp25_);
	_data_->_tmp27_ = _data_->_tmp26_;
	_data_->_tmp28_ = json_to_string (_data_->_tmp27_, FALSE);
	_data_->_tmp29_ = _data_->_tmp28_;
	publishing_rest_support_transaction_set_custom_payload (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_tmp29_, "application/json", (gulong) 0);
	_g_free0 (_data_->_tmp29_);
	__vala_JsonNode_free0 (_data_->_tmp27_);
	_data_->_state_ = 1;
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_google_photos_media_creation_transaction_parent_class)->execute_async (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_GOOGLE_PUBLISHER_TYPE_AUTHENTICATED_TRANSACTION, PublishingRESTSupportGooglePublisherAuthenticatedTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_google_photos_media_creation_transaction_execute_async_ready, _data_);
	return FALSE;
	_state_1:
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_google_photos_media_creation_transaction_parent_class)->execute_finish (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_GOOGLE_PUBLISHER_TYPE_AUTHENTICATED_TRANSACTION, PublishingRESTSupportGooglePublisherAuthenticatedTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->builder);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->builder);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_g_object_unref0 (_data_->builder);
	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
publishing_google_photos_media_creation_transaction_class_init (PublishingGooglePhotosMediaCreationTransactionClass * klass,
                                                                gpointer klass_data)
{
	publishing_google_photos_media_creation_transaction_parent_class = g_type_class_peek_parent (klass);
	((PublishingRESTSupportTransactionClass *) klass)->finalize = publishing_google_photos_media_creation_transaction_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingGooglePhotosMediaCreationTransaction_private_offset);
	((PublishingRESTSupportTransactionClass *) klass)->execute_async = (void (*) (PublishingRESTSupportTransaction*, GAsyncReadyCallback, gpointer)) publishing_google_photos_media_creation_transaction_real_execute_async;
	((PublishingRESTSupportTransactionClass *) klass)->execute_finish = (void (*) (PublishingRESTSupportTransaction*, GAsyncResult*, GError**)) publishing_google_photos_media_creation_transaction_execute_finish;
}

static void
publishing_google_photos_media_creation_transaction_instance_init (PublishingGooglePhotosMediaCreationTransaction * self,
                                                                   gpointer klass)
{
	self->priv = publishing_google_photos_media_creation_transaction_get_instance_private (self);
}

static void
publishing_google_photos_media_creation_transaction_finalize (PublishingRESTSupportTransaction * obj)
{
	PublishingGooglePhotosMediaCreationTransaction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_GOOGLE_PHOTOS_TYPE_MEDIA_CREATION_TRANSACTION, PublishingGooglePhotosMediaCreationTransaction);
	self->priv->upload_tokens = (_vala_array_free (self->priv->upload_tokens, self->priv->upload_tokens_length1, (GDestroyNotify) g_free), NULL);
	self->priv->titles = (_vala_array_free (self->priv->titles, self->priv->titles_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (self->priv->album_id);
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_google_photos_media_creation_transaction_parent_class)->finalize (obj);
}

static GType
publishing_google_photos_media_creation_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingGooglePhotosMediaCreationTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_google_photos_media_creation_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingGooglePhotosMediaCreationTransaction), 0, (GInstanceInitFunc) publishing_google_photos_media_creation_transaction_instance_init, NULL };
	GType publishing_google_photos_media_creation_transaction_type_id;
	publishing_google_photos_media_creation_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_GOOGLE_PUBLISHER_TYPE_AUTHENTICATED_TRANSACTION, "PublishingGooglePhotosMediaCreationTransaction", &g_define_type_info, 0);
	PublishingGooglePhotosMediaCreationTransaction_private_offset = g_type_add_instance_private (publishing_google_photos_media_creation_transaction_type_id, sizeof (PublishingGooglePhotosMediaCreationTransactionPrivate));
	return publishing_google_photos_media_creation_transaction_type_id;
}

GType
publishing_google_photos_media_creation_transaction_get_type (void)
{
	static volatile gsize publishing_google_photos_media_creation_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_google_photos_media_creation_transaction_type_id__once)) {
		GType publishing_google_photos_media_creation_transaction_type_id;
		publishing_google_photos_media_creation_transaction_type_id = publishing_google_photos_media_creation_transaction_get_type_once ();
		g_once_init_leave (&publishing_google_photos_media_creation_transaction_type_id__once, publishing_google_photos_media_creation_transaction_type_id);
	}
	return publishing_google_photos_media_creation_transaction_type_id__once;
}

static inline gpointer
publishing_google_photos_album_creation_transaction_get_instance_private (PublishingGooglePhotosAlbumCreationTransaction* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingGooglePhotosAlbumCreationTransaction_private_offset);
}

PublishingGooglePhotosAlbumCreationTransaction*
publishing_google_photos_album_creation_transaction_construct (GType object_type,
                                                               PublishingRESTSupportGoogleSession* session,
                                                               const gchar* title)
{
	PublishingGooglePhotosAlbumCreationTransaction* self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (session, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_SESSION), NULL);
	g_return_val_if_fail (title != NULL, NULL);
	self = (PublishingGooglePhotosAlbumCreationTransaction*) publishing_rest_support_google_publisher_authenticated_transaction_construct (object_type, session, PUBLISHING_GOOGLE_PHOTOS_ALBUM_CREATION_TRANSACTION_ENDPOINT_URL, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST);
	_tmp0_ = g_strdup (title);
	_g_free0 (self->priv->title);
	self->priv->title = _tmp0_;
	return self;
}

PublishingGooglePhotosAlbumCreationTransaction*
publishing_google_photos_album_creation_transaction_new (PublishingRESTSupportGoogleSession* session,
                                                         const gchar* title)
{
	return publishing_google_photos_album_creation_transaction_construct (PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION, session, title);
}

static void
publishing_google_photos_album_creation_transaction_real_execute_async_data_free (gpointer _data)
{
	PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData* _data_;
	_data_ = _data;
	_publishing_rest_support_transaction_unref0 (_data_->self);
	g_slice_free (PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData, _data_);
}

static void
publishing_google_photos_album_creation_transaction_real_execute_async (PublishingRESTSupportTransaction* base,
                                                                        GAsyncReadyCallback _callback_,
                                                                        gpointer _user_data_)
{
	PublishingGooglePhotosAlbumCreationTransaction * self;
	PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData* _data_;
	PublishingGooglePhotosAlbumCreationTransaction* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION, PublishingGooglePhotosAlbumCreationTransaction);
	_data_ = g_slice_new0 (PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_google_photos_album_creation_transaction_real_execute_async_data_free);
	_tmp0_ = _publishing_rest_support_transaction_ref0 (self);
	_data_->self = _tmp0_;
	publishing_google_photos_album_creation_transaction_real_execute_async_co (_data_);
}

static void
publishing_google_photos_album_creation_transaction_execute_finish (PublishingRESTSupportTransaction* base,
                                                                    GAsyncResult* _res_,
                                                                    GError** error)
{
	PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
publishing_google_photos_album_creation_transaction_execute_async_ready (GObject* source_object,
                                                                         GAsyncResult* _res_,
                                                                         gpointer _user_data_)
{
	PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_google_photos_album_creation_transaction_real_execute_async_co (_data_);
}

static gboolean
publishing_google_photos_album_creation_transaction_real_execute_async_co (PublishingGooglePhotosAlbumCreationTransactionExecuteAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = json_builder_new ();
	_data_->builder = _data_->_tmp0_;
	json_builder_begin_object (_data_->builder);
	json_builder_set_member_name (_data_->builder, "album");
	json_builder_begin_object (_data_->builder);
	json_builder_set_member_name (_data_->builder, "title");
	_data_->_tmp1_ = _data_->self->priv->title;
	json_builder_add_string_value (_data_->builder, _data_->_tmp1_);
	json_builder_end_object (_data_->builder);
	json_builder_end_object (_data_->builder);
	_data_->_tmp2_ = json_builder_get_root (_data_->builder);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = json_to_string (_data_->_tmp3_, FALSE);
	_data_->_tmp5_ = _data_->_tmp4_;
	publishing_rest_support_transaction_set_custom_payload (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_tmp5_, "application/json", (gulong) 0);
	_g_free0 (_data_->_tmp5_);
	__vala_JsonNode_free0 (_data_->_tmp3_);
	_data_->_state_ = 1;
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_google_photos_album_creation_transaction_parent_class)->execute_async (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_GOOGLE_PUBLISHER_TYPE_AUTHENTICATED_TRANSACTION, PublishingRESTSupportGooglePublisherAuthenticatedTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_google_photos_album_creation_transaction_execute_async_ready, _data_);
	return FALSE;
	_state_1:
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_google_photos_album_creation_transaction_parent_class)->execute_finish (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_GOOGLE_PUBLISHER_TYPE_AUTHENTICATED_TRANSACTION, PublishingRESTSupportGooglePublisherAuthenticatedTransaction), PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->builder);
			g_object_unref (_data_->_async_result);
			return FALSE;
		} else {
			_g_object_unref0 (_data_->builder);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	_g_object_unref0 (_data_->builder);
	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
publishing_google_photos_album_creation_transaction_class_init (PublishingGooglePhotosAlbumCreationTransactionClass * klass,
                                                                gpointer klass_data)
{
	publishing_google_photos_album_creation_transaction_parent_class = g_type_class_peek_parent (klass);
	((PublishingRESTSupportTransactionClass *) klass)->finalize = publishing_google_photos_album_creation_transaction_finalize;
	g_type_class_adjust_private_offset (klass, &PublishingGooglePhotosAlbumCreationTransaction_private_offset);
	((PublishingRESTSupportTransactionClass *) klass)->execute_async = (void (*) (PublishingRESTSupportTransaction*, GAsyncReadyCallback, gpointer)) publishing_google_photos_album_creation_transaction_real_execute_async;
	((PublishingRESTSupportTransactionClass *) klass)->execute_finish = (void (*) (PublishingRESTSupportTransaction*, GAsyncResult*, GError**)) publishing_google_photos_album_creation_transaction_execute_finish;
}

static void
publishing_google_photos_album_creation_transaction_instance_init (PublishingGooglePhotosAlbumCreationTransaction * self,
                                                                   gpointer klass)
{
	self->priv = publishing_google_photos_album_creation_transaction_get_instance_private (self);
}

static void
publishing_google_photos_album_creation_transaction_finalize (PublishingRESTSupportTransaction * obj)
{
	PublishingGooglePhotosAlbumCreationTransaction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_CREATION_TRANSACTION, PublishingGooglePhotosAlbumCreationTransaction);
	_g_free0 (self->priv->title);
	PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_google_photos_album_creation_transaction_parent_class)->finalize (obj);
}

static GType
publishing_google_photos_album_creation_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingGooglePhotosAlbumCreationTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_google_photos_album_creation_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingGooglePhotosAlbumCreationTransaction), 0, (GInstanceInitFunc) publishing_google_photos_album_creation_transaction_instance_init, NULL };
	GType publishing_google_photos_album_creation_transaction_type_id;
	publishing_google_photos_album_creation_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_GOOGLE_PUBLISHER_TYPE_AUTHENTICATED_TRANSACTION, "PublishingGooglePhotosAlbumCreationTransaction", &g_define_type_info, 0);
	PublishingGooglePhotosAlbumCreationTransaction_private_offset = g_type_add_instance_private (publishing_google_photos_album_creation_transaction_type_id, sizeof (PublishingGooglePhotosAlbumCreationTransactionPrivate));
	return publishing_google_photos_album_creation_transaction_type_id;
}

GType
publishing_google_photos_album_creation_transaction_get_type (void)
{
	static volatile gsize publishing_google_photos_album_creation_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_google_photos_album_creation_transaction_type_id__once)) {
		GType publishing_google_photos_album_creation_transaction_type_id;
		publishing_google_photos_album_creation_transaction_type_id = publishing_google_photos_album_creation_transaction_get_type_once ();
		g_once_init_leave (&publishing_google_photos_album_creation_transaction_type_id__once, publishing_google_photos_album_creation_transaction_type_id);
	}
	return publishing_google_photos_album_creation_transaction_type_id__once;
}

PublishingGooglePhotosAlbumDirectoryTransaction*
publishing_google_photos_album_directory_transaction_construct (GType object_type,
                                                                PublishingRESTSupportGoogleSession* session,
                                                                const gchar* token)
{
	PublishingGooglePhotosAlbumDirectoryTransaction* self = NULL;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (session, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_SESSION), NULL);
	self = (PublishingGooglePhotosAlbumDirectoryTransaction*) publishing_rest_support_google_publisher_authenticated_transaction_construct (object_type, session, PUBLISHING_GOOGLE_PHOTOS_ALBUM_DIRECTORY_TRANSACTION_ENDPOINT_URL, PUBLISHING_REST_SUPPORT_HTTP_METHOD_GET);
	if (token != NULL) {
		publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "pageToken", token);
	}
	return self;
}

PublishingGooglePhotosAlbumDirectoryTransaction*
publishing_google_photos_album_directory_transaction_new (PublishingRESTSupportGoogleSession* session,
                                                          const gchar* token)
{
	return publishing_google_photos_album_directory_transaction_construct (PUBLISHING_GOOGLE_PHOTOS_TYPE_ALBUM_DIRECTORY_TRANSACTION, session, token);
}

static void
publishing_google_photos_album_directory_transaction_class_init (PublishingGooglePhotosAlbumDirectoryTransactionClass * klass,
                                                                 gpointer klass_data)
{
	publishing_google_photos_album_directory_transaction_parent_class = g_type_class_peek_parent (klass);
}

static void
publishing_google_photos_album_directory_transaction_instance_init (PublishingGooglePhotosAlbumDirectoryTransaction * self,
                                                                    gpointer klass)
{
}

static GType
publishing_google_photos_album_directory_transaction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingGooglePhotosAlbumDirectoryTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_google_photos_album_directory_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingGooglePhotosAlbumDirectoryTransaction), 0, (GInstanceInitFunc) publishing_google_photos_album_directory_transaction_instance_init, NULL };
	GType publishing_google_photos_album_directory_transaction_type_id;
	publishing_google_photos_album_directory_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_GOOGLE_PUBLISHER_TYPE_AUTHENTICATED_TRANSACTION, "PublishingGooglePhotosAlbumDirectoryTransaction", &g_define_type_info, 0);
	return publishing_google_photos_album_directory_transaction_type_id;
}

GType
publishing_google_photos_album_directory_transaction_get_type (void)
{
	static volatile gsize publishing_google_photos_album_directory_transaction_type_id__once = 0;
	if (g_once_init_enter (&publishing_google_photos_album_directory_transaction_type_id__once)) {
		GType publishing_google_photos_album_directory_transaction_type_id;
		publishing_google_photos_album_directory_transaction_type_id = publishing_google_photos_album_directory_transaction_get_type_once ();
		g_once_init_leave (&publishing_google_photos_album_directory_transaction_type_id__once, publishing_google_photos_album_directory_transaction_type_id);
	}
	return publishing_google_photos_album_directory_transaction_type_id__once;
}

static inline gpointer
publishing_google_photos_publisher_get_instance_private (PublishingGooglePhotosPublisher* self)
{
	return G_STRUCT_MEMBER_P (self, PublishingGooglePhotosPublisher_private_offset);
}

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

PublishingGooglePhotosPublisher*
publishing_google_photos_publisher_construct (GType object_type,
                                              SpitPublishingService* service,
                                              SpitPublishingPluginHost* host)
{
	PublishingGooglePhotosPublisher * self = NULL;
	PublishingGooglePhotosPublishingParameters* _tmp0_;
	PublishingGooglePhotosPublishingParameters* _tmp1_;
	SpitPublishingPublisherMediaType media_type = 0;
	gint _tmp2_ = 0;
	SpitPublishingPublishable** _tmp3_;
	PublishingGooglePhotosPublishingParameters* _tmp6_;
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (service, SPIT_PUBLISHING_TYPE_SERVICE), NULL);
	g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (host, SPIT_PUBLISHING_TYPE_PLUGIN_HOST), NULL);
	self = (PublishingGooglePhotosPublisher*) publishing_rest_support_google_publisher_construct (object_type, service, host, "https://www.googleapis.com/auth/photoslibrary");
	_tmp0_ = publishing_google_photos_publishing_parameters_new ();
	_publishing_google_photos_publishing_parameters_unref0 (self->priv->publishing_parameters);
	self->priv->publishing_parameters = _tmp0_;
	_tmp1_ = self->priv->publishing_parameters;
	publishing_google_photos_publisher_load_parameters_from_configuration_system (self, _tmp1_);
	media_type = SPIT_PUBLISHING_PUBLISHER_MEDIA_TYPE_NONE;
	_tmp3_ = spit_publishing_plugin_host_get_publishables (host, &_tmp2_);
	{
		SpitPublishingPublishable** p_collection = NULL;
		gint p_collection_length1 = 0;
		gint _p_collection_size_ = 0;
		gint p_it = 0;
		p_collection = _tmp3_;
		p_collection_length1 = _tmp2_;
		for (p_it = 0; p_it < p_collection_length1; p_it = p_it + 1) {
			SpitPublishingPublishable* _tmp4_;
			SpitPublishingPublishable* p = NULL;
			_tmp4_ = _g_object_ref0 (p_collection[p_it]);
			p = _tmp4_;
			{
				SpitPublishingPublishable* _tmp5_;
				_tmp5_ = p;
				media_type |= spit_publishing_publishable_get_media_type (_tmp5_);
				_g_object_unref0 (p);
			}
		}
		p_collection = (_vala_array_free (p_collection, p_collection_length1, (GDestroyNotify) g_object_unref), NULL);
	}
	_tmp6_ = self->priv->publishing_parameters;
	publishing_google_photos_publishing_parameters_set_media_type (_tmp6_, media_type);
	return self;
}

PublishingGooglePhotosPublisher*
publishing_google_photos_publisher_new (SpitPublishingService* service,
                                        SpitPublishingPluginHost* host)
{
	return publishing_google_photos_publisher_construct (PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHER, service, host);
}

static void
publishing_google_photos_publisher_load_parameters_from_configuration_system (PublishingGooglePhotosPublisher* self,
                                                                              PublishingGooglePhotosPublishingParameters* parameters)
{
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	SpitPublishingPluginHost* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (parameters));
	_tmp0_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	publishing_google_photos_publishing_parameters_set_major_axis_size_selection_id (parameters, spit_host_interface_get_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "default-size", 0));
	_tmp1_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	publishing_google_photos_publishing_parameters_set_strip_metadata (parameters, spit_host_interface_get_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "strip-metadata", FALSE));
	_tmp2_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_tmp3_ = spit_host_interface_get_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-album", NULL);
	_tmp4_ = _tmp3_;
	publishing_google_photos_publishing_parameters_set_target_album_name (parameters, _tmp4_);
	_g_free0 (_tmp4_);
}

static void
publishing_google_photos_publisher_save_parameters_to_configuration_system (PublishingGooglePhotosPublisher* self,
                                                                            PublishingGooglePhotosPublishingParameters* parameters)
{
	SpitPublishingPluginHost* _tmp0_;
	SpitPublishingPluginHost* _tmp1_;
	SpitPublishingPluginHost* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHING_PARAMETERS (parameters));
	_tmp0_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_host_interface_set_config_int (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "default-size", publishing_google_photos_publishing_parameters_get_major_axis_size_selection_id (parameters));
	_tmp1_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_host_interface_set_config_bool (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "strip_metadata", publishing_google_photos_publishing_parameters_get_strip_metadata (parameters));
	_tmp2_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_tmp3_ = publishing_google_photos_publishing_parameters_get_target_album_name (parameters);
	_tmp4_ = _tmp3_;
	spit_host_interface_set_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "last-album", _tmp4_);
	_g_free0 (_tmp4_);
}

static void
publishing_google_photos_publisher_real_on_login_flow_complete (PublishingRESTSupportGooglePublisher* base)
{
	PublishingGooglePhotosPublisher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHER, PublishingGooglePhotosPublisher);
	publishing_google_photos_publisher_do_publishing_process (self, NULL, NULL);
}

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

static void
publishing_google_photos_publisher_do_publishing_process (PublishingGooglePhotosPublisher* self,
                                                          GAsyncReadyCallback _callback_,
                                                          gpointer _user_data_)
{
	PublishingGooglePhotosPublisherDoPublishingProcessData* _data_;
	PublishingGooglePhotosPublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingGooglePhotosPublisherDoPublishingProcessData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_google_photos_publisher_do_publishing_process_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	publishing_google_photos_publisher_do_publishing_process_co (_data_);
}

static void
publishing_google_photos_publisher_do_publishing_process_finish (PublishingGooglePhotosPublisher* self,
                                                                 GAsyncResult* _res_)
{
	PublishingGooglePhotosPublisherDoPublishingProcessData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		PublishingGooglePhotosPublisher* self;
		self = _data1_->self;
		_data1_->albums = (_vala_array_free (_data1_->albums, _data1_->albums_length1, (GDestroyNotify) publishing_google_photos_album_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
publishing_google_photos_publisher_do_publishing_process_ready (GObject* source_object,
                                                                GAsyncResult* _res_,
                                                                gpointer _user_data_)
{
	PublishingGooglePhotosPublisherDoPublishingProcessData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_google_photos_publisher_do_publishing_process_co (_data_);
}

static gpointer
_json_object_ref0 (gpointer self)
{
	return self ? json_object_ref (self) : NULL;
}

static gpointer
_json_array_ref0 (gpointer self)
{
	return self ? json_array_ref (self) : NULL;
}

static JsonNode*
_vala_JsonNode_copy (JsonNode* self)
{
	return g_boxed_copy (json_node_get_type (), self);
}

static gpointer
__vala_JsonNode_copy0 (gpointer self)
{
	return self ? _vala_JsonNode_copy (self) : NULL;
}

static void
_vala_array_add35 (PublishingGooglePhotosAlbum** * array,
                   gint* length,
                   gint* size,
                   PublishingGooglePhotosAlbum* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (PublishingGooglePhotosAlbum*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_____lambda4_ (Block1Data* _data1_,
               JsonArray* a,
               guint b,
               JsonNode* element)
{
	PublishingGooglePhotosPublisher* self;
	JsonObject* album = NULL;
	JsonObject* _tmp0_;
	JsonObject* _tmp1_;
	JsonNode* title = NULL;
	JsonObject* _tmp2_;
	JsonNode* _tmp3_;
	JsonNode* _tmp4_;
	JsonNode* is_writable = NULL;
	JsonObject* _tmp5_;
	JsonNode* _tmp6_;
	JsonNode* _tmp7_;
	gboolean _tmp8_ = FALSE;
	gboolean _tmp9_ = FALSE;
	JsonNode* _tmp10_;
	self = _data1_->self;
	g_return_if_fail (a != NULL);
	g_return_if_fail (element != NULL);
	_tmp0_ = json_node_get_object (element);
	_tmp1_ = _json_object_ref0 (_tmp0_);
	album = _tmp1_;
	_tmp2_ = album;
	_tmp3_ = json_object_get_member (_tmp2_, "title");
	_tmp4_ = __vala_JsonNode_copy0 (_tmp3_);
	title = _tmp4_;
	_tmp5_ = album;
	_tmp6_ = json_object_get_member (_tmp5_, "isWriteable");
	_tmp7_ = __vala_JsonNode_copy0 (_tmp6_);
	is_writable = _tmp7_;
	_tmp10_ = title;
	if (_tmp10_ != NULL) {
		JsonNode* _tmp11_;
		_tmp11_ = is_writable;
		_tmp9_ = _tmp11_ != NULL;
	} else {
		_tmp9_ = FALSE;
	}
	if (_tmp9_) {
		JsonNode* _tmp12_;
		_tmp12_ = is_writable;
		_tmp8_ = json_node_get_boolean (_tmp12_);
	} else {
		_tmp8_ = FALSE;
	}
	if (_tmp8_) {
		JsonNode* _tmp13_;
		const gchar* _tmp14_;
		JsonObject* _tmp15_;
		const gchar* _tmp16_;
		PublishingGooglePhotosAlbum* _tmp17_;
		_tmp13_ = title;
		_tmp14_ = json_node_get_string (_tmp13_);
		_tmp15_ = album;
		_tmp16_ = json_object_get_string_member (_tmp15_, "id");
		_tmp17_ = publishing_google_photos_album_new (_tmp14_, _tmp16_);
		_vala_array_add35 (&_data1_->albums, &_data1_->albums_length1, &_data1_->_albums_size_, _tmp17_);
	}
	__vala_JsonNode_free0 (is_writable);
	__vala_JsonNode_free0 (title);
	_json_object_unref0 (album);
}

static void
______lambda4__json_array_foreach (JsonArray* array,
                                   guint index_,
                                   JsonNode* element_node,
                                   gpointer self)
{
	_____lambda4_ (self, array, index_, element_node);
}

static gboolean
publishing_google_photos_publisher_do_publishing_process_co (PublishingGooglePhotosPublisherDoPublishingProcessData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data1_ = g_slice_new0 (Block1Data);
	_data_->_data1_->_ref_count_ = 1;
	_data_->_data1_->self = g_object_ref (_data_->self);
	_data_->_data1_->_async_data_ = _data_;
	g_debug ("PhotosPublisher.vala:234: EVENT: OAuth login flow complete.");
	_data_->_tmp0_ = _data_->self->priv->publishing_parameters;
	_data_->_tmp1_ = _data_->self->priv->authenticator;
	_data_->_tmp2_ = spit_publishing_authenticator_get_authentication_parameter (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = g_hash_table_lookup (_data_->_tmp3_, "UserName");
	_data_->_tmp5_ = g_variant_get_string ((GVariant*) _data_->_tmp4_, NULL);
	publishing_google_photos_publishing_parameters_set_user_name (_data_->_tmp0_, _data_->_tmp5_);
	_g_hash_table_unref0 (_data_->_tmp3_);
	_data_->_tmp6_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_install_account_fetch_wait_pane (_data_->_tmp6_);
	_data_->_tmp7_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp7_, TRUE);
	_data_->_tmp8_ = g_new0 (PublishingGooglePhotosAlbum*, 0 + 1);
	_data_->_data1_->albums = _data_->_tmp8_;
	_data_->_data1_->albums_length1 = 0;
	_data_->_data1_->_albums_size_ = _data_->_data1_->albums_length1;
	_data_->_tmp9_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_data_->_tmp10_ = _data_->_tmp9_;
	_data_->_tmp11_ = publishing_google_photos_album_directory_transaction_new (_data_->_tmp10_, NULL);
	_data_->_tmp12_ = _data_->_tmp11_;
	_publishing_rest_support_session_unref0 (_data_->_tmp10_);
	_data_->txn = _data_->_tmp12_;
	{
		_data_->pagination_token = NULL;
		{
			_data_->_tmp13_ = TRUE;
			while (TRUE) {
				if (!_data_->_tmp13_) {
					_data_->_tmp14_ = _data_->pagination_token;
					if (!(_data_->_tmp14_ != NULL)) {
						break;
					}
				}
				_data_->_tmp13_ = FALSE;
				_data_->_tmp15_ = _data_->txn;
				_data_->_state_ = 1;
				publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp15_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_google_photos_publisher_do_publishing_process_ready, _data_);
				return FALSE;
				_state_1:
				publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp15_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_free0 (_data_->pagination_token);
					goto __catch0_g_error;
				}
				if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
					_g_free0 (_data_->pagination_token);
					_publishing_rest_support_transaction_unref0 (_data_->txn);
					block1_data_unref (_data_->_data1_);
					_data_->_data1_ = 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;
				}
				_data_->_tmp16_ = _data_->txn;
				_data_->_tmp17_ = publishing_rest_support_transaction_get_response (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
				_data_->_tmp18_ = _data_->_tmp17_;
				_data_->_tmp19_ = json_from_string (_data_->_tmp18_, &_data_->_inner_error0_);
				_data_->_tmp20_ = _data_->_tmp19_;
				_g_free0 (_data_->_tmp18_);
				_data_->json = _data_->_tmp20_;
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					_g_free0 (_data_->pagination_token);
					goto __catch0_g_error;
				}
				_data_->_tmp21_ = _data_->json;
				_data_->_tmp22_ = json_node_get_object (_data_->_tmp21_);
				_data_->_tmp23_ = _json_object_ref0 (_data_->_tmp22_);
				_data_->object = _data_->_tmp23_;
				_data_->_tmp24_ = _data_->object;
				if (json_object_get_size (_data_->_tmp24_) == ((guint) 0)) {
					_json_object_unref0 (_data_->object);
					__vala_JsonNode_free0 (_data_->json);
					break;
				}
				_data_->_tmp25_ = _data_->object;
				if (!json_object_has_member (_data_->_tmp25_, "albums")) {
					_data_->_tmp26_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE, "Album fetch did not contain expected data");
					_data_->_inner_error0_ = _data_->_tmp26_;
					_json_object_unref0 (_data_->object);
					__vala_JsonNode_free0 (_data_->json);
					_g_free0 (_data_->pagination_token);
					goto __catch0_g_error;
				}
				_data_->_tmp27_ = _data_->object;
				if (json_object_has_member (_data_->_tmp27_, "nextPageToken")) {
					_data_->_tmp28_ = _data_->object;
					_data_->_tmp29_ = json_object_get_member (_data_->_tmp28_, "nextPageToken");
					_data_->_tmp30_ = json_node_get_string (_data_->_tmp29_);
					_data_->_tmp31_ = g_strdup (_data_->_tmp30_);
					_g_free0 (_data_->pagination_token);
					_data_->pagination_token = _data_->_tmp31_;
				} else {
					_g_free0 (_data_->pagination_token);
					_data_->pagination_token = NULL;
				}
				_data_->_tmp32_ = _data_->object;
				_data_->_tmp33_ = json_object_get_member (_data_->_tmp32_, "albums");
				_data_->_tmp34_ = json_node_get_array (_data_->_tmp33_);
				_data_->_tmp35_ = _json_array_ref0 (_data_->_tmp34_);
				_data_->response_albums = _data_->_tmp35_;
				_data_->_tmp36_ = _data_->response_albums;
				json_array_foreach_element (_data_->_tmp36_, ______lambda4__json_array_foreach, _data_->_data1_);
				_data_->_tmp37_ = _data_->pagination_token;
				if (_data_->_tmp37_ != NULL) {
					_data_->_tmp38_ = _data_->pagination_token;
					g_debug ("PhotosPublisher.vala:279: Not finished fetching all albums, getting mo" \
"re... %s", _data_->_tmp38_);
					_data_->_tmp39_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
					_data_->_tmp40_ = _data_->_tmp39_;
					_data_->_tmp41_ = _data_->pagination_token;
					_data_->_tmp42_ = publishing_google_photos_album_directory_transaction_new (_data_->_tmp40_, _data_->_tmp41_);
					_publishing_rest_support_transaction_unref0 (_data_->txn);
					_data_->txn = _data_->_tmp42_;
					_publishing_rest_support_session_unref0 (_data_->_tmp40_);
				}
				_json_array_unref0 (_data_->response_albums);
				_json_object_unref0 (_data_->object);
				__vala_JsonNode_free0 (_data_->json);
			}
		}
		g_debug ("PhotosPublisher.vala:284: EVENT: finished fetching album information.");
		_data_->_tmp43_ = _data_->self->priv->publishing_parameters;
		_data_->_tmp44_ = _data_->_data1_->albums;
		_data_->_tmp44__length1 = _data_->_data1_->albums_length1;
		publishing_google_photos_publishing_parameters_set_albums (_data_->_tmp43_, _data_->_tmp44_, (gint) _data_->_tmp44__length1);
		publishing_google_photos_publisher_show_publishing_options_pane (_data_->self);
		_g_free0 (_data_->pagination_token);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp45_ = _data_->txn;
		_data_->_tmp46_ = publishing_rest_support_transaction_get_response (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp45_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
		_data_->_tmp47_ = _data_->_tmp46_;
		g_debug ("PhotosPublisher.vala:289: EVENT: fetching album information failed; re" \
"sponse = '%s'.", _data_->_tmp47_);
		_g_free0 (_data_->_tmp47_);
		_data_->_tmp48_ = _data_->txn;
		if (publishing_rest_support_transaction_get_status_code (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp48_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction)) == ((guint) 403)) {
			g_debug ("PhotosPublisher.vala:293: Lacking permission to download album list, s" \
"howing publishing options anyway");
			publishing_google_photos_publisher_show_publishing_options_pane (_data_->self);
		} else {
			_data_->_tmp49_ = _data_->txn;
			if (publishing_rest_support_transaction_get_status_code (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp49_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction)) == ((guint) 404)) {
				publishing_rest_support_google_publisher_do_logout (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
			} else {
				_data_->_tmp50_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
				_data_->_tmp51_ = _data_->err;
				spit_publishing_plugin_host_post_error (_data_->_tmp50_, _data_->_tmp51_);
			}
		}
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_transaction_unref0 (_data_->txn);
		block1_data_unref (_data_->_data1_);
		_data_->_data1_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_publishing_rest_support_transaction_unref0 (_data_->txn);
	block1_data_unref (_data_->_data1_);
	_data_->_data1_ = 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 void
_publishing_google_photos_publisher_on_publishing_options_publish_publishing_google_photos_publishing_options_pane_publish (PublishingGooglePhotosPublishingOptionsPane* _sender,
                                                                                                                            gpointer self)
{
	publishing_google_photos_publisher_on_publishing_options_publish ((PublishingGooglePhotosPublisher*) self);
}

static void
_publishing_google_photos_publisher_on_publishing_options_logout_publishing_google_photos_publishing_options_pane_logout (PublishingGooglePhotosPublishingOptionsPane* _sender,
                                                                                                                          gpointer self)
{
	publishing_google_photos_publisher_on_publishing_options_logout ((PublishingGooglePhotosPublisher*) self);
}

static void
publishing_google_photos_publisher_show_publishing_options_pane (PublishingGooglePhotosPublisher* self)
{
	PublishingGooglePhotosPublishingOptionsPane* opts_pane = NULL;
	PublishingGooglePhotosPublishingParameters* _tmp0_;
	SpitPublishingAuthenticator* _tmp1_;
	PublishingGooglePhotosPublishingOptionsPane* _tmp2_;
	SpitPublishingPluginHost* _tmp3_;
	SpitPublishingPluginHost* _tmp4_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	g_debug ("PhotosPublisher.vala:305: ACTION: showing publishing options pane.");
	_tmp0_ = self->priv->publishing_parameters;
	_tmp1_ = self->priv->authenticator;
	_tmp2_ = publishing_google_photos_publishing_options_pane_new (_tmp0_, spit_publishing_authenticator_can_logout (_tmp1_));
	g_object_ref_sink (_tmp2_);
	opts_pane = _tmp2_;
	g_signal_connect_object (opts_pane, "publish", (GCallback) _publishing_google_photos_publisher_on_publishing_options_publish_publishing_google_photos_publishing_options_pane_publish, self, 0);
	g_signal_connect_object (opts_pane, "logout", (GCallback) _publishing_google_photos_publisher_on_publishing_options_logout_publishing_google_photos_publishing_options_pane_logout, self, 0);
	_tmp3_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_install_dialog_pane (_tmp3_, G_TYPE_CHECK_INSTANCE_CAST (opts_pane, SPIT_PUBLISHING_TYPE_DIALOG_PANE, SpitPublishingDialogPane), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL);
	_tmp4_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_set_service_locked (_tmp4_, FALSE);
	_g_object_unref0 (opts_pane);
}

static void
publishing_google_photos_publisher_on_publishing_options_logout (PublishingGooglePhotosPublisher* self)
{
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		return;
	}
	g_debug ("PhotosPublisher.vala:319: EVENT: user clicked 'Logout' in the publishi" \
"ng options pane.");
	publishing_rest_support_google_publisher_do_logout (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
}

static void
publishing_google_photos_publisher_on_publishing_options_publish (PublishingGooglePhotosPublisher* self)
{
	PublishingGooglePhotosPublishingParameters* _tmp0_;
	PublishingGooglePhotosPublishingParameters* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		return;
	}
	g_debug ("PhotosPublisher.vala:328: EVENT: user clicked 'Publish' in the publish" \
"ing options pane.");
	_tmp0_ = self->priv->publishing_parameters;
	publishing_google_photos_publisher_save_parameters_to_configuration_system (self, _tmp0_);
	_tmp1_ = self->priv->publishing_parameters;
	_tmp2_ = publishing_google_photos_publishing_parameters_get_target_album_entry_id (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = _tmp3_ != NULL;
	_g_free0 (_tmp3_);
	if (_tmp4_) {
		publishing_google_photos_publisher_do_upload (self, NULL, NULL);
	} else {
		publishing_google_photos_publisher_do_create_album (self, NULL, NULL);
	}
}

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

static void
publishing_google_photos_publisher_do_create_album (PublishingGooglePhotosPublisher* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	PublishingGooglePhotosPublisherDoCreateAlbumData* _data_;
	PublishingGooglePhotosPublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingGooglePhotosPublisherDoCreateAlbumData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_google_photos_publisher_do_create_album_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	publishing_google_photos_publisher_do_create_album_co (_data_);
}

static void
publishing_google_photos_publisher_do_create_album_finish (PublishingGooglePhotosPublisher* self,
                                                           GAsyncResult* _res_)
{
	PublishingGooglePhotosPublisherDoCreateAlbumData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
publishing_google_photos_publisher_do_create_album_ready (GObject* source_object,
                                                          GAsyncResult* _res_,
                                                          gpointer _user_data_)
{
	PublishingGooglePhotosPublisherDoCreateAlbumData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_google_photos_publisher_do_create_album_co (_data_);
}

static gboolean
publishing_google_photos_publisher_do_create_album_co (PublishingGooglePhotosPublisherDoCreateAlbumData* _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:
	g_debug ("PhotosPublisher.vala:340: ACTION: Creating album");
	_data_->_tmp0_ = _data_->self->priv->publishing_parameters;
	_data_->_tmp1_ = publishing_google_photos_publishing_parameters_get_target_album_entry_id (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_vala_assert (_data_->_tmp2_ == NULL, "publishing_parameters.get_target_album_entry_id () == null");
	_g_free0 (_data_->_tmp2_);
	_data_->_tmp3_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp3_, TRUE);
	_data_->_tmp4_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->self->priv->publishing_parameters;
	_data_->_tmp7_ = publishing_google_photos_publishing_parameters_get_target_album_name (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = publishing_google_photos_album_creation_transaction_new (_data_->_tmp5_, _data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_g_free0 (_data_->_tmp8_);
	_publishing_rest_support_session_unref0 (_data_->_tmp5_);
	_data_->txn = _data_->_tmp10_;
	{
		_data_->_tmp11_ = _data_->txn;
		_data_->_state_ = 1;
		publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_google_photos_publisher_do_create_album_ready, _data_);
		return FALSE;
		_state_1:
		publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp11_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
			_publishing_rest_support_transaction_unref0 (_data_->txn);
			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_ = _data_->txn;
		_data_->_tmp13_ = publishing_rest_support_transaction_get_response (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp12_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
		_data_->_tmp14_ = _data_->_tmp13_;
		g_debug ("PhotosPublisher.vala:353: EVENT: finished creating album information: " \
"%s", _data_->_tmp14_);
		_g_free0 (_data_->_tmp14_);
		_data_->_tmp15_ = _data_->txn;
		_data_->_tmp16_ = publishing_rest_support_transaction_get_response (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp15_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
		_data_->_tmp17_ = _data_->_tmp16_;
		_data_->_tmp18_ = json_from_string (_data_->_tmp17_, &_data_->_inner_error0_);
		_data_->_tmp19_ = _data_->_tmp18_;
		_g_free0 (_data_->_tmp17_);
		_data_->node = _data_->_tmp19_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp20_ = _data_->node;
		_data_->_tmp21_ = json_node_get_object (_data_->_tmp20_);
		_data_->_tmp22_ = _json_object_ref0 (_data_->_tmp21_);
		_data_->object = _data_->_tmp22_;
		_data_->_tmp23_ = _data_->self->priv->publishing_parameters;
		_data_->_tmp24_ = _data_->object;
		_data_->_tmp25_ = json_object_get_string_member (_data_->_tmp24_, "id");
		publishing_google_photos_publishing_parameters_set_target_album_entry_id (_data_->_tmp23_, _data_->_tmp25_);
		_data_->_state_ = 2;
		publishing_google_photos_publisher_do_upload (_data_->self, publishing_google_photos_publisher_do_create_album_ready, _data_);
		return FALSE;
		_state_2:
		publishing_google_photos_publisher_do_upload_finish (_data_->self, _data_->_res_);
		_json_object_unref0 (_data_->object);
		__vala_JsonNode_free0 (_data_->node);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp26_ = _data_->txn;
		_data_->_tmp27_ = _data_->txn;
		_data_->_tmp28_ = publishing_rest_support_transaction_get_response (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp27_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction));
		_data_->_tmp29_ = _data_->_tmp28_;
		g_debug ("PhotosPublisher.vala:361: EVENT: creating album failed; status = '%u'," \
" response = '%s'.", publishing_rest_support_transaction_get_status_code (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp26_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction)), _data_->_tmp29_);
		_g_free0 (_data_->_tmp29_);
		_data_->_tmp30_ = _data_->txn;
		if (publishing_rest_support_transaction_get_status_code (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp30_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction)) == ((guint) 403)) {
			_data_->_tmp31_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
			spit_publishing_plugin_host_install_static_message_pane (_data_->_tmp31_, _ ("Could not create album, Shotwell is lacking permission to do so. Pleas" \
"e re-authenticate and grant Shotwell the required permission to create" \
" new media and albums"), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CLOSE);
		} else {
			_data_->_tmp32_ = _data_->txn;
			if (publishing_rest_support_transaction_get_status_code (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp32_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction)) == ((guint) 404)) {
				publishing_rest_support_google_publisher_do_logout (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
			} else {
				_data_->_tmp33_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
				_data_->_tmp34_ = _data_->err;
				spit_publishing_plugin_host_post_error (_data_->_tmp33_, _data_->_tmp34_);
			}
		}
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_transaction_unref0 (_data_->txn);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_publishing_rest_support_transaction_unref0 (_data_->txn);
	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
publishing_google_photos_publisher_real_do_logout (PublishingRESTSupportGooglePublisher* base)
{
	PublishingGooglePhotosPublisher * self;
	PublishingRESTSupportGoogleSession* _tmp0_;
	PublishingRESTSupportGoogleSession* _tmp1_;
	SpitPublishingAuthenticator* _tmp2_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHER, PublishingGooglePhotosPublisher);
	g_debug ("PhotosPublisher.vala:377: ACTION: logging out user.");
	_tmp0_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_tmp1_ = _tmp0_;
	publishing_rest_support_google_session_deauthenticate (_tmp1_);
	_publishing_rest_support_session_unref0 (_tmp1_);
	_tmp2_ = self->priv->authenticator;
	if (spit_publishing_authenticator_can_logout (_tmp2_)) {
		SpitPublishingAuthenticator* _tmp3_;
		SpitPublishingAuthenticator* _tmp4_;
		_tmp3_ = self->priv->authenticator;
		spit_publishing_authenticator_logout (_tmp3_);
		_tmp4_ = self->priv->authenticator;
		spit_publishing_authenticator_authenticate (_tmp4_);
	}
}

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

static void
publishing_google_photos_publisher_do_upload (PublishingGooglePhotosPublisher* self,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	PublishingGooglePhotosPublisherDoUploadData* _data_;
	PublishingGooglePhotosPublisher* _tmp0_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	_data_ = g_slice_new0 (PublishingGooglePhotosPublisherDoUploadData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_google_photos_publisher_do_upload_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	publishing_google_photos_publisher_do_upload_co (_data_);
}

static void
publishing_google_photos_publisher_do_upload_finish (PublishingGooglePhotosPublisher* self,
                                                     GAsyncResult* _res_)
{
	PublishingGooglePhotosPublisherDoUploadData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
_publishing_google_photos_publisher_on_upload_status_updated_spit_publishing_progress_callback (gint file_number,
                                                                                                gdouble fraction_complete,
                                                                                                gpointer self)
{
	publishing_google_photos_publisher_on_upload_status_updated ((PublishingGooglePhotosPublisher*) self, file_number, fraction_complete);
}

static void
publishing_google_photos_publisher_do_upload_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	PublishingGooglePhotosPublisherDoUploadData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_google_photos_publisher_do_upload_co (_data_);
}

static gboolean
publishing_google_photos_publisher_do_upload_co (PublishingGooglePhotosPublisherDoUploadData* _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:
	g_debug ("PhotosPublisher.vala:387: ACTION: uploading media items to remote serv" \
"er.");
	_data_->_tmp0_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	spit_publishing_plugin_host_set_service_locked (_data_->_tmp0_, TRUE);
	_data_->_tmp1_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_data_->_tmp2_ = _data_->self->priv->publishing_parameters;
	_data_->_tmp3_ = _data_->self->priv->publishing_parameters;
	_data_->_tmp4_ = NULL;
	_data_->_tmp5_ = NULL;
	_data_->_tmp6_ = spit_publishing_plugin_host_serialize_publishables (_data_->_tmp1_, publishing_google_photos_publishing_parameters_get_major_axis_size_pixels (_data_->_tmp2_), publishing_google_photos_publishing_parameters_get_strip_metadata (_data_->_tmp3_), &_data_->_tmp4_, &_data_->_tmp5_);
	(_data_->self->priv->progress_reporter_target_destroy_notify == NULL) ? NULL : (_data_->self->priv->progress_reporter_target_destroy_notify (_data_->self->priv->progress_reporter_target), NULL);
	_data_->self->priv->progress_reporter = NULL;
	_data_->self->priv->progress_reporter_target = NULL;
	_data_->self->priv->progress_reporter_target_destroy_notify = NULL;
	_data_->self->priv->progress_reporter = _data_->_tmp6_;
	_data_->self->priv->progress_reporter_target = _data_->_tmp4_;
	_data_->self->priv->progress_reporter_target_destroy_notify = _data_->_tmp5_;
	if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		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_->_tmp7_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_data_->_tmp8_ = 0;
	_data_->_tmp9_ = spit_publishing_plugin_host_get_publishables (_data_->_tmp7_, &_data_->_tmp8_);
	_data_->publishables = _data_->_tmp9_;
	_data_->publishables_length1 = _data_->_tmp8_;
	_data_->_publishables_size_ = _data_->publishables_length1;
	_data_->_tmp10_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_data_->_tmp11_ = _data_->_tmp10_;
	_data_->_tmp12_ = _data_->publishables;
	_data_->_tmp12__length1 = _data_->publishables_length1;
	_data_->_tmp13_ = _data_->self->priv->publishing_parameters;
	_data_->_tmp14_ = publishing_google_photos_uploader_new (_data_->_tmp11_, _data_->_tmp12_, _data_->_tmp12__length1, _data_->_tmp13_);
	_data_->_tmp15_ = _data_->_tmp14_;
	_publishing_rest_support_session_unref0 (_data_->_tmp11_);
	_data_->uploader = _data_->_tmp15_;
	{
		_data_->_tmp16_ = _data_->uploader;
		_data_->_state_ = 1;
		publishing_rest_support_batch_uploader_upload_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader), _publishing_google_photos_publisher_on_upload_status_updated_spit_publishing_progress_callback, _data_->self, publishing_google_photos_publisher_do_upload_ready, _data_);
		return FALSE;
		_state_1:
		publishing_rest_support_batch_uploader_upload_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp16_, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader), _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp17_ = _data_->uploader;
		_data_->_state_ = 2;
		publishing_google_photos_publisher_do_media_creation_batch (_data_->self, G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp17_, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER, PublishingRESTSupportBatchUploader), publishing_google_photos_publisher_do_upload_ready, _data_);
		return FALSE;
		_state_2:
		publishing_google_photos_publisher_do_media_creation_batch_finish (_data_->self, _data_->_res_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->err = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
			_g_error_free0 (_data_->err);
			_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
			_data_->publishables = (_vala_array_free (_data_->publishables, _data_->publishables_length1, (GDestroyNotify) g_object_unref), 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;
		}
		_data_->_tmp18_ = _data_->err;
		_data_->_tmp19_ = _data_->_tmp18_->message;
		g_debug ("PhotosPublisher.vala:412: EVENT: uploader reports upload error = '%s'.", _data_->_tmp19_);
		_data_->_tmp20_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
		_data_->_tmp21_ = _data_->err;
		spit_publishing_plugin_host_post_error (_data_->_tmp20_, _data_->_tmp21_);
		_g_error_free0 (_data_->err);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
		_data_->publishables = (_vala_array_free (_data_->publishables, _data_->publishables_length1, (GDestroyNotify) g_object_unref), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
	_data_->publishables = (_vala_array_free (_data_->publishables, _data_->publishables_length1, (GDestroyNotify) g_object_unref), 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 void
publishing_google_photos_publisher_on_upload_status_updated (PublishingGooglePhotosPublisher* self,
                                                             gint file_number,
                                                             gdouble completed_fraction)
{
	SpitPublishingProgressCallback _tmp0_;
	gpointer _tmp0__target;
	SpitPublishingProgressCallback _tmp1_;
	gpointer _tmp1__target;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		return;
	}
	g_debug ("PhotosPublisher.vala:422: EVENT: uploader reports upload %.2f percent " \
"complete.", 100.0 * completed_fraction);
	_tmp0_ = self->priv->progress_reporter;
	_tmp0__target = self->priv->progress_reporter_target;
	_vala_assert (_tmp0_ != NULL, "progress_reporter != null");
	_tmp1_ = self->priv->progress_reporter;
	_tmp1__target = self->priv->progress_reporter_target;
	_tmp1_ (file_number, completed_fraction, _tmp1__target);
}

static void
publishing_google_photos_publisher_do_media_creation_batch_data_free (gpointer _data)
{
	PublishingGooglePhotosPublisherDoMediaCreationBatchData* _data_;
	_data_ = _data;
	_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
	_g_object_unref0 (_data_->self);
	g_slice_free (PublishingGooglePhotosPublisherDoMediaCreationBatchData, _data_);
}

static gpointer
_publishing_rest_support_batch_uploader_ref0 (gpointer self)
{
	return self ? publishing_rest_support_batch_uploader_ref (self) : NULL;
}

static void
publishing_google_photos_publisher_do_media_creation_batch (PublishingGooglePhotosPublisher* self,
                                                            PublishingRESTSupportBatchUploader* uploader,
                                                            GAsyncReadyCallback _callback_,
                                                            gpointer _user_data_)
{
	PublishingGooglePhotosPublisherDoMediaCreationBatchData* _data_;
	PublishingGooglePhotosPublisher* _tmp0_;
	PublishingRESTSupportBatchUploader* _tmp1_;
	g_return_if_fail (PUBLISHING_GOOGLE_PHOTOS_IS_PUBLISHER (self));
	g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (uploader, PUBLISHING_REST_SUPPORT_TYPE_BATCH_UPLOADER));
	_data_ = g_slice_new0 (PublishingGooglePhotosPublisherDoMediaCreationBatchData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, publishing_google_photos_publisher_do_media_creation_batch_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _publishing_rest_support_batch_uploader_ref0 (uploader);
	_publishing_rest_support_batch_uploader_unref0 (_data_->uploader);
	_data_->uploader = _tmp1_;
	publishing_google_photos_publisher_do_media_creation_batch_co (_data_);
}

static void
publishing_google_photos_publisher_do_media_creation_batch_finish (PublishingGooglePhotosPublisher* self,
                                                                   GAsyncResult* _res_)
{
	PublishingGooglePhotosPublisherDoMediaCreationBatchData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
publishing_google_photos_publisher_do_media_creation_batch_ready (GObject* source_object,
                                                                  GAsyncResult* _res_,
                                                                  gpointer _user_data_)
{
	PublishingGooglePhotosPublisherDoMediaCreationBatchData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	publishing_google_photos_publisher_do_media_creation_batch_co (_data_);
}

static gboolean
publishing_google_photos_publisher_do_media_creation_batch_co (PublishingGooglePhotosPublisherDoMediaCreationBatchData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _publishing_rest_support_batch_uploader_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_data_->uploader, PUBLISHING_GOOGLE_PHOTOS_TYPE_UPLOADER, PublishingGooglePhotosUploader));
	_data_->u = _data_->_tmp0_;
	while (TRUE) {
		_data_->_tmp1_ = _data_->u;
		_data_->_tmp2_ = _data_->_tmp1_->upload_tokens;
		_data_->_tmp2__length1 = _data_->_tmp1_->upload_tokens_length1;
		if (!(_data_->self->priv->creation_offset < ((gsize) _data_->_tmp2__length1))) {
			break;
		}
		_data_->_tmp4_ = _data_->u;
		_data_->_tmp5_ = _data_->_tmp4_->upload_tokens;
		_data_->_tmp5__length1 = _data_->_tmp4_->upload_tokens_length1;
		if ((_data_->self->priv->creation_offset + PUBLISHING_GOOGLE_PHOTOS_MAX_BATCH_SIZE) < ((gsize) _data_->_tmp5__length1)) {
			_data_->_tmp3_ = _data_->self->priv->creation_offset + PUBLISHING_GOOGLE_PHOTOS_MAX_BATCH_SIZE;
		} else {
			_data_->_tmp6_ = _data_->u;
			_data_->_tmp7_ = _data_->_tmp6_->upload_tokens;
			_data_->_tmp7__length1 = _data_->_tmp6_->upload_tokens_length1;
			_data_->_tmp3_ = (gsize) _data_->_tmp7__length1;
		}
		_data_->end = _data_->_tmp3_;
		_data_->_tmp8_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = _data_->u;
		_data_->_tmp11_ = _data_->_tmp10_->upload_tokens;
		_data_->_tmp11__length1 = _data_->_tmp10_->upload_tokens_length1;
		_data_->_tmp12_ = _data_->u;
		_data_->_tmp13_ = _data_->_tmp12_->titles;
		_data_->_tmp13__length1 = _data_->_tmp12_->titles_length1;
		_data_->_tmp14_ = _data_->self->priv->publishing_parameters;
		_data_->_tmp15_ = publishing_google_photos_publishing_parameters_get_target_album_entry_id (_data_->_tmp14_);
		_data_->_tmp16_ = _data_->_tmp15_;
		_data_->_tmp17_ = publishing_google_photos_media_creation_transaction_new (_data_->_tmp9_, _data_->_tmp11_ + ((gint) _data_->self->priv->creation_offset), ((gint) _data_->end) - ((gint) _data_->self->priv->creation_offset), _data_->_tmp13_ + ((gint) _data_->self->priv->creation_offset), ((gint) _data_->end) - ((gint) _data_->self->priv->creation_offset), _data_->_tmp16_);
		_data_->_tmp18_ = _data_->_tmp17_;
		_g_free0 (_data_->_tmp16_);
		_publishing_rest_support_session_unref0 (_data_->_tmp9_);
		_data_->txn = _data_->_tmp18_;
		_data_->self->priv->creation_offset = _data_->end;
		{
			_data_->_tmp19_ = _data_->txn;
			_data_->_state_ = 1;
			publishing_rest_support_transaction_execute_async (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp19_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), publishing_google_photos_publisher_do_media_creation_batch_ready, _data_);
			return FALSE;
			_state_1:
			publishing_rest_support_transaction_execute_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->_tmp19_, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				if (_data_->_inner_error0_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) {
					goto __catch0_spit_publishing_publishing_error;
				}
				_publishing_rest_support_transaction_unref0 (_data_->txn);
				_publishing_rest_support_batch_uploader_unref0 (_data_->u);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
				g_clear_error (&_data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
				_publishing_rest_support_transaction_unref0 (_data_->txn);
				_publishing_rest_support_batch_uploader_unref0 (_data_->u);
				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_debug ("PhotosPublisher.vala:447: EVENT: Media creation reports success.");
			_data_->_tmp20_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
			spit_publishing_plugin_host_set_service_locked (_data_->_tmp20_, FALSE);
			_data_->_tmp21_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
			spit_publishing_plugin_host_install_success_pane (_data_->_tmp21_);
		}
		goto __finally0;
		__catch0_spit_publishing_publishing_error:
		{
			_data_->err = _data_->_inner_error0_;
			_data_->_inner_error0_ = NULL;
			if (!publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
				_g_error_free0 (_data_->err);
				_publishing_rest_support_transaction_unref0 (_data_->txn);
				_publishing_rest_support_batch_uploader_unref0 (_data_->u);
				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_ = _data_->err;
			_data_->_tmp23_ = _data_->_tmp22_->message;
			g_debug ("PhotosPublisher.vala:455: EVENT: Media creation reports error: %s", _data_->_tmp23_);
			_data_->_tmp24_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
			_data_->_tmp25_ = _data_->err;
			spit_publishing_plugin_host_post_error (_data_->_tmp24_, _data_->_tmp25_);
			_g_error_free0 (_data_->err);
		}
		__finally0:
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_publishing_rest_support_transaction_unref0 (_data_->txn);
			_publishing_rest_support_batch_uploader_unref0 (_data_->u);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_publishing_rest_support_transaction_unref0 (_data_->txn);
	}
	_publishing_rest_support_batch_uploader_unref0 (_data_->u);
	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 gboolean
publishing_google_photos_publisher_real_is_running (PublishingRESTSupportGooglePublisher* base)
{
	PublishingGooglePhotosPublisher * self;
	gboolean result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHER, PublishingGooglePhotosPublisher);
	result = self->priv->running;
	return result;
}

static void
publishing_google_photos_publisher_real_start (PublishingRESTSupportGooglePublisher* base)
{
	PublishingGooglePhotosPublisher * self;
	SpitPublishingAuthenticator* _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHER, PublishingGooglePhotosPublisher);
	g_debug ("PhotosPublisher.vala:467: GooglePhotos.Publisher: start() invoked.");
	if (publishing_rest_support_google_publisher_is_running (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher))) {
		return;
	}
	self->priv->running = TRUE;
	_tmp0_ = self->priv->authenticator;
	spit_publishing_authenticator_authenticate (_tmp0_);
}

static void
publishing_google_photos_publisher_real_stop (PublishingRESTSupportGooglePublisher* base)
{
	PublishingGooglePhotosPublisher * self;
	PublishingRESTSupportGoogleSession* _tmp0_;
	PublishingRESTSupportGoogleSession* _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHER, PublishingGooglePhotosPublisher);
	g_debug ("PhotosPublisher.vala:478: GooglePhotos.Publisher: stop() invoked.");
	_tmp0_ = publishing_rest_support_google_publisher_get_session (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
	_tmp1_ = _tmp0_;
	publishing_rest_support_session_stop_transactions (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession));
	_publishing_rest_support_session_unref0 (_tmp1_);
	self->priv->running = FALSE;
}

static SpitPublishingAuthenticator*
publishing_google_photos_publisher_real_get_authenticator (PublishingRESTSupportGooglePublisher* base)
{
	PublishingGooglePhotosPublisher * self;
	SpitPublishingAuthenticator* _tmp0_;
	SpitPublishingAuthenticator* _tmp5_;
	SpitPublishingAuthenticator* _tmp6_;
	SpitPublishingAuthenticator* result;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHER, PublishingGooglePhotosPublisher);
	_tmp0_ = self->priv->authenticator;
	if (_tmp0_ == NULL) {
		PublishingAuthenticatorFactory* _tmp1_;
		PublishingAuthenticatorFactory* _tmp2_;
		SpitPublishingPluginHost* _tmp3_;
		SpitPublishingAuthenticator* _tmp4_;
		_tmp1_ = publishing_authenticator_factory_get_instance ();
		_tmp2_ = _tmp1_;
		_tmp3_ = publishing_rest_support_google_publisher_get_host (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, PublishingRESTSupportGooglePublisher));
		_tmp4_ = spit_publishing_authenticator_factory_create (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, SPIT_PUBLISHING_TYPE_AUTHENTICATOR_FACTORY, SpitPublishingAuthenticatorFactory), "google-photos", _tmp3_);
		_g_object_unref0 (self->priv->authenticator);
		self->priv->authenticator = _tmp4_;
		_g_object_unref0 (_tmp2_);
	}
	_tmp5_ = self->priv->authenticator;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	result = _tmp6_;
	return result;
}

static void
publishing_google_photos_publisher_class_init (PublishingGooglePhotosPublisherClass * klass,
                                               gpointer klass_data)
{
	publishing_google_photos_publisher_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &PublishingGooglePhotosPublisher_private_offset);
	((PublishingRESTSupportGooglePublisherClass *) klass)->on_login_flow_complete = (void (*) (PublishingRESTSupportGooglePublisher*)) publishing_google_photos_publisher_real_on_login_flow_complete;
	((PublishingRESTSupportGooglePublisherClass *) klass)->do_logout = (void (*) (PublishingRESTSupportGooglePublisher*)) publishing_google_photos_publisher_real_do_logout;
	((PublishingRESTSupportGooglePublisherClass *) klass)->is_running = (gboolean (*) (PublishingRESTSupportGooglePublisher*)) publishing_google_photos_publisher_real_is_running;
	((PublishingRESTSupportGooglePublisherClass *) klass)->start = (void (*) (PublishingRESTSupportGooglePublisher*)) publishing_google_photos_publisher_real_start;
	((PublishingRESTSupportGooglePublisherClass *) klass)->stop = (void (*) (PublishingRESTSupportGooglePublisher*)) publishing_google_photos_publisher_real_stop;
	((PublishingRESTSupportGooglePublisherClass *) klass)->get_authenticator = (SpitPublishingAuthenticator* (*) (PublishingRESTSupportGooglePublisher*)) publishing_google_photos_publisher_real_get_authenticator;
	G_OBJECT_CLASS (klass)->finalize = publishing_google_photos_publisher_finalize;
}

static void
publishing_google_photos_publisher_instance_init (PublishingGooglePhotosPublisher * self,
                                                  gpointer klass)
{
	self->priv = publishing_google_photos_publisher_get_instance_private (self);
	self->priv->running = FALSE;
	self->priv->creation_offset = (gsize) 0;
}

static void
publishing_google_photos_publisher_finalize (GObject * obj)
{
	PublishingGooglePhotosPublisher * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_GOOGLE_PHOTOS_TYPE_PUBLISHER, PublishingGooglePhotosPublisher);
	_g_object_unref0 (self->priv->authenticator);
	_publishing_google_photos_publishing_parameters_unref0 (self->priv->publishing_parameters);
	(self->priv->progress_reporter_target_destroy_notify == NULL) ? NULL : (self->priv->progress_reporter_target_destroy_notify (self->priv->progress_reporter_target), NULL);
	self->priv->progress_reporter = NULL;
	self->priv->progress_reporter_target = NULL;
	self->priv->progress_reporter_target_destroy_notify = NULL;
	G_OBJECT_CLASS (publishing_google_photos_publisher_parent_class)->finalize (obj);
}

static GType
publishing_google_photos_publisher_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PublishingGooglePhotosPublisherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_google_photos_publisher_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingGooglePhotosPublisher), 0, (GInstanceInitFunc) publishing_google_photos_publisher_instance_init, NULL };
	GType publishing_google_photos_publisher_type_id;
	publishing_google_photos_publisher_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_GOOGLE_PUBLISHER, "PublishingGooglePhotosPublisher", &g_define_type_info, 0);
	PublishingGooglePhotosPublisher_private_offset = g_type_add_instance_private (publishing_google_photos_publisher_type_id, sizeof (PublishingGooglePhotosPublisherPrivate));
	return publishing_google_photos_publisher_type_id;
}

GType
publishing_google_photos_publisher_get_type (void)
{
	static volatile gsize publishing_google_photos_publisher_type_id__once = 0;
	if (g_once_init_enter (&publishing_google_photos_publisher_type_id__once)) {
		GType publishing_google_photos_publisher_type_id;
		publishing_google_photos_publisher_type_id = publishing_google_photos_publisher_get_type_once ();
		g_once_init_leave (&publishing_google_photos_publisher_type_id__once, publishing_google_photos_publisher_type_id);
	}
	return publishing_google_photos_publisher_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);
}

