/*
 * Generated by gdbus-codegen 2.53.4. DO NOT EDIT.
 *
 * The license of this code is the same as for the source it was derived from.
 */

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

#include "org.freedesktop.realmd.h"

#include <string.h>
#ifdef G_OS_UNIX
#  include <gio/gunixfdlist.h>
#endif

typedef struct
{
  GDBusArgInfo parent_struct;
  gboolean use_gvariant;
} _ExtendedGDBusArgInfo;

typedef struct
{
  GDBusMethodInfo parent_struct;
  const gchar *signal_name;
  gboolean pass_fdlist;
} _ExtendedGDBusMethodInfo;

typedef struct
{
  GDBusSignalInfo parent_struct;
  const gchar *signal_name;
} _ExtendedGDBusSignalInfo;

typedef struct
{
  GDBusPropertyInfo parent_struct;
  const gchar *hyphen_name;
  gboolean use_gvariant;
} _ExtendedGDBusPropertyInfo;

typedef struct
{
  GDBusInterfaceInfo parent_struct;
  const gchar *hyphen_name;
} _ExtendedGDBusInterfaceInfo;

typedef struct
{
  const _ExtendedGDBusPropertyInfo *info;
  guint prop_id;
  GValue orig_value; /* the value before the change */
} ChangedProperty;

static void
_changed_property_free (ChangedProperty *data)
{
  g_value_unset (&data->orig_value);
  g_free (data);
}

static gboolean
_g_strv_equal0 (gchar **a, gchar **b)
{
  gboolean ret = FALSE;
  guint n;
  if (a == NULL && b == NULL)
    {
      ret = TRUE;
      goto out;
    }
  if (a == NULL || b == NULL)
    goto out;
  if (g_strv_length (a) != g_strv_length (b))
    goto out;
  for (n = 0; a[n] != NULL; n++)
    if (g_strcmp0 (a[n], b[n]) != 0)
      goto out;
  ret = TRUE;
out:
  return ret;
}

static gboolean
_g_variant_equal0 (GVariant *a, GVariant *b)
{
  gboolean ret = FALSE;
  if (a == NULL && b == NULL)
    {
      ret = TRUE;
      goto out;
    }
  if (a == NULL || b == NULL)
    goto out;
  ret = g_variant_equal (a, b);
out:
  return ret;
}

G_GNUC_UNUSED static gboolean
_g_value_equal (const GValue *a, const GValue *b)
{
  gboolean ret = FALSE;
  g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
  switch (G_VALUE_TYPE (a))
    {
      case G_TYPE_BOOLEAN:
        ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
        break;
      case G_TYPE_UCHAR:
        ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
        break;
      case G_TYPE_INT:
        ret = (g_value_get_int (a) == g_value_get_int (b));
        break;
      case G_TYPE_UINT:
        ret = (g_value_get_uint (a) == g_value_get_uint (b));
        break;
      case G_TYPE_INT64:
        ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
        break;
      case G_TYPE_UINT64:
        ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
        break;
      case G_TYPE_DOUBLE:
        {
          /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
          gdouble da = g_value_get_double (a);
          gdouble db = g_value_get_double (b);
          ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
        }
        break;
      case G_TYPE_STRING:
        ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
        break;
      case G_TYPE_VARIANT:
        ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
        break;
      default:
        if (G_VALUE_TYPE (a) == G_TYPE_STRV)
          ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
        else
          g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
        break;
    }
  return ret;
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.realmd.Provider
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GoaRealmProvider
 * @title: GoaRealmProvider
 * @short_description: Generated C code for the org.freedesktop.realmd.Provider D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.realmd.Provider ---- */

static const _ExtendedGDBusArgInfo _goa_realm_provider_method_info_discover_IN_ARG_string =
{
  {
    -1,
    (gchar *) "string",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_provider_method_info_discover_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_provider_method_info_discover_IN_ARG_pointers[] =
{
  &_goa_realm_provider_method_info_discover_IN_ARG_string,
  &_goa_realm_provider_method_info_discover_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusArgInfo _goa_realm_provider_method_info_discover_OUT_ARG_relevance =
{
  {
    -1,
    (gchar *) "relevance",
    (gchar *) "i",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_provider_method_info_discover_OUT_ARG_realm =
{
  {
    -1,
    (gchar *) "realm",
    (gchar *) "ao",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_provider_method_info_discover_OUT_ARG_pointers[] =
{
  &_goa_realm_provider_method_info_discover_OUT_ARG_relevance,
  &_goa_realm_provider_method_info_discover_OUT_ARG_realm,
  NULL
};

static const _ExtendedGDBusMethodInfo _goa_realm_provider_method_info_discover =
{
  {
    -1,
    (gchar *) "Discover",
    (GDBusArgInfo **) &_goa_realm_provider_method_info_discover_IN_ARG_pointers,
    (GDBusArgInfo **) &_goa_realm_provider_method_info_discover_OUT_ARG_pointers,
    NULL
  },
  "handle-discover",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _goa_realm_provider_method_info_pointers[] =
{
  &_goa_realm_provider_method_info_discover,
  NULL
};

static const _ExtendedGDBusPropertyInfo _goa_realm_provider_property_info_name =
{
  {
    -1,
    (gchar *) "Name",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "name",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_provider_property_info_version =
{
  {
    -1,
    (gchar *) "Version",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "version",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_provider_property_info_realms =
{
  {
    -1,
    (gchar *) "Realms",
    (gchar *) "ao",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "realms",
  FALSE
};

static const _ExtendedGDBusPropertyInfo * const _goa_realm_provider_property_info_pointers[] =
{
  &_goa_realm_provider_property_info_name,
  &_goa_realm_provider_property_info_version,
  &_goa_realm_provider_property_info_realms,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _goa_realm_provider_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.realmd.Provider",
    (GDBusMethodInfo **) &_goa_realm_provider_method_info_pointers,
    NULL,
    (GDBusPropertyInfo **) &_goa_realm_provider_property_info_pointers,
    NULL
  },
  "provider",
};


/**
 * goa_realm_provider_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
goa_realm_provider_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_goa_realm_provider_interface_info.parent_struct;
}

/**
 * goa_realm_provider_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #GoaRealmProvider interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
goa_realm_provider_override_properties (GObjectClass *klass, guint property_id_begin)
{
  g_object_class_override_property (klass, property_id_begin++, "name");
  g_object_class_override_property (klass, property_id_begin++, "version");
  g_object_class_override_property (klass, property_id_begin++, "realms");
  return property_id_begin - 1;
}



/**
 * GoaRealmProvider:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link>.
 */

/**
 * GoaRealmProviderIface:
 * @parent_iface: The parent interface.
 * @handle_discover: Handler for the #GoaRealmProvider::handle-discover signal.
 * @get_name: Getter for the #GoaRealmProvider:name property.
 * @get_realms: Getter for the #GoaRealmProvider:realms property.
 * @get_version: Getter for the #GoaRealmProvider:version property.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link>.
 */

typedef GoaRealmProviderIface GoaRealmProviderInterface;
G_DEFINE_INTERFACE (GoaRealmProvider, goa_realm_provider, G_TYPE_OBJECT)

static void
goa_realm_provider_default_init (GoaRealmProviderIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * GoaRealmProvider::handle-discover:
   * @object: A #GoaRealmProvider.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_string: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-realmd-Provider.Discover">Discover()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call goa_realm_provider_complete_discover() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-discover",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmProviderIface, handle_discover),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    3,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_VARIANT);

  /* GObject properties for D-Bus properties: */
  /**
   * GoaRealmProvider:name:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Name">"Name"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_string ("name", "Name", "Name", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmProvider:version:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Version">"Version"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_string ("version", "Version", "Version", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmProvider:realms:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Realms">"Realms"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_boxed ("realms", "Realms", "Realms", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

/**
 * goa_realm_provider_get_name: (skip)
 * @object: A #GoaRealmProvider.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Name">"Name"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_provider_dup_name() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
goa_realm_provider_get_name (GoaRealmProvider *object)
{
  return GOA_REALM_PROVIDER_GET_IFACE (object)->get_name (object);
}

/**
 * goa_realm_provider_dup_name: (skip)
 * @object: A #GoaRealmProvider.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Name">"Name"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
goa_realm_provider_dup_name (GoaRealmProvider *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "name", &value, NULL);
  return value;
}

/**
 * goa_realm_provider_set_name: (skip)
 * @object: A #GoaRealmProvider.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Name">"Name"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_provider_set_name (GoaRealmProvider *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "name", value, NULL);
}

/**
 * goa_realm_provider_get_version: (skip)
 * @object: A #GoaRealmProvider.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Version">"Version"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_provider_dup_version() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
goa_realm_provider_get_version (GoaRealmProvider *object)
{
  return GOA_REALM_PROVIDER_GET_IFACE (object)->get_version (object);
}

/**
 * goa_realm_provider_dup_version: (skip)
 * @object: A #GoaRealmProvider.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Version">"Version"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
goa_realm_provider_dup_version (GoaRealmProvider *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "version", &value, NULL);
  return value;
}

/**
 * goa_realm_provider_set_version: (skip)
 * @object: A #GoaRealmProvider.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Version">"Version"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_provider_set_version (GoaRealmProvider *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "version", value, NULL);
}

/**
 * goa_realm_provider_get_realms: (skip)
 * @object: A #GoaRealmProvider.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Realms">"Realms"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_provider_dup_realms() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *const *
goa_realm_provider_get_realms (GoaRealmProvider *object)
{
  return GOA_REALM_PROVIDER_GET_IFACE (object)->get_realms (object);
}

/**
 * goa_realm_provider_dup_realms: (skip)
 * @object: A #GoaRealmProvider.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Realms">"Realms"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
 */
gchar **
goa_realm_provider_dup_realms (GoaRealmProvider *object)
{
  gchar **value;
  g_object_get (G_OBJECT (object), "realms", &value, NULL);
  return value;
}

/**
 * goa_realm_provider_set_realms: (skip)
 * @object: A #GoaRealmProvider.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Provider.Realms">"Realms"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_provider_set_realms (GoaRealmProvider *object, const gchar *const *value)
{
  g_object_set (G_OBJECT (object), "realms", value, NULL);
}

/**
 * goa_realm_provider_call_discover:
 * @proxy: A #GoaRealmProviderProxy.
 * @arg_string: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Provider.Discover">Discover()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_provider_call_discover_finish() to get the result of the operation.
 *
 * See goa_realm_provider_call_discover_sync() for the synchronous, blocking version of this method.
 */
void
goa_realm_provider_call_discover (
    GoaRealmProvider *proxy,
    const gchar *arg_string,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Discover",
    g_variant_new ("(s@a{sv})",
                   arg_string,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * goa_realm_provider_call_discover_finish:
 * @proxy: A #GoaRealmProviderProxy.
 * @out_relevance: (out): Return location for return parameter or %NULL to ignore.
 * @out_realm: (out): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_provider_call_discover().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with goa_realm_provider_call_discover().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_provider_call_discover_finish (
    GoaRealmProvider *proxy,
    gint *out_relevance,
    gchar ***out_realm,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(i^ao)",
                 out_relevance,
                 out_realm);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_provider_call_discover_sync:
 * @proxy: A #GoaRealmProviderProxy.
 * @arg_string: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @out_relevance: (out): Return location for return parameter or %NULL to ignore.
 * @out_realm: (out): Return location for return parameter or %NULL to ignore.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Provider.Discover">Discover()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See goa_realm_provider_call_discover() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_provider_call_discover_sync (
    GoaRealmProvider *proxy,
    const gchar *arg_string,
    GVariant *arg_options,
    gint *out_relevance,
    gchar ***out_realm,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Discover",
    g_variant_new ("(s@a{sv})",
                   arg_string,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(i^ao)",
                 out_relevance,
                 out_realm);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_provider_complete_discover:
 * @object: A #GoaRealmProvider.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @relevance: Parameter to return.
 * @realm: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-realmd-Provider.Discover">Discover()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
goa_realm_provider_complete_discover (
    GoaRealmProvider *object,
    GDBusMethodInvocation *invocation,
    gint relevance,
    const gchar *const *realm)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(i^ao)",
                   relevance,
                   realm));
}

/* ------------------------------------------------------------------------ */

/**
 * GoaRealmProviderProxy:
 *
 * The #GoaRealmProviderProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmProviderProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmProviderProxy.
 */

struct _GoaRealmProviderProxyPrivate
{
  GData *qdata;
};

static void goa_realm_provider_proxy_iface_init (GoaRealmProviderIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmProviderProxy, goa_realm_provider_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (GoaRealmProviderProxy)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_PROVIDER, goa_realm_provider_proxy_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmProviderProxy, goa_realm_provider_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_PROVIDER, goa_realm_provider_proxy_iface_init))

#endif
static void
goa_realm_provider_proxy_finalize (GObject *object)
{
  GoaRealmProviderProxy *proxy = GOA_REALM_PROVIDER_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (goa_realm_provider_proxy_parent_class)->finalize (object);
}

static void
goa_realm_provider_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < 3);
  info = _goa_realm_provider_property_info_pointers[prop_id - 1];
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
  if (info->use_gvariant)
    {
      g_value_set_variant (value, variant);
    }
  else
    {
      if (variant != NULL)
        g_dbus_gvariant_to_gvalue (variant, value);
    }
  if (variant != NULL)
    g_variant_unref (variant);
}

static void
goa_realm_provider_proxy_set_property_cb (GDBusProxy *proxy,
  GAsyncResult *res,
  gpointer      user_data)
{
  const _ExtendedGDBusPropertyInfo *info = user_data;
  GError *error;
  GVariant *_ret;
  error = NULL;
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
  if (!_ret)
    {
      g_warning ("Error setting property '%s' on interface org.freedesktop.realmd.Provider: %s (%s, %d)",
                 info->parent_struct.name, 
                 error->message, g_quark_to_string (error->domain), error->code);
      g_error_free (error);
    }
  else
    {
      g_variant_unref (_ret);
    }
}

static void
goa_realm_provider_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < 3);
  info = _goa_realm_provider_property_info_pointers[prop_id - 1];
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
  g_dbus_proxy_call (G_DBUS_PROXY (object),
    "org.freedesktop.DBus.Properties.Set",
    g_variant_new ("(ssv)", "org.freedesktop.realmd.Provider", info->parent_struct.name, variant),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    NULL, (GAsyncReadyCallback) goa_realm_provider_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
  g_variant_unref (variant);
}

static void
goa_realm_provider_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  gsize n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_goa_realm_provider_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], GOA_REALM_TYPE_PROVIDER);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_PROVIDER);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
goa_realm_provider_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  GoaRealmProviderProxy *proxy = GOA_REALM_PROVIDER_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_provider_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_provider_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static const gchar *
goa_realm_provider_proxy_get_name (GoaRealmProvider *object)
{
  GoaRealmProviderProxy *proxy = GOA_REALM_PROVIDER_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Name");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static const gchar *
goa_realm_provider_proxy_get_version (GoaRealmProvider *object)
{
  GoaRealmProviderProxy *proxy = GOA_REALM_PROVIDER_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Version");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static const gchar *const *
goa_realm_provider_proxy_get_realms (GoaRealmProvider *object)
{
  GoaRealmProviderProxy *proxy = GOA_REALM_PROVIDER_PROXY (object);
  GVariant *variant;
  const gchar *const *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Realms");
  if (variant != NULL)
    {
      value = g_variant_get_objv (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static void
goa_realm_provider_proxy_init (GoaRealmProviderProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = goa_realm_provider_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GOA_REALM_TYPE_PROVIDER_PROXY, GoaRealmProviderProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), goa_realm_provider_interface_info ());
}

static void
goa_realm_provider_proxy_class_init (GoaRealmProviderProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = goa_realm_provider_proxy_finalize;
  gobject_class->get_property = goa_realm_provider_proxy_get_property;
  gobject_class->set_property = goa_realm_provider_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = goa_realm_provider_proxy_g_signal;
  proxy_class->g_properties_changed = goa_realm_provider_proxy_g_properties_changed;

  goa_realm_provider_override_properties (gobject_class, 1);

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmProviderProxyPrivate));
#endif
}

static void
goa_realm_provider_proxy_iface_init (GoaRealmProviderIface *iface)
{
  iface->get_name = goa_realm_provider_proxy_get_name;
  iface->get_version = goa_realm_provider_proxy_get_version;
  iface->get_realms = goa_realm_provider_proxy_get_realms;
}

/**
 * goa_realm_provider_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_provider_proxy_new_finish() to get the result of the operation.
 *
 * See goa_realm_provider_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_provider_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_PROVIDER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Provider", NULL);
}

/**
 * goa_realm_provider_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_provider_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_provider_proxy_new().
 *
 * Returns: (transfer full) (type GoaRealmProviderProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmProvider *
goa_realm_provider_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_PROVIDER (ret);
  else
    return NULL;
}

/**
 * goa_realm_provider_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_provider_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmProviderProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmProvider *
goa_realm_provider_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_PROVIDER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Provider", NULL);
  if (ret != NULL)
    return GOA_REALM_PROVIDER (ret);
  else
    return NULL;
}


/**
 * goa_realm_provider_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like goa_realm_provider_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_provider_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See goa_realm_provider_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_provider_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_PROVIDER_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Provider", NULL);
}

/**
 * goa_realm_provider_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_provider_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_provider_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type GoaRealmProviderProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmProvider *
goa_realm_provider_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_PROVIDER (ret);
  else
    return NULL;
}

/**
 * goa_realm_provider_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like goa_realm_provider_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_provider_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmProviderProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmProvider *
goa_realm_provider_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_PROVIDER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Provider", NULL);
  if (ret != NULL)
    return GOA_REALM_PROVIDER (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * GoaRealmProviderSkeleton:
 *
 * The #GoaRealmProviderSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmProviderSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmProviderSkeleton.
 */

struct _GoaRealmProviderSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_goa_realm_provider_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  guint num_extra;
  gsize n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], GOA_REALM_TYPE_PROVIDER);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_PROVIDER);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_goa_realm_provider_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_provider_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_goa_realm_provider_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_provider_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _goa_realm_provider_skeleton_vtable =
{
  _goa_realm_provider_skeleton_handle_method_call,
  _goa_realm_provider_skeleton_handle_get_property,
  _goa_realm_provider_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
goa_realm_provider_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return goa_realm_provider_interface_info ();
}

static GDBusInterfaceVTable *
goa_realm_provider_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_goa_realm_provider_skeleton_vtable;
}

static GVariant *
goa_realm_provider_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_goa_realm_provider_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _goa_realm_provider_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _goa_realm_provider_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _goa_realm_provider_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.realmd.Provider", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static gboolean _goa_realm_provider_emit_changed (gpointer user_data);

static void
goa_realm_provider_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (_skeleton);
  gboolean emit_changed = FALSE;

  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    {
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
      skeleton->priv->changed_properties_idle_source = NULL;
      emit_changed = TRUE;
    }
  g_mutex_unlock (&skeleton->priv->lock);

  if (emit_changed)
    _goa_realm_provider_emit_changed (skeleton);
}

static void goa_realm_provider_skeleton_iface_init (GoaRealmProviderIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmProviderSkeleton, goa_realm_provider_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (GoaRealmProviderSkeleton)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_PROVIDER, goa_realm_provider_skeleton_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmProviderSkeleton, goa_realm_provider_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_PROVIDER, goa_realm_provider_skeleton_iface_init))

#endif
static void
goa_realm_provider_skeleton_finalize (GObject *object)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (object);
  guint n;
  for (n = 0; n < 3; n++)
    g_value_unset (&skeleton->priv->properties[n]);
  g_free (skeleton->priv->properties);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (goa_realm_provider_skeleton_parent_class)->finalize (object);
}

static void
goa_realm_provider_skeleton_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 3);
  g_mutex_lock (&skeleton->priv->lock);
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
  g_mutex_unlock (&skeleton->priv->lock);
}

static gboolean
_goa_realm_provider_emit_changed (gpointer user_data)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (user_data);
  GList *l;
  GVariantBuilder builder;
  GVariantBuilder invalidated_builder;
  guint num_changes;

  g_mutex_lock (&skeleton->priv->lock);
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
    {
      ChangedProperty *cp = l->data;
      GVariant *variant;
      const GValue *cur_value;

      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
      if (!_g_value_equal (cur_value, &cp->orig_value))
        {
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
          g_variant_unref (variant);
          num_changes++;
        }
    }
  if (num_changes > 0)
    {
      GList *connections, *ll;
      GVariant *signal_variant;
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.realmd.Provider",
                                           &builder, &invalidated_builder));
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
      for (ll = connections; ll != NULL; ll = ll->next)
        {
          GDBusConnection *connection = ll->data;

          g_dbus_connection_emit_signal (connection,
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
                                         "org.freedesktop.DBus.Properties",
                                         "PropertiesChanged",
                                         signal_variant,
                                         NULL);
        }
      g_variant_unref (signal_variant);
      g_list_free_full (connections, g_object_unref);
    }
  else
    {
      g_variant_builder_clear (&builder);
      g_variant_builder_clear (&invalidated_builder);
    }
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  skeleton->priv->changed_properties = NULL;
  skeleton->priv->changed_properties_idle_source = NULL;
  g_mutex_unlock (&skeleton->priv->lock);
  return FALSE;
}

static void
_goa_realm_provider_schedule_emit_changed (GoaRealmProviderSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
{
  ChangedProperty *cp;
  GList *l;
  cp = NULL;
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
    {
      ChangedProperty *i_cp = l->data;
      if (i_cp->info == info)
        {
          cp = i_cp;
          break;
        }
    }
  if (cp == NULL)
    {
      cp = g_new0 (ChangedProperty, 1);
      cp->prop_id = prop_id;
      cp->info = info;
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
      g_value_copy (orig_value, &cp->orig_value);
    }
}

static void
goa_realm_provider_skeleton_notify (GObject      *object,
  GParamSpec *pspec G_GNUC_UNUSED)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (object);
  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties != NULL &&
      skeleton->priv->changed_properties_idle_source == NULL)
    {
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _goa_realm_provider_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _goa_realm_provider_emit_changed");
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
      g_source_unref (skeleton->priv->changed_properties_idle_source);
    }
  g_mutex_unlock (&skeleton->priv->lock);
}

static void
goa_realm_provider_skeleton_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 3);
  g_mutex_lock (&skeleton->priv->lock);
  g_object_freeze_notify (object);
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
    {
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
        _goa_realm_provider_schedule_emit_changed (skeleton, _goa_realm_provider_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
      g_object_notify_by_pspec (object, pspec);
    }
  g_mutex_unlock (&skeleton->priv->lock);
  g_object_thaw_notify (object);
}

static void
goa_realm_provider_skeleton_init (GoaRealmProviderSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = goa_realm_provider_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GOA_REALM_TYPE_PROVIDER_SKELETON, GoaRealmProviderSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
  skeleton->priv->properties = g_new0 (GValue, 3);
  g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
  g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
  g_value_init (&skeleton->priv->properties[2], G_TYPE_STRV);
}

static const gchar *
goa_realm_provider_skeleton_get_name (GoaRealmProvider *object)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_string (&(skeleton->priv->properties[0]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *
goa_realm_provider_skeleton_get_version (GoaRealmProvider *object)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_string (&(skeleton->priv->properties[1]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *const *
goa_realm_provider_skeleton_get_realms (GoaRealmProvider *object)
{
  GoaRealmProviderSkeleton *skeleton = GOA_REALM_PROVIDER_SKELETON (object);
  const gchar *const *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_boxed (&(skeleton->priv->properties[2]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static void
goa_realm_provider_skeleton_class_init (GoaRealmProviderSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = goa_realm_provider_skeleton_finalize;
  gobject_class->get_property = goa_realm_provider_skeleton_get_property;
  gobject_class->set_property = goa_realm_provider_skeleton_set_property;
  gobject_class->notify       = goa_realm_provider_skeleton_notify;


  goa_realm_provider_override_properties (gobject_class, 1);

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = goa_realm_provider_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = goa_realm_provider_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = goa_realm_provider_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = goa_realm_provider_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmProviderSkeletonPrivate));
#endif
}

static void
goa_realm_provider_skeleton_iface_init (GoaRealmProviderIface *iface)
{
  iface->get_name = goa_realm_provider_skeleton_get_name;
  iface->get_version = goa_realm_provider_skeleton_get_version;
  iface->get_realms = goa_realm_provider_skeleton_get_realms;
}

/**
 * goa_realm_provider_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link>.
 *
 * Returns: (transfer full) (type GoaRealmProviderSkeleton): The skeleton object.
 */
GoaRealmProvider *
goa_realm_provider_skeleton_new (void)
{
  return GOA_REALM_PROVIDER (g_object_new (GOA_REALM_TYPE_PROVIDER_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.realmd.Service
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GoaRealmService
 * @title: GoaRealmService
 * @short_description: Generated C code for the org.freedesktop.realmd.Service D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.realmd.Service ---- */

static const _ExtendedGDBusArgInfo _goa_realm_service_method_info_cancel_IN_ARG_operation =
{
  {
    -1,
    (gchar *) "operation",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_service_method_info_cancel_IN_ARG_pointers[] =
{
  &_goa_realm_service_method_info_cancel_IN_ARG_operation,
  NULL
};

static const _ExtendedGDBusMethodInfo _goa_realm_service_method_info_cancel =
{
  {
    -1,
    (gchar *) "Cancel",
    (GDBusArgInfo **) &_goa_realm_service_method_info_cancel_IN_ARG_pointers,
    NULL,
    NULL
  },
  "handle-cancel",
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_service_method_info_set_locale_IN_ARG_locale =
{
  {
    -1,
    (gchar *) "locale",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_service_method_info_set_locale_IN_ARG_pointers[] =
{
  &_goa_realm_service_method_info_set_locale_IN_ARG_locale,
  NULL
};

static const _ExtendedGDBusMethodInfo _goa_realm_service_method_info_set_locale =
{
  {
    -1,
    (gchar *) "SetLocale",
    (GDBusArgInfo **) &_goa_realm_service_method_info_set_locale_IN_ARG_pointers,
    NULL,
    NULL
  },
  "handle-set-locale",
  FALSE
};

static const _ExtendedGDBusMethodInfo _goa_realm_service_method_info_release =
{
  {
    -1,
    (gchar *) "Release",
    NULL,
    NULL,
    NULL
  },
  "handle-release",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _goa_realm_service_method_info_pointers[] =
{
  &_goa_realm_service_method_info_cancel,
  &_goa_realm_service_method_info_set_locale,
  &_goa_realm_service_method_info_release,
  NULL
};

static const _ExtendedGDBusArgInfo _goa_realm_service_signal_info_diagnostics_ARG_data =
{
  {
    -1,
    (gchar *) "data",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_service_signal_info_diagnostics_ARG_operation =
{
  {
    -1,
    (gchar *) "operation",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_service_signal_info_diagnostics_ARG_pointers[] =
{
  &_goa_realm_service_signal_info_diagnostics_ARG_data,
  &_goa_realm_service_signal_info_diagnostics_ARG_operation,
  NULL
};

static const _ExtendedGDBusSignalInfo _goa_realm_service_signal_info_diagnostics =
{
  {
    -1,
    (gchar *) "Diagnostics",
    (GDBusArgInfo **) &_goa_realm_service_signal_info_diagnostics_ARG_pointers,
    NULL
  },
  "diagnostics"
};

static const _ExtendedGDBusSignalInfo * const _goa_realm_service_signal_info_pointers[] =
{
  &_goa_realm_service_signal_info_diagnostics,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _goa_realm_service_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.realmd.Service",
    (GDBusMethodInfo **) &_goa_realm_service_method_info_pointers,
    (GDBusSignalInfo **) &_goa_realm_service_signal_info_pointers,
    NULL,
    NULL
  },
  "service",
};


/**
 * goa_realm_service_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
goa_realm_service_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_goa_realm_service_interface_info.parent_struct;
}

/**
 * goa_realm_service_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #GoaRealmService interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
goa_realm_service_override_properties (GObjectClass *klass, guint property_id_begin)
{
  return property_id_begin - 1;
}



/**
 * GoaRealmService:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link>.
 */

/**
 * GoaRealmServiceIface:
 * @parent_iface: The parent interface.
 * @handle_cancel: Handler for the #GoaRealmService::handle-cancel signal.
 * @handle_release: Handler for the #GoaRealmService::handle-release signal.
 * @handle_set_locale: Handler for the #GoaRealmService::handle-set-locale signal.
 * @diagnostics: Handler for the #GoaRealmService::diagnostics signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link>.
 */

typedef GoaRealmServiceIface GoaRealmServiceInterface;
G_DEFINE_INTERFACE (GoaRealmService, goa_realm_service, G_TYPE_OBJECT)

static void
goa_realm_service_default_init (GoaRealmServiceIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * GoaRealmService::handle-cancel:
   * @object: A #GoaRealmService.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_operation: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-realmd-Service.Cancel">Cancel()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call goa_realm_service_complete_cancel() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-cancel",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmServiceIface, handle_cancel),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    2,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);

  /**
   * GoaRealmService::handle-set-locale:
   * @object: A #GoaRealmService.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_locale: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-realmd-Service.SetLocale">SetLocale()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call goa_realm_service_complete_set_locale() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-set-locale",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmServiceIface, handle_set_locale),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    2,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING);

  /**
   * GoaRealmService::handle-release:
   * @object: A #GoaRealmService.
   * @invocation: A #GDBusMethodInvocation.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-realmd-Service.Release">Release()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call goa_realm_service_complete_release() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-release",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmServiceIface, handle_release),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    1,
    G_TYPE_DBUS_METHOD_INVOCATION);

  /* GObject signals for received D-Bus signals: */
  /**
   * GoaRealmService::diagnostics:
   * @object: A #GoaRealmService.
   * @arg_data: Argument.
   * @arg_operation: Argument.
   *
   * On the client-side, this signal is emitted whenever the D-Bus signal <link linkend="gdbus-signal-org-freedesktop-realmd-Service.Diagnostics">"Diagnostics"</link> is received.
   *
   * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal.
   */
  g_signal_new ("diagnostics",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmServiceIface, diagnostics),
    NULL,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_NONE,
    2, G_TYPE_STRING, G_TYPE_STRING);

}

/**
 * goa_realm_service_emit_diagnostics:
 * @object: A #GoaRealmService.
 * @arg_data: Argument to pass with the signal.
 * @arg_operation: Argument to pass with the signal.
 *
 * Emits the <link linkend="gdbus-signal-org-freedesktop-realmd-Service.Diagnostics">"Diagnostics"</link> D-Bus signal.
 */
void
goa_realm_service_emit_diagnostics (
    GoaRealmService *object,
    const gchar *arg_data,
    const gchar *arg_operation)
{
  g_signal_emit_by_name (object, "diagnostics", arg_data, arg_operation);
}

/**
 * goa_realm_service_call_cancel:
 * @proxy: A #GoaRealmServiceProxy.
 * @arg_operation: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Service.Cancel">Cancel()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_service_call_cancel_finish() to get the result of the operation.
 *
 * See goa_realm_service_call_cancel_sync() for the synchronous, blocking version of this method.
 */
void
goa_realm_service_call_cancel (
    GoaRealmService *proxy,
    const gchar *arg_operation,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Cancel",
    g_variant_new ("(s)",
                   arg_operation),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * goa_realm_service_call_cancel_finish:
 * @proxy: A #GoaRealmServiceProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_service_call_cancel().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with goa_realm_service_call_cancel().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_service_call_cancel_finish (
    GoaRealmService *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_service_call_cancel_sync:
 * @proxy: A #GoaRealmServiceProxy.
 * @arg_operation: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Service.Cancel">Cancel()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See goa_realm_service_call_cancel() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_service_call_cancel_sync (
    GoaRealmService *proxy,
    const gchar *arg_operation,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Cancel",
    g_variant_new ("(s)",
                   arg_operation),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_service_call_set_locale:
 * @proxy: A #GoaRealmServiceProxy.
 * @arg_locale: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Service.SetLocale">SetLocale()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_service_call_set_locale_finish() to get the result of the operation.
 *
 * See goa_realm_service_call_set_locale_sync() for the synchronous, blocking version of this method.
 */
void
goa_realm_service_call_set_locale (
    GoaRealmService *proxy,
    const gchar *arg_locale,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "SetLocale",
    g_variant_new ("(s)",
                   arg_locale),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * goa_realm_service_call_set_locale_finish:
 * @proxy: A #GoaRealmServiceProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_service_call_set_locale().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with goa_realm_service_call_set_locale().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_service_call_set_locale_finish (
    GoaRealmService *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_service_call_set_locale_sync:
 * @proxy: A #GoaRealmServiceProxy.
 * @arg_locale: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Service.SetLocale">SetLocale()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See goa_realm_service_call_set_locale() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_service_call_set_locale_sync (
    GoaRealmService *proxy,
    const gchar *arg_locale,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "SetLocale",
    g_variant_new ("(s)",
                   arg_locale),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_service_call_release:
 * @proxy: A #GoaRealmServiceProxy.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Service.Release">Release()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_service_call_release_finish() to get the result of the operation.
 *
 * See goa_realm_service_call_release_sync() for the synchronous, blocking version of this method.
 */
void
goa_realm_service_call_release (
    GoaRealmService *proxy,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Release",
    g_variant_new ("()"),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * goa_realm_service_call_release_finish:
 * @proxy: A #GoaRealmServiceProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_service_call_release().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with goa_realm_service_call_release().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_service_call_release_finish (
    GoaRealmService *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_service_call_release_sync:
 * @proxy: A #GoaRealmServiceProxy.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Service.Release">Release()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See goa_realm_service_call_release() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_service_call_release_sync (
    GoaRealmService *proxy,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Release",
    g_variant_new ("()"),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_service_complete_cancel:
 * @object: A #GoaRealmService.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-realmd-Service.Cancel">Cancel()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
goa_realm_service_complete_cancel (
    GoaRealmService *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/**
 * goa_realm_service_complete_set_locale:
 * @object: A #GoaRealmService.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-realmd-Service.SetLocale">SetLocale()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
goa_realm_service_complete_set_locale (
    GoaRealmService *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/**
 * goa_realm_service_complete_release:
 * @object: A #GoaRealmService.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-realmd-Service.Release">Release()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
goa_realm_service_complete_release (
    GoaRealmService *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/* ------------------------------------------------------------------------ */

/**
 * GoaRealmServiceProxy:
 *
 * The #GoaRealmServiceProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmServiceProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmServiceProxy.
 */

struct _GoaRealmServiceProxyPrivate
{
  GData *qdata;
};

static void goa_realm_service_proxy_iface_init (GoaRealmServiceIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmServiceProxy, goa_realm_service_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (GoaRealmServiceProxy)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_SERVICE, goa_realm_service_proxy_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmServiceProxy, goa_realm_service_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_SERVICE, goa_realm_service_proxy_iface_init))

#endif
static void
goa_realm_service_proxy_finalize (GObject *object)
{
  GoaRealmServiceProxy *proxy = GOA_REALM_SERVICE_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (goa_realm_service_proxy_parent_class)->finalize (object);
}

static void
goa_realm_service_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
goa_realm_service_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
}

static void
goa_realm_service_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  gsize n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_goa_realm_service_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], GOA_REALM_TYPE_SERVICE);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_SERVICE);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
goa_realm_service_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  GoaRealmServiceProxy *proxy = GOA_REALM_SERVICE_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_service_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_service_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static void
goa_realm_service_proxy_init (GoaRealmServiceProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = goa_realm_service_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GOA_REALM_TYPE_SERVICE_PROXY, GoaRealmServiceProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), goa_realm_service_interface_info ());
}

static void
goa_realm_service_proxy_class_init (GoaRealmServiceProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = goa_realm_service_proxy_finalize;
  gobject_class->get_property = goa_realm_service_proxy_get_property;
  gobject_class->set_property = goa_realm_service_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = goa_realm_service_proxy_g_signal;
  proxy_class->g_properties_changed = goa_realm_service_proxy_g_properties_changed;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmServiceProxyPrivate));
#endif
}

static void
goa_realm_service_proxy_iface_init (GoaRealmServiceIface *iface)
{
}

/**
 * goa_realm_service_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_service_proxy_new_finish() to get the result of the operation.
 *
 * See goa_realm_service_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_service_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_SERVICE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Service", NULL);
}

/**
 * goa_realm_service_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_service_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_service_proxy_new().
 *
 * Returns: (transfer full) (type GoaRealmServiceProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmService *
goa_realm_service_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_SERVICE (ret);
  else
    return NULL;
}

/**
 * goa_realm_service_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_service_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmServiceProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmService *
goa_realm_service_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_SERVICE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Service", NULL);
  if (ret != NULL)
    return GOA_REALM_SERVICE (ret);
  else
    return NULL;
}


/**
 * goa_realm_service_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like goa_realm_service_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_service_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See goa_realm_service_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_service_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_SERVICE_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Service", NULL);
}

/**
 * goa_realm_service_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_service_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_service_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type GoaRealmServiceProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmService *
goa_realm_service_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_SERVICE (ret);
  else
    return NULL;
}

/**
 * goa_realm_service_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like goa_realm_service_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_service_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmServiceProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmService *
goa_realm_service_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_SERVICE_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Service", NULL);
  if (ret != NULL)
    return GOA_REALM_SERVICE (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * GoaRealmServiceSkeleton:
 *
 * The #GoaRealmServiceSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmServiceSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmServiceSkeleton.
 */

struct _GoaRealmServiceSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_goa_realm_service_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  GoaRealmServiceSkeleton *skeleton = GOA_REALM_SERVICE_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  guint num_extra;
  gsize n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], GOA_REALM_TYPE_SERVICE);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_SERVICE);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_goa_realm_service_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  GoaRealmServiceSkeleton *skeleton = GOA_REALM_SERVICE_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_service_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_goa_realm_service_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  GoaRealmServiceSkeleton *skeleton = GOA_REALM_SERVICE_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_service_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _goa_realm_service_skeleton_vtable =
{
  _goa_realm_service_skeleton_handle_method_call,
  _goa_realm_service_skeleton_handle_get_property,
  _goa_realm_service_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
goa_realm_service_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return goa_realm_service_interface_info ();
}

static GDBusInterfaceVTable *
goa_realm_service_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_goa_realm_service_skeleton_vtable;
}

static GVariant *
goa_realm_service_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmServiceSkeleton *skeleton = GOA_REALM_SERVICE_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_goa_realm_service_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _goa_realm_service_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _goa_realm_service_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _goa_realm_service_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.realmd.Service", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static void
goa_realm_service_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
}

static void
_goa_realm_service_on_signal_diagnostics (
    GoaRealmService *object,
    const gchar *arg_data,
    const gchar *arg_operation)
{
  GoaRealmServiceSkeleton *skeleton = GOA_REALM_SERVICE_SKELETON (object);

  GList      *connections, *l;
  GVariant   *signal_variant;
  connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));

  signal_variant = g_variant_ref_sink (g_variant_new ("(ss)",
                   arg_data,
                   arg_operation));
  for (l = connections; l != NULL; l = l->next)
    {
      GDBusConnection *connection = l->data;
      g_dbus_connection_emit_signal (connection,
        NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.realmd.Service", "Diagnostics",
        signal_variant, NULL);
    }
  g_variant_unref (signal_variant);
  g_list_free_full (connections, g_object_unref);
}

static void goa_realm_service_skeleton_iface_init (GoaRealmServiceIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmServiceSkeleton, goa_realm_service_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (GoaRealmServiceSkeleton)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_SERVICE, goa_realm_service_skeleton_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmServiceSkeleton, goa_realm_service_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_SERVICE, goa_realm_service_skeleton_iface_init))

#endif
static void
goa_realm_service_skeleton_finalize (GObject *object)
{
  GoaRealmServiceSkeleton *skeleton = GOA_REALM_SERVICE_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (goa_realm_service_skeleton_parent_class)->finalize (object);
}

static void
goa_realm_service_skeleton_init (GoaRealmServiceSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = goa_realm_service_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GOA_REALM_TYPE_SERVICE_SKELETON, GoaRealmServiceSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
}

static void
goa_realm_service_skeleton_class_init (GoaRealmServiceSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = goa_realm_service_skeleton_finalize;

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = goa_realm_service_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = goa_realm_service_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = goa_realm_service_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = goa_realm_service_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmServiceSkeletonPrivate));
#endif
}

static void
goa_realm_service_skeleton_iface_init (GoaRealmServiceIface *iface)
{
  iface->diagnostics = _goa_realm_service_on_signal_diagnostics;
}

/**
 * goa_realm_service_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link>.
 *
 * Returns: (transfer full) (type GoaRealmServiceSkeleton): The skeleton object.
 */
GoaRealmService *
goa_realm_service_skeleton_new (void)
{
  return GOA_REALM_SERVICE (g_object_new (GOA_REALM_TYPE_SERVICE_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.realmd.Realm
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GoaRealmCommon
 * @title: GoaRealmCommon
 * @short_description: Generated C code for the org.freedesktop.realmd.Realm D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.realmd.Realm ---- */

static const _ExtendedGDBusArgInfo _goa_realm_common_method_info_deconfigure_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_common_method_info_deconfigure_IN_ARG_pointers[] =
{
  &_goa_realm_common_method_info_deconfigure_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusMethodInfo _goa_realm_common_method_info_deconfigure =
{
  {
    -1,
    (gchar *) "Deconfigure",
    (GDBusArgInfo **) &_goa_realm_common_method_info_deconfigure_IN_ARG_pointers,
    NULL,
    NULL
  },
  "handle-deconfigure",
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_common_method_info_change_login_policy_IN_ARG_login_policy =
{
  {
    -1,
    (gchar *) "login_policy",
    (gchar *) "s",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_common_method_info_change_login_policy_IN_ARG_permitted_add =
{
  {
    -1,
    (gchar *) "permitted_add",
    (gchar *) "as",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_common_method_info_change_login_policy_IN_ARG_permitted_remove =
{
  {
    -1,
    (gchar *) "permitted_remove",
    (gchar *) "as",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_common_method_info_change_login_policy_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_common_method_info_change_login_policy_IN_ARG_pointers[] =
{
  &_goa_realm_common_method_info_change_login_policy_IN_ARG_login_policy,
  &_goa_realm_common_method_info_change_login_policy_IN_ARG_permitted_add,
  &_goa_realm_common_method_info_change_login_policy_IN_ARG_permitted_remove,
  &_goa_realm_common_method_info_change_login_policy_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusMethodInfo _goa_realm_common_method_info_change_login_policy =
{
  {
    -1,
    (gchar *) "ChangeLoginPolicy",
    (GDBusArgInfo **) &_goa_realm_common_method_info_change_login_policy_IN_ARG_pointers,
    NULL,
    NULL
  },
  "handle-change-login-policy",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _goa_realm_common_method_info_pointers[] =
{
  &_goa_realm_common_method_info_deconfigure,
  &_goa_realm_common_method_info_change_login_policy,
  NULL
};

static const _ExtendedGDBusPropertyInfo _goa_realm_common_property_info_name =
{
  {
    -1,
    (gchar *) "Name",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "name",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_common_property_info_configured =
{
  {
    -1,
    (gchar *) "Configured",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "configured",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_common_property_info_supported_interfaces =
{
  {
    -1,
    (gchar *) "SupportedInterfaces",
    (gchar *) "as",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "supported-interfaces",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_common_property_info_details =
{
  {
    -1,
    (gchar *) "Details",
    (gchar *) "a(ss)",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "details",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_common_property_info_login_formats =
{
  {
    -1,
    (gchar *) "LoginFormats",
    (gchar *) "as",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "login-formats",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_common_property_info_login_policy =
{
  {
    -1,
    (gchar *) "LoginPolicy",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "login-policy",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_common_property_info_permitted_logins =
{
  {
    -1,
    (gchar *) "PermittedLogins",
    (gchar *) "as",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "permitted-logins",
  FALSE
};

static const _ExtendedGDBusPropertyInfo * const _goa_realm_common_property_info_pointers[] =
{
  &_goa_realm_common_property_info_name,
  &_goa_realm_common_property_info_configured,
  &_goa_realm_common_property_info_supported_interfaces,
  &_goa_realm_common_property_info_details,
  &_goa_realm_common_property_info_login_formats,
  &_goa_realm_common_property_info_login_policy,
  &_goa_realm_common_property_info_permitted_logins,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _goa_realm_common_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.realmd.Realm",
    (GDBusMethodInfo **) &_goa_realm_common_method_info_pointers,
    NULL,
    (GDBusPropertyInfo **) &_goa_realm_common_property_info_pointers,
    NULL
  },
  "common",
};


/**
 * goa_realm_common_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
goa_realm_common_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_goa_realm_common_interface_info.parent_struct;
}

/**
 * goa_realm_common_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #GoaRealmCommon interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
goa_realm_common_override_properties (GObjectClass *klass, guint property_id_begin)
{
  g_object_class_override_property (klass, property_id_begin++, "name");
  g_object_class_override_property (klass, property_id_begin++, "configured");
  g_object_class_override_property (klass, property_id_begin++, "supported-interfaces");
  g_object_class_override_property (klass, property_id_begin++, "details");
  g_object_class_override_property (klass, property_id_begin++, "login-formats");
  g_object_class_override_property (klass, property_id_begin++, "login-policy");
  g_object_class_override_property (klass, property_id_begin++, "permitted-logins");
  return property_id_begin - 1;
}



/**
 * GoaRealmCommon:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link>.
 */

/**
 * GoaRealmCommonIface:
 * @parent_iface: The parent interface.
 * @handle_change_login_policy: Handler for the #GoaRealmCommon::handle-change-login-policy signal.
 * @handle_deconfigure: Handler for the #GoaRealmCommon::handle-deconfigure signal.
 * @get_configured: Getter for the #GoaRealmCommon:configured property.
 * @get_details: Getter for the #GoaRealmCommon:details property.
 * @get_login_formats: Getter for the #GoaRealmCommon:login-formats property.
 * @get_login_policy: Getter for the #GoaRealmCommon:login-policy property.
 * @get_name: Getter for the #GoaRealmCommon:name property.
 * @get_permitted_logins: Getter for the #GoaRealmCommon:permitted-logins property.
 * @get_supported_interfaces: Getter for the #GoaRealmCommon:supported-interfaces property.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link>.
 */

typedef GoaRealmCommonIface GoaRealmCommonInterface;
G_DEFINE_INTERFACE (GoaRealmCommon, goa_realm_common, G_TYPE_OBJECT)

static void
goa_realm_common_default_init (GoaRealmCommonIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * GoaRealmCommon::handle-deconfigure:
   * @object: A #GoaRealmCommon.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-realmd-Realm.Deconfigure">Deconfigure()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call goa_realm_common_complete_deconfigure() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-deconfigure",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmCommonIface, handle_deconfigure),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    2,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT);

  /**
   * GoaRealmCommon::handle-change-login-policy:
   * @object: A #GoaRealmCommon.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_login_policy: Argument passed by remote caller.
   * @arg_permitted_add: Argument passed by remote caller.
   * @arg_permitted_remove: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-realmd-Realm.ChangeLoginPolicy">ChangeLoginPolicy()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call goa_realm_common_complete_change_login_policy() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-change-login-policy",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmCommonIface, handle_change_login_policy),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    5,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_STRING, G_TYPE_STRV, G_TYPE_STRV, G_TYPE_VARIANT);

  /* GObject properties for D-Bus properties: */
  /**
   * GoaRealmCommon:name:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Name">"Name"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_string ("name", "Name", "Name", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmCommon:configured:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Configured">"Configured"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_string ("configured", "Configured", "Configured", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmCommon:supported-interfaces:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Realm.SupportedInterfaces">"SupportedInterfaces"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_boxed ("supported-interfaces", "SupportedInterfaces", "SupportedInterfaces", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmCommon:details:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Details">"Details"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_variant ("details", "Details", "Details", G_VARIANT_TYPE ("a(ss)"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmCommon:login-formats:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Realm.LoginFormats">"LoginFormats"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_boxed ("login-formats", "LoginFormats", "LoginFormats", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmCommon:login-policy:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Realm.LoginPolicy">"LoginPolicy"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_string ("login-policy", "LoginPolicy", "LoginPolicy", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmCommon:permitted-logins:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Realm.PermittedLogins">"PermittedLogins"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_boxed ("permitted-logins", "PermittedLogins", "PermittedLogins", G_TYPE_STRV, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

/**
 * goa_realm_common_get_name: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Name">"Name"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_common_dup_name() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
goa_realm_common_get_name (GoaRealmCommon *object)
{
  return GOA_REALM_COMMON_GET_IFACE (object)->get_name (object);
}

/**
 * goa_realm_common_dup_name: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Name">"Name"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
goa_realm_common_dup_name (GoaRealmCommon *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "name", &value, NULL);
  return value;
}

/**
 * goa_realm_common_set_name: (skip)
 * @object: A #GoaRealmCommon.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Name">"Name"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_common_set_name (GoaRealmCommon *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "name", value, NULL);
}

/**
 * goa_realm_common_get_configured: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Configured">"Configured"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_common_dup_configured() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
goa_realm_common_get_configured (GoaRealmCommon *object)
{
  return GOA_REALM_COMMON_GET_IFACE (object)->get_configured (object);
}

/**
 * goa_realm_common_dup_configured: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Configured">"Configured"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
goa_realm_common_dup_configured (GoaRealmCommon *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "configured", &value, NULL);
  return value;
}

/**
 * goa_realm_common_set_configured: (skip)
 * @object: A #GoaRealmCommon.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Configured">"Configured"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_common_set_configured (GoaRealmCommon *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "configured", value, NULL);
}

/**
 * goa_realm_common_get_supported_interfaces: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.SupportedInterfaces">"SupportedInterfaces"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_common_dup_supported_interfaces() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *const *
goa_realm_common_get_supported_interfaces (GoaRealmCommon *object)
{
  return GOA_REALM_COMMON_GET_IFACE (object)->get_supported_interfaces (object);
}

/**
 * goa_realm_common_dup_supported_interfaces: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.SupportedInterfaces">"SupportedInterfaces"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
 */
gchar **
goa_realm_common_dup_supported_interfaces (GoaRealmCommon *object)
{
  gchar **value;
  g_object_get (G_OBJECT (object), "supported-interfaces", &value, NULL);
  return value;
}

/**
 * goa_realm_common_set_supported_interfaces: (skip)
 * @object: A #GoaRealmCommon.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.SupportedInterfaces">"SupportedInterfaces"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_common_set_supported_interfaces (GoaRealmCommon *object, const gchar *const *value)
{
  g_object_set (G_OBJECT (object), "supported-interfaces", value, NULL);
}

/**
 * goa_realm_common_get_details: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Details">"Details"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_common_dup_details() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
GVariant *
goa_realm_common_get_details (GoaRealmCommon *object)
{
  return GOA_REALM_COMMON_GET_IFACE (object)->get_details (object);
}

/**
 * goa_realm_common_dup_details: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Details">"Details"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref().
 */
GVariant *
goa_realm_common_dup_details (GoaRealmCommon *object)
{
  GVariant *value;
  g_object_get (G_OBJECT (object), "details", &value, NULL);
  return value;
}

/**
 * goa_realm_common_set_details: (skip)
 * @object: A #GoaRealmCommon.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.Details">"Details"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_common_set_details (GoaRealmCommon *object, GVariant *value)
{
  g_object_set (G_OBJECT (object), "details", value, NULL);
}

/**
 * goa_realm_common_get_login_formats: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.LoginFormats">"LoginFormats"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_common_dup_login_formats() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *const *
goa_realm_common_get_login_formats (GoaRealmCommon *object)
{
  return GOA_REALM_COMMON_GET_IFACE (object)->get_login_formats (object);
}

/**
 * goa_realm_common_dup_login_formats: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.LoginFormats">"LoginFormats"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
 */
gchar **
goa_realm_common_dup_login_formats (GoaRealmCommon *object)
{
  gchar **value;
  g_object_get (G_OBJECT (object), "login-formats", &value, NULL);
  return value;
}

/**
 * goa_realm_common_set_login_formats: (skip)
 * @object: A #GoaRealmCommon.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.LoginFormats">"LoginFormats"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_common_set_login_formats (GoaRealmCommon *object, const gchar *const *value)
{
  g_object_set (G_OBJECT (object), "login-formats", value, NULL);
}

/**
 * goa_realm_common_get_login_policy: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.LoginPolicy">"LoginPolicy"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_common_dup_login_policy() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
goa_realm_common_get_login_policy (GoaRealmCommon *object)
{
  return GOA_REALM_COMMON_GET_IFACE (object)->get_login_policy (object);
}

/**
 * goa_realm_common_dup_login_policy: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.LoginPolicy">"LoginPolicy"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
goa_realm_common_dup_login_policy (GoaRealmCommon *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "login-policy", &value, NULL);
  return value;
}

/**
 * goa_realm_common_set_login_policy: (skip)
 * @object: A #GoaRealmCommon.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.LoginPolicy">"LoginPolicy"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_common_set_login_policy (GoaRealmCommon *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "login-policy", value, NULL);
}

/**
 * goa_realm_common_get_permitted_logins: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.PermittedLogins">"PermittedLogins"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_common_dup_permitted_logins() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *const *
goa_realm_common_get_permitted_logins (GoaRealmCommon *object)
{
  return GOA_REALM_COMMON_GET_IFACE (object)->get_permitted_logins (object);
}

/**
 * goa_realm_common_dup_permitted_logins: (skip)
 * @object: A #GoaRealmCommon.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.PermittedLogins">"PermittedLogins"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_strfreev().
 */
gchar **
goa_realm_common_dup_permitted_logins (GoaRealmCommon *object)
{
  gchar **value;
  g_object_get (G_OBJECT (object), "permitted-logins", &value, NULL);
  return value;
}

/**
 * goa_realm_common_set_permitted_logins: (skip)
 * @object: A #GoaRealmCommon.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Realm.PermittedLogins">"PermittedLogins"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_common_set_permitted_logins (GoaRealmCommon *object, const gchar *const *value)
{
  g_object_set (G_OBJECT (object), "permitted-logins", value, NULL);
}

/**
 * goa_realm_common_call_deconfigure:
 * @proxy: A #GoaRealmCommonProxy.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Realm.Deconfigure">Deconfigure()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_common_call_deconfigure_finish() to get the result of the operation.
 *
 * See goa_realm_common_call_deconfigure_sync() for the synchronous, blocking version of this method.
 */
void
goa_realm_common_call_deconfigure (
    GoaRealmCommon *proxy,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Deconfigure",
    g_variant_new ("(@a{sv})",
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * goa_realm_common_call_deconfigure_finish:
 * @proxy: A #GoaRealmCommonProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_common_call_deconfigure().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with goa_realm_common_call_deconfigure().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_common_call_deconfigure_finish (
    GoaRealmCommon *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_common_call_deconfigure_sync:
 * @proxy: A #GoaRealmCommonProxy.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Realm.Deconfigure">Deconfigure()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See goa_realm_common_call_deconfigure() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_common_call_deconfigure_sync (
    GoaRealmCommon *proxy,
    GVariant *arg_options,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Deconfigure",
    g_variant_new ("(@a{sv})",
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_common_call_change_login_policy:
 * @proxy: A #GoaRealmCommonProxy.
 * @arg_login_policy: Argument to pass with the method invocation.
 * @arg_permitted_add: Argument to pass with the method invocation.
 * @arg_permitted_remove: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Realm.ChangeLoginPolicy">ChangeLoginPolicy()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_common_call_change_login_policy_finish() to get the result of the operation.
 *
 * See goa_realm_common_call_change_login_policy_sync() for the synchronous, blocking version of this method.
 */
void
goa_realm_common_call_change_login_policy (
    GoaRealmCommon *proxy,
    const gchar *arg_login_policy,
    const gchar *const *arg_permitted_add,
    const gchar *const *arg_permitted_remove,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "ChangeLoginPolicy",
    g_variant_new ("(s^as^as@a{sv})",
                   arg_login_policy,
                   arg_permitted_add,
                   arg_permitted_remove,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * goa_realm_common_call_change_login_policy_finish:
 * @proxy: A #GoaRealmCommonProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_common_call_change_login_policy().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with goa_realm_common_call_change_login_policy().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_common_call_change_login_policy_finish (
    GoaRealmCommon *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_common_call_change_login_policy_sync:
 * @proxy: A #GoaRealmCommonProxy.
 * @arg_login_policy: Argument to pass with the method invocation.
 * @arg_permitted_add: Argument to pass with the method invocation.
 * @arg_permitted_remove: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-Realm.ChangeLoginPolicy">ChangeLoginPolicy()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See goa_realm_common_call_change_login_policy() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_common_call_change_login_policy_sync (
    GoaRealmCommon *proxy,
    const gchar *arg_login_policy,
    const gchar *const *arg_permitted_add,
    const gchar *const *arg_permitted_remove,
    GVariant *arg_options,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "ChangeLoginPolicy",
    g_variant_new ("(s^as^as@a{sv})",
                   arg_login_policy,
                   arg_permitted_add,
                   arg_permitted_remove,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_common_complete_deconfigure:
 * @object: A #GoaRealmCommon.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-realmd-Realm.Deconfigure">Deconfigure()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
goa_realm_common_complete_deconfigure (
    GoaRealmCommon *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/**
 * goa_realm_common_complete_change_login_policy:
 * @object: A #GoaRealmCommon.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-realmd-Realm.ChangeLoginPolicy">ChangeLoginPolicy()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
goa_realm_common_complete_change_login_policy (
    GoaRealmCommon *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/* ------------------------------------------------------------------------ */

/**
 * GoaRealmCommonProxy:
 *
 * The #GoaRealmCommonProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmCommonProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmCommonProxy.
 */

struct _GoaRealmCommonProxyPrivate
{
  GData *qdata;
};

static void goa_realm_common_proxy_iface_init (GoaRealmCommonIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmCommonProxy, goa_realm_common_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (GoaRealmCommonProxy)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_COMMON, goa_realm_common_proxy_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmCommonProxy, goa_realm_common_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_COMMON, goa_realm_common_proxy_iface_init))

#endif
static void
goa_realm_common_proxy_finalize (GObject *object)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (goa_realm_common_proxy_parent_class)->finalize (object);
}

static void
goa_realm_common_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < 7);
  info = _goa_realm_common_property_info_pointers[prop_id - 1];
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
  if (info->use_gvariant)
    {
      g_value_set_variant (value, variant);
    }
  else
    {
      if (variant != NULL)
        g_dbus_gvariant_to_gvalue (variant, value);
    }
  if (variant != NULL)
    g_variant_unref (variant);
}

static void
goa_realm_common_proxy_set_property_cb (GDBusProxy *proxy,
  GAsyncResult *res,
  gpointer      user_data)
{
  const _ExtendedGDBusPropertyInfo *info = user_data;
  GError *error;
  GVariant *_ret;
  error = NULL;
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
  if (!_ret)
    {
      g_warning ("Error setting property '%s' on interface org.freedesktop.realmd.Realm: %s (%s, %d)",
                 info->parent_struct.name, 
                 error->message, g_quark_to_string (error->domain), error->code);
      g_error_free (error);
    }
  else
    {
      g_variant_unref (_ret);
    }
}

static void
goa_realm_common_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < 7);
  info = _goa_realm_common_property_info_pointers[prop_id - 1];
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
  g_dbus_proxy_call (G_DBUS_PROXY (object),
    "org.freedesktop.DBus.Properties.Set",
    g_variant_new ("(ssv)", "org.freedesktop.realmd.Realm", info->parent_struct.name, variant),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    NULL, (GAsyncReadyCallback) goa_realm_common_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
  g_variant_unref (variant);
}

static void
goa_realm_common_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  gsize n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_goa_realm_common_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], GOA_REALM_TYPE_COMMON);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_COMMON);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
goa_realm_common_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_common_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_common_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static const gchar *
goa_realm_common_proxy_get_name (GoaRealmCommon *object)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Name");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static const gchar *
goa_realm_common_proxy_get_configured (GoaRealmCommon *object)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Configured");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static const gchar *const *
goa_realm_common_proxy_get_supported_interfaces (GoaRealmCommon *object)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (object);
  GVariant *variant;
  const gchar *const *value = NULL;
  value = g_datalist_get_data (&proxy->priv->qdata, "SupportedInterfaces");
  if (value != NULL)
    return value;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "SupportedInterfaces");
  if (variant != NULL)
    {
      value = g_variant_get_strv (variant, NULL);
      g_datalist_set_data_full (&proxy->priv->qdata, "SupportedInterfaces", (gpointer) value, g_free);
      g_variant_unref (variant);
    }
  return value;
}

static GVariant *
goa_realm_common_proxy_get_details (GoaRealmCommon *object)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (object);
  GVariant *variant;
  GVariant *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Details");
  value = variant;
  if (variant != NULL)
    g_variant_unref (variant);
  return value;
}

static const gchar *const *
goa_realm_common_proxy_get_login_formats (GoaRealmCommon *object)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (object);
  GVariant *variant;
  const gchar *const *value = NULL;
  value = g_datalist_get_data (&proxy->priv->qdata, "LoginFormats");
  if (value != NULL)
    return value;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LoginFormats");
  if (variant != NULL)
    {
      value = g_variant_get_strv (variant, NULL);
      g_datalist_set_data_full (&proxy->priv->qdata, "LoginFormats", (gpointer) value, g_free);
      g_variant_unref (variant);
    }
  return value;
}

static const gchar *
goa_realm_common_proxy_get_login_policy (GoaRealmCommon *object)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "LoginPolicy");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static const gchar *const *
goa_realm_common_proxy_get_permitted_logins (GoaRealmCommon *object)
{
  GoaRealmCommonProxy *proxy = GOA_REALM_COMMON_PROXY (object);
  GVariant *variant;
  const gchar *const *value = NULL;
  value = g_datalist_get_data (&proxy->priv->qdata, "PermittedLogins");
  if (value != NULL)
    return value;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "PermittedLogins");
  if (variant != NULL)
    {
      value = g_variant_get_strv (variant, NULL);
      g_datalist_set_data_full (&proxy->priv->qdata, "PermittedLogins", (gpointer) value, g_free);
      g_variant_unref (variant);
    }
  return value;
}

static void
goa_realm_common_proxy_init (GoaRealmCommonProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = goa_realm_common_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GOA_REALM_TYPE_COMMON_PROXY, GoaRealmCommonProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), goa_realm_common_interface_info ());
}

static void
goa_realm_common_proxy_class_init (GoaRealmCommonProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = goa_realm_common_proxy_finalize;
  gobject_class->get_property = goa_realm_common_proxy_get_property;
  gobject_class->set_property = goa_realm_common_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = goa_realm_common_proxy_g_signal;
  proxy_class->g_properties_changed = goa_realm_common_proxy_g_properties_changed;

  goa_realm_common_override_properties (gobject_class, 1);

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmCommonProxyPrivate));
#endif
}

static void
goa_realm_common_proxy_iface_init (GoaRealmCommonIface *iface)
{
  iface->get_name = goa_realm_common_proxy_get_name;
  iface->get_configured = goa_realm_common_proxy_get_configured;
  iface->get_supported_interfaces = goa_realm_common_proxy_get_supported_interfaces;
  iface->get_details = goa_realm_common_proxy_get_details;
  iface->get_login_formats = goa_realm_common_proxy_get_login_formats;
  iface->get_login_policy = goa_realm_common_proxy_get_login_policy;
  iface->get_permitted_logins = goa_realm_common_proxy_get_permitted_logins;
}

/**
 * goa_realm_common_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_common_proxy_new_finish() to get the result of the operation.
 *
 * See goa_realm_common_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_common_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_COMMON_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Realm", NULL);
}

/**
 * goa_realm_common_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_common_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_common_proxy_new().
 *
 * Returns: (transfer full) (type GoaRealmCommonProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmCommon *
goa_realm_common_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_COMMON (ret);
  else
    return NULL;
}

/**
 * goa_realm_common_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_common_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmCommonProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmCommon *
goa_realm_common_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_COMMON_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Realm", NULL);
  if (ret != NULL)
    return GOA_REALM_COMMON (ret);
  else
    return NULL;
}


/**
 * goa_realm_common_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like goa_realm_common_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_common_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See goa_realm_common_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_common_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_COMMON_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Realm", NULL);
}

/**
 * goa_realm_common_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_common_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_common_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type GoaRealmCommonProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmCommon *
goa_realm_common_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_COMMON (ret);
  else
    return NULL;
}

/**
 * goa_realm_common_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like goa_realm_common_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_common_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmCommonProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmCommon *
goa_realm_common_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_COMMON_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Realm", NULL);
  if (ret != NULL)
    return GOA_REALM_COMMON (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * GoaRealmCommonSkeleton:
 *
 * The #GoaRealmCommonSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmCommonSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmCommonSkeleton.
 */

struct _GoaRealmCommonSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_goa_realm_common_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  guint num_extra;
  gsize n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], GOA_REALM_TYPE_COMMON);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_COMMON);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_goa_realm_common_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_common_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_goa_realm_common_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_common_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _goa_realm_common_skeleton_vtable =
{
  _goa_realm_common_skeleton_handle_method_call,
  _goa_realm_common_skeleton_handle_get_property,
  _goa_realm_common_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
goa_realm_common_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return goa_realm_common_interface_info ();
}

static GDBusInterfaceVTable *
goa_realm_common_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_goa_realm_common_skeleton_vtable;
}

static GVariant *
goa_realm_common_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_goa_realm_common_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _goa_realm_common_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _goa_realm_common_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _goa_realm_common_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.realmd.Realm", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static gboolean _goa_realm_common_emit_changed (gpointer user_data);

static void
goa_realm_common_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (_skeleton);
  gboolean emit_changed = FALSE;

  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    {
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
      skeleton->priv->changed_properties_idle_source = NULL;
      emit_changed = TRUE;
    }
  g_mutex_unlock (&skeleton->priv->lock);

  if (emit_changed)
    _goa_realm_common_emit_changed (skeleton);
}

static void goa_realm_common_skeleton_iface_init (GoaRealmCommonIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmCommonSkeleton, goa_realm_common_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (GoaRealmCommonSkeleton)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_COMMON, goa_realm_common_skeleton_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmCommonSkeleton, goa_realm_common_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_COMMON, goa_realm_common_skeleton_iface_init))

#endif
static void
goa_realm_common_skeleton_finalize (GObject *object)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  guint n;
  for (n = 0; n < 7; n++)
    g_value_unset (&skeleton->priv->properties[n]);
  g_free (skeleton->priv->properties);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (goa_realm_common_skeleton_parent_class)->finalize (object);
}

static void
goa_realm_common_skeleton_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 7);
  g_mutex_lock (&skeleton->priv->lock);
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
  g_mutex_unlock (&skeleton->priv->lock);
}

static gboolean
_goa_realm_common_emit_changed (gpointer user_data)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (user_data);
  GList *l;
  GVariantBuilder builder;
  GVariantBuilder invalidated_builder;
  guint num_changes;

  g_mutex_lock (&skeleton->priv->lock);
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
    {
      ChangedProperty *cp = l->data;
      GVariant *variant;
      const GValue *cur_value;

      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
      if (!_g_value_equal (cur_value, &cp->orig_value))
        {
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
          g_variant_unref (variant);
          num_changes++;
        }
    }
  if (num_changes > 0)
    {
      GList *connections, *ll;
      GVariant *signal_variant;
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.realmd.Realm",
                                           &builder, &invalidated_builder));
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
      for (ll = connections; ll != NULL; ll = ll->next)
        {
          GDBusConnection *connection = ll->data;

          g_dbus_connection_emit_signal (connection,
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
                                         "org.freedesktop.DBus.Properties",
                                         "PropertiesChanged",
                                         signal_variant,
                                         NULL);
        }
      g_variant_unref (signal_variant);
      g_list_free_full (connections, g_object_unref);
    }
  else
    {
      g_variant_builder_clear (&builder);
      g_variant_builder_clear (&invalidated_builder);
    }
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  skeleton->priv->changed_properties = NULL;
  skeleton->priv->changed_properties_idle_source = NULL;
  g_mutex_unlock (&skeleton->priv->lock);
  return FALSE;
}

static void
_goa_realm_common_schedule_emit_changed (GoaRealmCommonSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
{
  ChangedProperty *cp;
  GList *l;
  cp = NULL;
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
    {
      ChangedProperty *i_cp = l->data;
      if (i_cp->info == info)
        {
          cp = i_cp;
          break;
        }
    }
  if (cp == NULL)
    {
      cp = g_new0 (ChangedProperty, 1);
      cp->prop_id = prop_id;
      cp->info = info;
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
      g_value_copy (orig_value, &cp->orig_value);
    }
}

static void
goa_realm_common_skeleton_notify (GObject      *object,
  GParamSpec *pspec G_GNUC_UNUSED)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties != NULL &&
      skeleton->priv->changed_properties_idle_source == NULL)
    {
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _goa_realm_common_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _goa_realm_common_emit_changed");
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
      g_source_unref (skeleton->priv->changed_properties_idle_source);
    }
  g_mutex_unlock (&skeleton->priv->lock);
}

static void
goa_realm_common_skeleton_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 7);
  g_mutex_lock (&skeleton->priv->lock);
  g_object_freeze_notify (object);
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
    {
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
        _goa_realm_common_schedule_emit_changed (skeleton, _goa_realm_common_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
      g_object_notify_by_pspec (object, pspec);
    }
  g_mutex_unlock (&skeleton->priv->lock);
  g_object_thaw_notify (object);
}

static void
goa_realm_common_skeleton_init (GoaRealmCommonSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = goa_realm_common_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GOA_REALM_TYPE_COMMON_SKELETON, GoaRealmCommonSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
  skeleton->priv->properties = g_new0 (GValue, 7);
  g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
  g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
  g_value_init (&skeleton->priv->properties[2], G_TYPE_STRV);
  g_value_init (&skeleton->priv->properties[3], G_TYPE_VARIANT);
  g_value_init (&skeleton->priv->properties[4], G_TYPE_STRV);
  g_value_init (&skeleton->priv->properties[5], G_TYPE_STRING);
  g_value_init (&skeleton->priv->properties[6], G_TYPE_STRV);
}

static const gchar *
goa_realm_common_skeleton_get_name (GoaRealmCommon *object)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_string (&(skeleton->priv->properties[0]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *
goa_realm_common_skeleton_get_configured (GoaRealmCommon *object)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_string (&(skeleton->priv->properties[1]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *const *
goa_realm_common_skeleton_get_supported_interfaces (GoaRealmCommon *object)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  const gchar *const *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_boxed (&(skeleton->priv->properties[2]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static GVariant *
goa_realm_common_skeleton_get_details (GoaRealmCommon *object)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  GVariant *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_variant (&(skeleton->priv->properties[3]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *const *
goa_realm_common_skeleton_get_login_formats (GoaRealmCommon *object)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  const gchar *const *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_boxed (&(skeleton->priv->properties[4]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *
goa_realm_common_skeleton_get_login_policy (GoaRealmCommon *object)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_string (&(skeleton->priv->properties[5]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *const *
goa_realm_common_skeleton_get_permitted_logins (GoaRealmCommon *object)
{
  GoaRealmCommonSkeleton *skeleton = GOA_REALM_COMMON_SKELETON (object);
  const gchar *const *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_boxed (&(skeleton->priv->properties[6]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static void
goa_realm_common_skeleton_class_init (GoaRealmCommonSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = goa_realm_common_skeleton_finalize;
  gobject_class->get_property = goa_realm_common_skeleton_get_property;
  gobject_class->set_property = goa_realm_common_skeleton_set_property;
  gobject_class->notify       = goa_realm_common_skeleton_notify;


  goa_realm_common_override_properties (gobject_class, 1);

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = goa_realm_common_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = goa_realm_common_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = goa_realm_common_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = goa_realm_common_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmCommonSkeletonPrivate));
#endif
}

static void
goa_realm_common_skeleton_iface_init (GoaRealmCommonIface *iface)
{
  iface->get_name = goa_realm_common_skeleton_get_name;
  iface->get_configured = goa_realm_common_skeleton_get_configured;
  iface->get_supported_interfaces = goa_realm_common_skeleton_get_supported_interfaces;
  iface->get_details = goa_realm_common_skeleton_get_details;
  iface->get_login_formats = goa_realm_common_skeleton_get_login_formats;
  iface->get_login_policy = goa_realm_common_skeleton_get_login_policy;
  iface->get_permitted_logins = goa_realm_common_skeleton_get_permitted_logins;
}

/**
 * goa_realm_common_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link>.
 *
 * Returns: (transfer full) (type GoaRealmCommonSkeleton): The skeleton object.
 */
GoaRealmCommon *
goa_realm_common_skeleton_new (void)
{
  return GOA_REALM_COMMON (g_object_new (GOA_REALM_TYPE_COMMON_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.realmd.Kerberos
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GoaRealmKerberos
 * @title: GoaRealmKerberos
 * @short_description: Generated C code for the org.freedesktop.realmd.Kerberos D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.realmd.Kerberos ---- */

static const _ExtendedGDBusPropertyInfo _goa_realm_kerberos_property_info_realm_name =
{
  {
    -1,
    (gchar *) "RealmName",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "realm-name",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_kerberos_property_info_domain_name =
{
  {
    -1,
    (gchar *) "DomainName",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "domain-name",
  FALSE
};

static const _ExtendedGDBusPropertyInfo * const _goa_realm_kerberos_property_info_pointers[] =
{
  &_goa_realm_kerberos_property_info_realm_name,
  &_goa_realm_kerberos_property_info_domain_name,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _goa_realm_kerberos_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.realmd.Kerberos",
    NULL,
    NULL,
    (GDBusPropertyInfo **) &_goa_realm_kerberos_property_info_pointers,
    NULL
  },
  "kerberos",
};


/**
 * goa_realm_kerberos_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
goa_realm_kerberos_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_goa_realm_kerberos_interface_info.parent_struct;
}

/**
 * goa_realm_kerberos_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #GoaRealmKerberos interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
goa_realm_kerberos_override_properties (GObjectClass *klass, guint property_id_begin)
{
  g_object_class_override_property (klass, property_id_begin++, "realm-name");
  g_object_class_override_property (klass, property_id_begin++, "domain-name");
  return property_id_begin - 1;
}



/**
 * GoaRealmKerberos:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link>.
 */

/**
 * GoaRealmKerberosIface:
 * @parent_iface: The parent interface.
 * @get_domain_name: Getter for the #GoaRealmKerberos:domain-name property.
 * @get_realm_name: Getter for the #GoaRealmKerberos:realm-name property.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link>.
 */

typedef GoaRealmKerberosIface GoaRealmKerberosInterface;
G_DEFINE_INTERFACE (GoaRealmKerberos, goa_realm_kerberos, G_TYPE_OBJECT)

static void
goa_realm_kerberos_default_init (GoaRealmKerberosIface *iface)
{
  /* GObject properties for D-Bus properties: */
  /**
   * GoaRealmKerberos:realm-name:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Kerberos.RealmName">"RealmName"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_string ("realm-name", "RealmName", "RealmName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmKerberos:domain-name:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-Kerberos.DomainName">"DomainName"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_string ("domain-name", "DomainName", "DomainName", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

/**
 * goa_realm_kerberos_get_realm_name: (skip)
 * @object: A #GoaRealmKerberos.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Kerberos.RealmName">"RealmName"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_kerberos_dup_realm_name() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
goa_realm_kerberos_get_realm_name (GoaRealmKerberos *object)
{
  return GOA_REALM_KERBEROS_GET_IFACE (object)->get_realm_name (object);
}

/**
 * goa_realm_kerberos_dup_realm_name: (skip)
 * @object: A #GoaRealmKerberos.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Kerberos.RealmName">"RealmName"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
goa_realm_kerberos_dup_realm_name (GoaRealmKerberos *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "realm-name", &value, NULL);
  return value;
}

/**
 * goa_realm_kerberos_set_realm_name: (skip)
 * @object: A #GoaRealmKerberos.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Kerberos.RealmName">"RealmName"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_kerberos_set_realm_name (GoaRealmKerberos *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "realm-name", value, NULL);
}

/**
 * goa_realm_kerberos_get_domain_name: (skip)
 * @object: A #GoaRealmKerberos.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-Kerberos.DomainName">"DomainName"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_kerberos_dup_domain_name() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
goa_realm_kerberos_get_domain_name (GoaRealmKerberos *object)
{
  return GOA_REALM_KERBEROS_GET_IFACE (object)->get_domain_name (object);
}

/**
 * goa_realm_kerberos_dup_domain_name: (skip)
 * @object: A #GoaRealmKerberos.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-Kerberos.DomainName">"DomainName"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
goa_realm_kerberos_dup_domain_name (GoaRealmKerberos *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "domain-name", &value, NULL);
  return value;
}

/**
 * goa_realm_kerberos_set_domain_name: (skip)
 * @object: A #GoaRealmKerberos.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-Kerberos.DomainName">"DomainName"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_kerberos_set_domain_name (GoaRealmKerberos *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "domain-name", value, NULL);
}

/* ------------------------------------------------------------------------ */

/**
 * GoaRealmKerberosProxy:
 *
 * The #GoaRealmKerberosProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmKerberosProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmKerberosProxy.
 */

struct _GoaRealmKerberosProxyPrivate
{
  GData *qdata;
};

static void goa_realm_kerberos_proxy_iface_init (GoaRealmKerberosIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmKerberosProxy, goa_realm_kerberos_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (GoaRealmKerberosProxy)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_KERBEROS, goa_realm_kerberos_proxy_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmKerberosProxy, goa_realm_kerberos_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_KERBEROS, goa_realm_kerberos_proxy_iface_init))

#endif
static void
goa_realm_kerberos_proxy_finalize (GObject *object)
{
  GoaRealmKerberosProxy *proxy = GOA_REALM_KERBEROS_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (goa_realm_kerberos_proxy_parent_class)->finalize (object);
}

static void
goa_realm_kerberos_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < 2);
  info = _goa_realm_kerberos_property_info_pointers[prop_id - 1];
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
  if (info->use_gvariant)
    {
      g_value_set_variant (value, variant);
    }
  else
    {
      if (variant != NULL)
        g_dbus_gvariant_to_gvalue (variant, value);
    }
  if (variant != NULL)
    g_variant_unref (variant);
}

static void
goa_realm_kerberos_proxy_set_property_cb (GDBusProxy *proxy,
  GAsyncResult *res,
  gpointer      user_data)
{
  const _ExtendedGDBusPropertyInfo *info = user_data;
  GError *error;
  GVariant *_ret;
  error = NULL;
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
  if (!_ret)
    {
      g_warning ("Error setting property '%s' on interface org.freedesktop.realmd.Kerberos: %s (%s, %d)",
                 info->parent_struct.name, 
                 error->message, g_quark_to_string (error->domain), error->code);
      g_error_free (error);
    }
  else
    {
      g_variant_unref (_ret);
    }
}

static void
goa_realm_kerberos_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < 2);
  info = _goa_realm_kerberos_property_info_pointers[prop_id - 1];
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
  g_dbus_proxy_call (G_DBUS_PROXY (object),
    "org.freedesktop.DBus.Properties.Set",
    g_variant_new ("(ssv)", "org.freedesktop.realmd.Kerberos", info->parent_struct.name, variant),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    NULL, (GAsyncReadyCallback) goa_realm_kerberos_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
  g_variant_unref (variant);
}

static void
goa_realm_kerberos_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  gsize n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_goa_realm_kerberos_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], GOA_REALM_TYPE_KERBEROS);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_KERBEROS);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
goa_realm_kerberos_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  GoaRealmKerberosProxy *proxy = GOA_REALM_KERBEROS_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_kerberos_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_kerberos_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static const gchar *
goa_realm_kerberos_proxy_get_realm_name (GoaRealmKerberos *object)
{
  GoaRealmKerberosProxy *proxy = GOA_REALM_KERBEROS_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "RealmName");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static const gchar *
goa_realm_kerberos_proxy_get_domain_name (GoaRealmKerberos *object)
{
  GoaRealmKerberosProxy *proxy = GOA_REALM_KERBEROS_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "DomainName");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static void
goa_realm_kerberos_proxy_init (GoaRealmKerberosProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = goa_realm_kerberos_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GOA_REALM_TYPE_KERBEROS_PROXY, GoaRealmKerberosProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), goa_realm_kerberos_interface_info ());
}

static void
goa_realm_kerberos_proxy_class_init (GoaRealmKerberosProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = goa_realm_kerberos_proxy_finalize;
  gobject_class->get_property = goa_realm_kerberos_proxy_get_property;
  gobject_class->set_property = goa_realm_kerberos_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = goa_realm_kerberos_proxy_g_signal;
  proxy_class->g_properties_changed = goa_realm_kerberos_proxy_g_properties_changed;

  goa_realm_kerberos_override_properties (gobject_class, 1);

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmKerberosProxyPrivate));
#endif
}

static void
goa_realm_kerberos_proxy_iface_init (GoaRealmKerberosIface *iface)
{
  iface->get_realm_name = goa_realm_kerberos_proxy_get_realm_name;
  iface->get_domain_name = goa_realm_kerberos_proxy_get_domain_name;
}

/**
 * goa_realm_kerberos_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_kerberos_proxy_new_finish() to get the result of the operation.
 *
 * See goa_realm_kerberos_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_kerberos_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_KERBEROS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Kerberos", NULL);
}

/**
 * goa_realm_kerberos_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_kerberos_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_kerberos_proxy_new().
 *
 * Returns: (transfer full) (type GoaRealmKerberosProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmKerberos *
goa_realm_kerberos_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_KERBEROS (ret);
  else
    return NULL;
}

/**
 * goa_realm_kerberos_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_kerberos_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmKerberosProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmKerberos *
goa_realm_kerberos_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_KERBEROS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Kerberos", NULL);
  if (ret != NULL)
    return GOA_REALM_KERBEROS (ret);
  else
    return NULL;
}


/**
 * goa_realm_kerberos_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like goa_realm_kerberos_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_kerberos_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See goa_realm_kerberos_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_kerberos_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_KERBEROS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Kerberos", NULL);
}

/**
 * goa_realm_kerberos_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_kerberos_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_kerberos_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type GoaRealmKerberosProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmKerberos *
goa_realm_kerberos_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_KERBEROS (ret);
  else
    return NULL;
}

/**
 * goa_realm_kerberos_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like goa_realm_kerberos_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_kerberos_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmKerberosProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmKerberos *
goa_realm_kerberos_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_KERBEROS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.Kerberos", NULL);
  if (ret != NULL)
    return GOA_REALM_KERBEROS (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * GoaRealmKerberosSkeleton:
 *
 * The #GoaRealmKerberosSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmKerberosSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmKerberosSkeleton.
 */

struct _GoaRealmKerberosSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_goa_realm_kerberos_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  guint num_extra;
  gsize n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], GOA_REALM_TYPE_KERBEROS);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_KERBEROS);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_goa_realm_kerberos_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_kerberos_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_goa_realm_kerberos_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_kerberos_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _goa_realm_kerberos_skeleton_vtable =
{
  _goa_realm_kerberos_skeleton_handle_method_call,
  _goa_realm_kerberos_skeleton_handle_get_property,
  _goa_realm_kerberos_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
goa_realm_kerberos_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return goa_realm_kerberos_interface_info ();
}

static GDBusInterfaceVTable *
goa_realm_kerberos_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_goa_realm_kerberos_skeleton_vtable;
}

static GVariant *
goa_realm_kerberos_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_goa_realm_kerberos_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _goa_realm_kerberos_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _goa_realm_kerberos_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _goa_realm_kerberos_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.realmd.Kerberos", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static gboolean _goa_realm_kerberos_emit_changed (gpointer user_data);

static void
goa_realm_kerberos_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (_skeleton);
  gboolean emit_changed = FALSE;

  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    {
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
      skeleton->priv->changed_properties_idle_source = NULL;
      emit_changed = TRUE;
    }
  g_mutex_unlock (&skeleton->priv->lock);

  if (emit_changed)
    _goa_realm_kerberos_emit_changed (skeleton);
}

static void goa_realm_kerberos_skeleton_iface_init (GoaRealmKerberosIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmKerberosSkeleton, goa_realm_kerberos_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (GoaRealmKerberosSkeleton)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_KERBEROS, goa_realm_kerberos_skeleton_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmKerberosSkeleton, goa_realm_kerberos_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_KERBEROS, goa_realm_kerberos_skeleton_iface_init))

#endif
static void
goa_realm_kerberos_skeleton_finalize (GObject *object)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (object);
  guint n;
  for (n = 0; n < 2; n++)
    g_value_unset (&skeleton->priv->properties[n]);
  g_free (skeleton->priv->properties);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (goa_realm_kerberos_skeleton_parent_class)->finalize (object);
}

static void
goa_realm_kerberos_skeleton_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 2);
  g_mutex_lock (&skeleton->priv->lock);
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
  g_mutex_unlock (&skeleton->priv->lock);
}

static gboolean
_goa_realm_kerberos_emit_changed (gpointer user_data)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (user_data);
  GList *l;
  GVariantBuilder builder;
  GVariantBuilder invalidated_builder;
  guint num_changes;

  g_mutex_lock (&skeleton->priv->lock);
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
    {
      ChangedProperty *cp = l->data;
      GVariant *variant;
      const GValue *cur_value;

      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
      if (!_g_value_equal (cur_value, &cp->orig_value))
        {
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
          g_variant_unref (variant);
          num_changes++;
        }
    }
  if (num_changes > 0)
    {
      GList *connections, *ll;
      GVariant *signal_variant;
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.realmd.Kerberos",
                                           &builder, &invalidated_builder));
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
      for (ll = connections; ll != NULL; ll = ll->next)
        {
          GDBusConnection *connection = ll->data;

          g_dbus_connection_emit_signal (connection,
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
                                         "org.freedesktop.DBus.Properties",
                                         "PropertiesChanged",
                                         signal_variant,
                                         NULL);
        }
      g_variant_unref (signal_variant);
      g_list_free_full (connections, g_object_unref);
    }
  else
    {
      g_variant_builder_clear (&builder);
      g_variant_builder_clear (&invalidated_builder);
    }
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  skeleton->priv->changed_properties = NULL;
  skeleton->priv->changed_properties_idle_source = NULL;
  g_mutex_unlock (&skeleton->priv->lock);
  return FALSE;
}

static void
_goa_realm_kerberos_schedule_emit_changed (GoaRealmKerberosSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
{
  ChangedProperty *cp;
  GList *l;
  cp = NULL;
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
    {
      ChangedProperty *i_cp = l->data;
      if (i_cp->info == info)
        {
          cp = i_cp;
          break;
        }
    }
  if (cp == NULL)
    {
      cp = g_new0 (ChangedProperty, 1);
      cp->prop_id = prop_id;
      cp->info = info;
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
      g_value_copy (orig_value, &cp->orig_value);
    }
}

static void
goa_realm_kerberos_skeleton_notify (GObject      *object,
  GParamSpec *pspec G_GNUC_UNUSED)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (object);
  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties != NULL &&
      skeleton->priv->changed_properties_idle_source == NULL)
    {
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _goa_realm_kerberos_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _goa_realm_kerberos_emit_changed");
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
      g_source_unref (skeleton->priv->changed_properties_idle_source);
    }
  g_mutex_unlock (&skeleton->priv->lock);
}

static void
goa_realm_kerberos_skeleton_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 2);
  g_mutex_lock (&skeleton->priv->lock);
  g_object_freeze_notify (object);
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
    {
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
        _goa_realm_kerberos_schedule_emit_changed (skeleton, _goa_realm_kerberos_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
      g_object_notify_by_pspec (object, pspec);
    }
  g_mutex_unlock (&skeleton->priv->lock);
  g_object_thaw_notify (object);
}

static void
goa_realm_kerberos_skeleton_init (GoaRealmKerberosSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = goa_realm_kerberos_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GOA_REALM_TYPE_KERBEROS_SKELETON, GoaRealmKerberosSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
  skeleton->priv->properties = g_new0 (GValue, 2);
  g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
  g_value_init (&skeleton->priv->properties[1], G_TYPE_STRING);
}

static const gchar *
goa_realm_kerberos_skeleton_get_realm_name (GoaRealmKerberos *object)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_string (&(skeleton->priv->properties[0]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *
goa_realm_kerberos_skeleton_get_domain_name (GoaRealmKerberos *object)
{
  GoaRealmKerberosSkeleton *skeleton = GOA_REALM_KERBEROS_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_string (&(skeleton->priv->properties[1]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static void
goa_realm_kerberos_skeleton_class_init (GoaRealmKerberosSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = goa_realm_kerberos_skeleton_finalize;
  gobject_class->get_property = goa_realm_kerberos_skeleton_get_property;
  gobject_class->set_property = goa_realm_kerberos_skeleton_set_property;
  gobject_class->notify       = goa_realm_kerberos_skeleton_notify;


  goa_realm_kerberos_override_properties (gobject_class, 1);

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = goa_realm_kerberos_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = goa_realm_kerberos_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = goa_realm_kerberos_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = goa_realm_kerberos_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmKerberosSkeletonPrivate));
#endif
}

static void
goa_realm_kerberos_skeleton_iface_init (GoaRealmKerberosIface *iface)
{
  iface->get_realm_name = goa_realm_kerberos_skeleton_get_realm_name;
  iface->get_domain_name = goa_realm_kerberos_skeleton_get_domain_name;
}

/**
 * goa_realm_kerberos_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link>.
 *
 * Returns: (transfer full) (type GoaRealmKerberosSkeleton): The skeleton object.
 */
GoaRealmKerberos *
goa_realm_kerberos_skeleton_new (void)
{
  return GOA_REALM_KERBEROS (g_object_new (GOA_REALM_TYPE_KERBEROS_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.freedesktop.realmd.KerberosMembership
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GoaRealmKerberosMembership
 * @title: GoaRealmKerberosMembership
 * @short_description: Generated C code for the org.freedesktop.realmd.KerberosMembership D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.freedesktop.realmd.KerberosMembership ---- */

static const _ExtendedGDBusArgInfo _goa_realm_kerberos_membership_method_info_join_IN_ARG_credentials =
{
  {
    -1,
    (gchar *) "credentials",
    (gchar *) "(ssv)",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_kerberos_membership_method_info_join_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_kerberos_membership_method_info_join_IN_ARG_pointers[] =
{
  &_goa_realm_kerberos_membership_method_info_join_IN_ARG_credentials,
  &_goa_realm_kerberos_membership_method_info_join_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusMethodInfo _goa_realm_kerberos_membership_method_info_join =
{
  {
    -1,
    (gchar *) "Join",
    (GDBusArgInfo **) &_goa_realm_kerberos_membership_method_info_join_IN_ARG_pointers,
    NULL,
    NULL
  },
  "handle-join",
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_kerberos_membership_method_info_leave_IN_ARG_credentials =
{
  {
    -1,
    (gchar *) "credentials",
    (gchar *) "(ssv)",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo _goa_realm_kerberos_membership_method_info_leave_IN_ARG_options =
{
  {
    -1,
    (gchar *) "options",
    (gchar *) "a{sv}",
    NULL
  },
  FALSE
};

static const _ExtendedGDBusArgInfo * const _goa_realm_kerberos_membership_method_info_leave_IN_ARG_pointers[] =
{
  &_goa_realm_kerberos_membership_method_info_leave_IN_ARG_credentials,
  &_goa_realm_kerberos_membership_method_info_leave_IN_ARG_options,
  NULL
};

static const _ExtendedGDBusMethodInfo _goa_realm_kerberos_membership_method_info_leave =
{
  {
    -1,
    (gchar *) "Leave",
    (GDBusArgInfo **) &_goa_realm_kerberos_membership_method_info_leave_IN_ARG_pointers,
    NULL,
    NULL
  },
  "handle-leave",
  FALSE
};

static const _ExtendedGDBusMethodInfo * const _goa_realm_kerberos_membership_method_info_pointers[] =
{
  &_goa_realm_kerberos_membership_method_info_join,
  &_goa_realm_kerberos_membership_method_info_leave,
  NULL
};

static const _ExtendedGDBusPropertyInfo _goa_realm_kerberos_membership_property_info_suggested_administrator =
{
  {
    -1,
    (gchar *) "SuggestedAdministrator",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "suggested-administrator",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_kerberos_membership_property_info_supported_join_credentials =
{
  {
    -1,
    (gchar *) "SupportedJoinCredentials",
    (gchar *) "a(ss)",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "supported-join-credentials",
  FALSE
};

static const _ExtendedGDBusPropertyInfo _goa_realm_kerberos_membership_property_info_supported_leave_credentials =
{
  {
    -1,
    (gchar *) "SupportedLeaveCredentials",
    (gchar *) "a(ss)",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "supported-leave-credentials",
  FALSE
};

static const _ExtendedGDBusPropertyInfo * const _goa_realm_kerberos_membership_property_info_pointers[] =
{
  &_goa_realm_kerberos_membership_property_info_suggested_administrator,
  &_goa_realm_kerberos_membership_property_info_supported_join_credentials,
  &_goa_realm_kerberos_membership_property_info_supported_leave_credentials,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _goa_realm_kerberos_membership_interface_info =
{
  {
    -1,
    (gchar *) "org.freedesktop.realmd.KerberosMembership",
    (GDBusMethodInfo **) &_goa_realm_kerberos_membership_method_info_pointers,
    NULL,
    (GDBusPropertyInfo **) &_goa_realm_kerberos_membership_property_info_pointers,
    NULL
  },
  "kerberos-membership",
};


/**
 * goa_realm_kerberos_membership_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
goa_realm_kerberos_membership_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_goa_realm_kerberos_membership_interface_info.parent_struct;
}

/**
 * goa_realm_kerberos_membership_override_properties:
 * @klass: The class structure for a #GObject<!-- -->-derived class.
 * @property_id_begin: The property id to assign to the first overridden property.
 *
 * Overrides all #GObject properties in the #GoaRealmKerberosMembership interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
goa_realm_kerberos_membership_override_properties (GObjectClass *klass, guint property_id_begin)
{
  g_object_class_override_property (klass, property_id_begin++, "suggested-administrator");
  g_object_class_override_property (klass, property_id_begin++, "supported-join-credentials");
  g_object_class_override_property (klass, property_id_begin++, "supported-leave-credentials");
  return property_id_begin - 1;
}



/**
 * GoaRealmKerberosMembership:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link>.
 */

/**
 * GoaRealmKerberosMembershipIface:
 * @parent_iface: The parent interface.
 * @handle_join: Handler for the #GoaRealmKerberosMembership::handle-join signal.
 * @handle_leave: Handler for the #GoaRealmKerberosMembership::handle-leave signal.
 * @get_suggested_administrator: Getter for the #GoaRealmKerberosMembership:suggested-administrator property.
 * @get_supported_join_credentials: Getter for the #GoaRealmKerberosMembership:supported-join-credentials property.
 * @get_supported_leave_credentials: Getter for the #GoaRealmKerberosMembership:supported-leave-credentials property.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link>.
 */

typedef GoaRealmKerberosMembershipIface GoaRealmKerberosMembershipInterface;
G_DEFINE_INTERFACE (GoaRealmKerberosMembership, goa_realm_kerberos_membership, G_TYPE_OBJECT)

static void
goa_realm_kerberos_membership_default_init (GoaRealmKerberosMembershipIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * GoaRealmKerberosMembership::handle-join:
   * @object: A #GoaRealmKerberosMembership.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_credentials: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-realmd-KerberosMembership.Join">Join()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call goa_realm_kerberos_membership_complete_join() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-join",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmKerberosMembershipIface, handle_join),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    3,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);

  /**
   * GoaRealmKerberosMembership::handle-leave:
   * @object: A #GoaRealmKerberosMembership.
   * @invocation: A #GDBusMethodInvocation.
   * @arg_credentials: Argument passed by remote caller.
   * @arg_options: Argument passed by remote caller.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-freedesktop-realmd-KerberosMembership.Leave">Leave()</link> D-Bus method.
   *
   * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call goa_realm_kerberos_membership_complete_leave() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-leave",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GoaRealmKerberosMembershipIface, handle_leave),
    g_signal_accumulator_true_handled,
    NULL,
    g_cclosure_marshal_generic,
    G_TYPE_BOOLEAN,
    3,
    G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);

  /* GObject properties for D-Bus properties: */
  /**
   * GoaRealmKerberosMembership:suggested-administrator:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SuggestedAdministrator">"SuggestedAdministrator"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_string ("suggested-administrator", "SuggestedAdministrator", "SuggestedAdministrator", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmKerberosMembership:supported-join-credentials:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SupportedJoinCredentials">"SupportedJoinCredentials"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_variant ("supported-join-credentials", "SupportedJoinCredentials", "SupportedJoinCredentials", G_VARIANT_TYPE ("a(ss)"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GoaRealmKerberosMembership:supported-leave-credentials:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SupportedLeaveCredentials">"SupportedLeaveCredentials"</link>.
   *
   * Since the D-Bus property for this #GObject property is readable but not writable, it is meaningful to read from it on both the client- and service-side. It is only meaningful, however, to write to it on the service-side.
   */
  g_object_interface_install_property (iface,
    g_param_spec_variant ("supported-leave-credentials", "SupportedLeaveCredentials", "SupportedLeaveCredentials", G_VARIANT_TYPE ("a(ss)"), NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

/**
 * goa_realm_kerberos_membership_get_suggested_administrator: (skip)
 * @object: A #GoaRealmKerberosMembership.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SuggestedAdministrator">"SuggestedAdministrator"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_kerberos_membership_dup_suggested_administrator() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
goa_realm_kerberos_membership_get_suggested_administrator (GoaRealmKerberosMembership *object)
{
  return GOA_REALM_KERBEROS_MEMBERSHIP_GET_IFACE (object)->get_suggested_administrator (object);
}

/**
 * goa_realm_kerberos_membership_dup_suggested_administrator: (skip)
 * @object: A #GoaRealmKerberosMembership.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SuggestedAdministrator">"SuggestedAdministrator"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
goa_realm_kerberos_membership_dup_suggested_administrator (GoaRealmKerberosMembership *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "suggested-administrator", &value, NULL);
  return value;
}

/**
 * goa_realm_kerberos_membership_set_suggested_administrator: (skip)
 * @object: A #GoaRealmKerberosMembership.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SuggestedAdministrator">"SuggestedAdministrator"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_kerberos_membership_set_suggested_administrator (GoaRealmKerberosMembership *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "suggested-administrator", value, NULL);
}

/**
 * goa_realm_kerberos_membership_get_supported_join_credentials: (skip)
 * @object: A #GoaRealmKerberosMembership.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SupportedJoinCredentials">"SupportedJoinCredentials"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_kerberos_membership_dup_supported_join_credentials() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
GVariant *
goa_realm_kerberos_membership_get_supported_join_credentials (GoaRealmKerberosMembership *object)
{
  return GOA_REALM_KERBEROS_MEMBERSHIP_GET_IFACE (object)->get_supported_join_credentials (object);
}

/**
 * goa_realm_kerberos_membership_dup_supported_join_credentials: (skip)
 * @object: A #GoaRealmKerberosMembership.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SupportedJoinCredentials">"SupportedJoinCredentials"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref().
 */
GVariant *
goa_realm_kerberos_membership_dup_supported_join_credentials (GoaRealmKerberosMembership *object)
{
  GVariant *value;
  g_object_get (G_OBJECT (object), "supported-join-credentials", &value, NULL);
  return value;
}

/**
 * goa_realm_kerberos_membership_set_supported_join_credentials: (skip)
 * @object: A #GoaRealmKerberosMembership.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SupportedJoinCredentials">"SupportedJoinCredentials"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_kerberos_membership_set_supported_join_credentials (GoaRealmKerberosMembership *object, GVariant *value)
{
  g_object_set (G_OBJECT (object), "supported-join-credentials", value, NULL);
}

/**
 * goa_realm_kerberos_membership_get_supported_leave_credentials: (skip)
 * @object: A #GoaRealmKerberosMembership.
 *
 * Gets the value of the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SupportedLeaveCredentials">"SupportedLeaveCredentials"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * <warning>The returned value is only valid until the property changes so on the client-side it is only safe to use this function on the thread where @object was constructed. Use goa_realm_kerberos_membership_dup_supported_leave_credentials() if on another thread.</warning>
 *
 * Returns: (transfer none): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
GVariant *
goa_realm_kerberos_membership_get_supported_leave_credentials (GoaRealmKerberosMembership *object)
{
  return GOA_REALM_KERBEROS_MEMBERSHIP_GET_IFACE (object)->get_supported_leave_credentials (object);
}

/**
 * goa_realm_kerberos_membership_dup_supported_leave_credentials: (skip)
 * @object: A #GoaRealmKerberosMembership.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SupportedLeaveCredentials">"SupportedLeaveCredentials"</link> D-Bus property.
 *
 * Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.
 *
 * Returns: (transfer full): The property value or %NULL if the property is not set. The returned value should be freed with g_variant_unref().
 */
GVariant *
goa_realm_kerberos_membership_dup_supported_leave_credentials (GoaRealmKerberosMembership *object)
{
  GVariant *value;
  g_object_get (G_OBJECT (object), "supported-leave-credentials", &value, NULL);
  return value;
}

/**
 * goa_realm_kerberos_membership_set_supported_leave_credentials: (skip)
 * @object: A #GoaRealmKerberosMembership.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-freedesktop-realmd-KerberosMembership.SupportedLeaveCredentials">"SupportedLeaveCredentials"</link> D-Bus property to @value.
 *
 * Since this D-Bus property is not writable, it is only meaningful to use this function on the service-side.
 */
void
goa_realm_kerberos_membership_set_supported_leave_credentials (GoaRealmKerberosMembership *object, GVariant *value)
{
  g_object_set (G_OBJECT (object), "supported-leave-credentials", value, NULL);
}

/**
 * goa_realm_kerberos_membership_call_join:
 * @proxy: A #GoaRealmKerberosMembershipProxy.
 * @arg_credentials: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-KerberosMembership.Join">Join()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_kerberos_membership_call_join_finish() to get the result of the operation.
 *
 * See goa_realm_kerberos_membership_call_join_sync() for the synchronous, blocking version of this method.
 */
void
goa_realm_kerberos_membership_call_join (
    GoaRealmKerberosMembership *proxy,
    GVariant *arg_credentials,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Join",
    g_variant_new ("(@(ssv)@a{sv})",
                   arg_credentials,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * goa_realm_kerberos_membership_call_join_finish:
 * @proxy: A #GoaRealmKerberosMembershipProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_kerberos_membership_call_join().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with goa_realm_kerberos_membership_call_join().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_kerberos_membership_call_join_finish (
    GoaRealmKerberosMembership *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_kerberos_membership_call_join_sync:
 * @proxy: A #GoaRealmKerberosMembershipProxy.
 * @arg_credentials: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-KerberosMembership.Join">Join()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See goa_realm_kerberos_membership_call_join() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_kerberos_membership_call_join_sync (
    GoaRealmKerberosMembership *proxy,
    GVariant *arg_credentials,
    GVariant *arg_options,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Join",
    g_variant_new ("(@(ssv)@a{sv})",
                   arg_credentials,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_kerberos_membership_call_leave:
 * @proxy: A #GoaRealmKerberosMembershipProxy.
 * @arg_credentials: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-KerberosMembership.Leave">Leave()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_kerberos_membership_call_leave_finish() to get the result of the operation.
 *
 * See goa_realm_kerberos_membership_call_leave_sync() for the synchronous, blocking version of this method.
 */
void
goa_realm_kerberos_membership_call_leave (
    GoaRealmKerberosMembership *proxy,
    GVariant *arg_credentials,
    GVariant *arg_options,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "Leave",
    g_variant_new ("(@(ssv)@a{sv})",
                   arg_credentials,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * goa_realm_kerberos_membership_call_leave_finish:
 * @proxy: A #GoaRealmKerberosMembershipProxy.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_kerberos_membership_call_leave().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with goa_realm_kerberos_membership_call_leave().
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_kerberos_membership_call_leave_finish (
    GoaRealmKerberosMembership *proxy,
    GAsyncResult *res,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_kerberos_membership_call_leave_sync:
 * @proxy: A #GoaRealmKerberosMembershipProxy.
 * @arg_credentials: Argument to pass with the method invocation.
 * @arg_options: Argument to pass with the method invocation.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-freedesktop-realmd-KerberosMembership.Leave">Leave()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See goa_realm_kerberos_membership_call_leave() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
 */
gboolean
goa_realm_kerberos_membership_call_leave_sync (
    GoaRealmKerberosMembership *proxy,
    GVariant *arg_credentials,
    GVariant *arg_options,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "Leave",
    g_variant_new ("(@(ssv)@a{sv})",
                   arg_credentials,
                   arg_options),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "()");
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * goa_realm_kerberos_membership_complete_join:
 * @object: A #GoaRealmKerberosMembership.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-realmd-KerberosMembership.Join">Join()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
goa_realm_kerberos_membership_complete_join (
    GoaRealmKerberosMembership *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/**
 * goa_realm_kerberos_membership_complete_leave:
 * @object: A #GoaRealmKerberosMembership.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-freedesktop-realmd-KerberosMembership.Leave">Leave()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
 *
 * This method will free @invocation, you cannot use it afterwards.
 */
void
goa_realm_kerberos_membership_complete_leave (
    GoaRealmKerberosMembership *object,
    GDBusMethodInvocation *invocation)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("()"));
}

/* ------------------------------------------------------------------------ */

/**
 * GoaRealmKerberosMembershipProxy:
 *
 * The #GoaRealmKerberosMembershipProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmKerberosMembershipProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmKerberosMembershipProxy.
 */

struct _GoaRealmKerberosMembershipProxyPrivate
{
  GData *qdata;
};

static void goa_realm_kerberos_membership_proxy_iface_init (GoaRealmKerberosMembershipIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmKerberosMembershipProxy, goa_realm_kerberos_membership_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (GoaRealmKerberosMembershipProxy)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP, goa_realm_kerberos_membership_proxy_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmKerberosMembershipProxy, goa_realm_kerberos_membership_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP, goa_realm_kerberos_membership_proxy_iface_init))

#endif
static void
goa_realm_kerberos_membership_proxy_finalize (GObject *object)
{
  GoaRealmKerberosMembershipProxy *proxy = GOA_REALM_KERBEROS_MEMBERSHIP_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (goa_realm_kerberos_membership_proxy_parent_class)->finalize (object);
}

static void
goa_realm_kerberos_membership_proxy_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < 3);
  info = _goa_realm_kerberos_membership_property_info_pointers[prop_id - 1];
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (object), info->parent_struct.name);
  if (info->use_gvariant)
    {
      g_value_set_variant (value, variant);
    }
  else
    {
      if (variant != NULL)
        g_dbus_gvariant_to_gvalue (variant, value);
    }
  if (variant != NULL)
    g_variant_unref (variant);
}

static void
goa_realm_kerberos_membership_proxy_set_property_cb (GDBusProxy *proxy,
  GAsyncResult *res,
  gpointer      user_data)
{
  const _ExtendedGDBusPropertyInfo *info = user_data;
  GError *error;
  GVariant *_ret;
  error = NULL;
  _ret = g_dbus_proxy_call_finish (proxy, res, &error);
  if (!_ret)
    {
      g_warning ("Error setting property '%s' on interface org.freedesktop.realmd.KerberosMembership: %s (%s, %d)",
                 info->parent_struct.name, 
                 error->message, g_quark_to_string (error->domain), error->code);
      g_error_free (error);
    }
  else
    {
      g_variant_unref (_ret);
    }
}

static void
goa_realm_kerberos_membership_proxy_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  const _ExtendedGDBusPropertyInfo *info;
  GVariant *variant;
  g_assert (prop_id != 0 && prop_id - 1 < 3);
  info = _goa_realm_kerberos_membership_property_info_pointers[prop_id - 1];
  variant = g_dbus_gvalue_to_gvariant (value, G_VARIANT_TYPE (info->parent_struct.signature));
  g_dbus_proxy_call (G_DBUS_PROXY (object),
    "org.freedesktop.DBus.Properties.Set",
    g_variant_new ("(ssv)", "org.freedesktop.realmd.KerberosMembership", info->parent_struct.name, variant),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    NULL, (GAsyncReadyCallback) goa_realm_kerberos_membership_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
  g_variant_unref (variant);
}

static void
goa_realm_kerberos_membership_proxy_g_signal (GDBusProxy *proxy,
  const gchar *sender_name G_GNUC_UNUSED,
  const gchar *signal_name,
  GVariant *parameters)
{
  _ExtendedGDBusSignalInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  gsize n;
  guint signal_id;
  info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_goa_realm_kerberos_membership_interface_info.parent_struct, signal_name);
  if (info == NULL)
    return;
  num_params = g_variant_n_children (parameters);
  paramv = g_new0 (GValue, num_params + 1);
  g_value_init (&paramv[0], GOA_REALM_TYPE_KERBEROS_MEMBERSHIP);
  g_value_set_object (&paramv[0], proxy);
  g_variant_iter_init (&iter, parameters);
  n = 1;
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_KERBEROS_MEMBERSHIP);
  g_signal_emitv (paramv, signal_id, 0, NULL);
  for (n = 0; n < num_params + 1; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static void
goa_realm_kerberos_membership_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  GoaRealmKerberosMembershipProxy *proxy = GOA_REALM_KERBEROS_MEMBERSHIP_PROXY (_proxy);
  guint n;
  const gchar *key;
  GVariantIter *iter;
  _ExtendedGDBusPropertyInfo *info;
  g_variant_get (changed_properties, "a{sv}", &iter);
  while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_kerberos_membership_interface_info.parent_struct, key);
      g_datalist_remove_data (&proxy->priv->qdata, key);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
  g_variant_iter_free (iter);
  for (n = 0; invalidated_properties[n] != NULL; n++)
    {
      info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_kerberos_membership_interface_info.parent_struct, invalidated_properties[n]);
      g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
      if (info != NULL)
        g_object_notify (G_OBJECT (proxy), info->hyphen_name);
    }
}

static const gchar *
goa_realm_kerberos_membership_proxy_get_suggested_administrator (GoaRealmKerberosMembership *object)
{
  GoaRealmKerberosMembershipProxy *proxy = GOA_REALM_KERBEROS_MEMBERSHIP_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "SuggestedAdministrator");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static GVariant *
goa_realm_kerberos_membership_proxy_get_supported_join_credentials (GoaRealmKerberosMembership *object)
{
  GoaRealmKerberosMembershipProxy *proxy = GOA_REALM_KERBEROS_MEMBERSHIP_PROXY (object);
  GVariant *variant;
  GVariant *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "SupportedJoinCredentials");
  value = variant;
  if (variant != NULL)
    g_variant_unref (variant);
  return value;
}

static GVariant *
goa_realm_kerberos_membership_proxy_get_supported_leave_credentials (GoaRealmKerberosMembership *object)
{
  GoaRealmKerberosMembershipProxy *proxy = GOA_REALM_KERBEROS_MEMBERSHIP_PROXY (object);
  GVariant *variant;
  GVariant *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "SupportedLeaveCredentials");
  value = variant;
  if (variant != NULL)
    g_variant_unref (variant);
  return value;
}

static void
goa_realm_kerberos_membership_proxy_init (GoaRealmKerberosMembershipProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = goa_realm_kerberos_membership_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GOA_REALM_TYPE_KERBEROS_MEMBERSHIP_PROXY, GoaRealmKerberosMembershipProxyPrivate);
#endif

  g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), goa_realm_kerberos_membership_interface_info ());
}

static void
goa_realm_kerberos_membership_proxy_class_init (GoaRealmKerberosMembershipProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = goa_realm_kerberos_membership_proxy_finalize;
  gobject_class->get_property = goa_realm_kerberos_membership_proxy_get_property;
  gobject_class->set_property = goa_realm_kerberos_membership_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = goa_realm_kerberos_membership_proxy_g_signal;
  proxy_class->g_properties_changed = goa_realm_kerberos_membership_proxy_g_properties_changed;

  goa_realm_kerberos_membership_override_properties (gobject_class, 1);

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmKerberosMembershipProxyPrivate));
#endif
}

static void
goa_realm_kerberos_membership_proxy_iface_init (GoaRealmKerberosMembershipIface *iface)
{
  iface->get_suggested_administrator = goa_realm_kerberos_membership_proxy_get_suggested_administrator;
  iface->get_supported_join_credentials = goa_realm_kerberos_membership_proxy_get_supported_join_credentials;
  iface->get_supported_leave_credentials = goa_realm_kerberos_membership_proxy_get_supported_leave_credentials;
}

/**
 * goa_realm_kerberos_membership_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_kerberos_membership_proxy_new_finish() to get the result of the operation.
 *
 * See goa_realm_kerberos_membership_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_kerberos_membership_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.KerberosMembership", NULL);
}

/**
 * goa_realm_kerberos_membership_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_kerberos_membership_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_kerberos_membership_proxy_new().
 *
 * Returns: (transfer full) (type GoaRealmKerberosMembershipProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmKerberosMembership *
goa_realm_kerberos_membership_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_KERBEROS_MEMBERSHIP (ret);
  else
    return NULL;
}

/**
 * goa_realm_kerberos_membership_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_kerberos_membership_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmKerberosMembershipProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmKerberosMembership *
goa_realm_kerberos_membership_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.KerberosMembership", NULL);
  if (ret != NULL)
    return GOA_REALM_KERBEROS_MEMBERSHIP (ret);
  else
    return NULL;
}


/**
 * goa_realm_kerberos_membership_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like goa_realm_kerberos_membership_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_kerberos_membership_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See goa_realm_kerberos_membership_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_kerberos_membership_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.KerberosMembership", NULL);
}

/**
 * goa_realm_kerberos_membership_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_kerberos_membership_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_kerberos_membership_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type GoaRealmKerberosMembershipProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmKerberosMembership *
goa_realm_kerberos_membership_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return GOA_REALM_KERBEROS_MEMBERSHIP (ret);
  else
    return NULL;
}

/**
 * goa_realm_kerberos_membership_proxy_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like goa_realm_kerberos_membership_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_kerberos_membership_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmKerberosMembershipProxy): The constructed proxy object or %NULL if @error is set.
 */
GoaRealmKerberosMembership *
goa_realm_kerberos_membership_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.freedesktop.realmd.KerberosMembership", NULL);
  if (ret != NULL)
    return GOA_REALM_KERBEROS_MEMBERSHIP (ret);
  else
    return NULL;
}


/* ------------------------------------------------------------------------ */

/**
 * GoaRealmKerberosMembershipSkeleton:
 *
 * The #GoaRealmKerberosMembershipSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmKerberosMembershipSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmKerberosMembershipSkeleton.
 */

struct _GoaRealmKerberosMembershipSkeletonPrivate
{
  GValue *properties;
  GList *changed_properties;
  GSource *changed_properties_idle_source;
  GMainContext *context;
  GMutex lock;
};

static void
_goa_realm_kerberos_membership_skeleton_handle_method_call (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name,
  const gchar *method_name,
  GVariant *parameters,
  GDBusMethodInvocation *invocation,
  gpointer user_data)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (user_data);
  _ExtendedGDBusMethodInfo *info;
  GVariantIter iter;
  GVariant *child;
  GValue *paramv;
  gsize num_params;
  guint num_extra;
  gsize n;
  guint signal_id;
  GValue return_value = G_VALUE_INIT;
  info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
  g_assert (info != NULL);
  num_params = g_variant_n_children (parameters);
  num_extra = info->pass_fdlist ? 3 : 2;  paramv = g_new0 (GValue, num_params + num_extra);
  n = 0;
  g_value_init (&paramv[n], GOA_REALM_TYPE_KERBEROS_MEMBERSHIP);
  g_value_set_object (&paramv[n++], skeleton);
  g_value_init (&paramv[n], G_TYPE_DBUS_METHOD_INVOCATION);
  g_value_set_object (&paramv[n++], invocation);
  if (info->pass_fdlist)
    {
#ifdef G_OS_UNIX
      g_value_init (&paramv[n], G_TYPE_UNIX_FD_LIST);
      g_value_set_object (&paramv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
#else
      g_assert_not_reached ();
#endif
    }
  g_variant_iter_init (&iter, parameters);
  while ((child = g_variant_iter_next_value (&iter)) != NULL)
    {
      _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
      if (arg_info->use_gvariant)
        {
          g_value_init (&paramv[n], G_TYPE_VARIANT);
          g_value_set_variant (&paramv[n], child);
          n++;
        }
      else
        g_dbus_gvariant_to_gvalue (child, &paramv[n++]);
      g_variant_unref (child);
    }
  signal_id = g_signal_lookup (info->signal_name, GOA_REALM_TYPE_KERBEROS_MEMBERSHIP);
  g_value_init (&return_value, G_TYPE_BOOLEAN);
  g_signal_emitv (paramv, signal_id, 0, &return_value);
  if (!g_value_get_boolean (&return_value))
    g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
  g_value_unset (&return_value);
  for (n = 0; n < num_params + num_extra; n++)
    g_value_unset (&paramv[n]);
  g_free (paramv);
}

static GVariant *
_goa_realm_kerberos_membership_skeleton_handle_get_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GError **error,
  gpointer user_data)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  GVariant *ret;
  ret = NULL;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_kerberos_membership_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      g_value_init (&value, pspec->value_type);
      g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
      g_value_unset (&value);
    }
  return ret;
}

static gboolean
_goa_realm_kerberos_membership_skeleton_handle_set_property (
  GDBusConnection *connection G_GNUC_UNUSED,
  const gchar *sender G_GNUC_UNUSED,
  const gchar *object_path G_GNUC_UNUSED,
  const gchar *interface_name G_GNUC_UNUSED,
  const gchar *property_name,
  GVariant *variant,
  GError **error,
  gpointer user_data)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (user_data);
  GValue value = G_VALUE_INIT;
  GParamSpec *pspec;
  _ExtendedGDBusPropertyInfo *info;
  gboolean ret;
  ret = FALSE;
  info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_goa_realm_kerberos_membership_interface_info.parent_struct, property_name);
  g_assert (info != NULL);
  pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
  if (pspec == NULL)
    {
      g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
    }
  else
    {
      if (info->use_gvariant)
        g_value_set_variant (&value, variant);
      else
        g_dbus_gvariant_to_gvalue (variant, &value);
      g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
      g_value_unset (&value);
      ret = TRUE;
    }
  return ret;
}

static const GDBusInterfaceVTable _goa_realm_kerberos_membership_skeleton_vtable =
{
  _goa_realm_kerberos_membership_skeleton_handle_method_call,
  _goa_realm_kerberos_membership_skeleton_handle_get_property,
  _goa_realm_kerberos_membership_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
goa_realm_kerberos_membership_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return goa_realm_kerberos_membership_interface_info ();
}

static GDBusInterfaceVTable *
goa_realm_kerberos_membership_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_goa_realm_kerberos_membership_skeleton_vtable;
}

static GVariant *
goa_realm_kerberos_membership_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  if (_goa_realm_kerberos_membership_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _goa_realm_kerberos_membership_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _goa_realm_kerberos_membership_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _goa_realm_kerberos_membership_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.freedesktop.realmd.KerberosMembership", info->name, NULL, skeleton);
          if (value != NULL)
            {
              g_variant_take_ref (value);
              g_variant_builder_add (&builder, "{sv}", info->name, value);
              g_variant_unref (value);
            }
        }
    }
out:
  return g_variant_builder_end (&builder);
}

static gboolean _goa_realm_kerberos_membership_emit_changed (gpointer user_data);

static void
goa_realm_kerberos_membership_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (_skeleton);
  gboolean emit_changed = FALSE;

  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    {
      g_source_destroy (skeleton->priv->changed_properties_idle_source);
      skeleton->priv->changed_properties_idle_source = NULL;
      emit_changed = TRUE;
    }
  g_mutex_unlock (&skeleton->priv->lock);

  if (emit_changed)
    _goa_realm_kerberos_membership_emit_changed (skeleton);
}

static void goa_realm_kerberos_membership_skeleton_iface_init (GoaRealmKerberosMembershipIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GoaRealmKerberosMembershipSkeleton, goa_realm_kerberos_membership_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (GoaRealmKerberosMembershipSkeleton)
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP, goa_realm_kerberos_membership_skeleton_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GoaRealmKerberosMembershipSkeleton, goa_realm_kerberos_membership_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP, goa_realm_kerberos_membership_skeleton_iface_init))

#endif
static void
goa_realm_kerberos_membership_skeleton_finalize (GObject *object)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (object);
  guint n;
  for (n = 0; n < 3; n++)
    g_value_unset (&skeleton->priv->properties[n]);
  g_free (skeleton->priv->properties);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (goa_realm_kerberos_membership_skeleton_parent_class)->finalize (object);
}

static void
goa_realm_kerberos_membership_skeleton_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 3);
  g_mutex_lock (&skeleton->priv->lock);
  g_value_copy (&skeleton->priv->properties[prop_id - 1], value);
  g_mutex_unlock (&skeleton->priv->lock);
}

static gboolean
_goa_realm_kerberos_membership_emit_changed (gpointer user_data)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (user_data);
  GList *l;
  GVariantBuilder builder;
  GVariantBuilder invalidated_builder;
  guint num_changes;

  g_mutex_lock (&skeleton->priv->lock);
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
  for (l = skeleton->priv->changed_properties, num_changes = 0; l != NULL; l = l->next)
    {
      ChangedProperty *cp = l->data;
      GVariant *variant;
      const GValue *cur_value;

      cur_value = &skeleton->priv->properties[cp->prop_id - 1];
      if (!_g_value_equal (cur_value, &cp->orig_value))
        {
          variant = g_dbus_gvalue_to_gvariant (cur_value, G_VARIANT_TYPE (cp->info->parent_struct.signature));
          g_variant_builder_add (&builder, "{sv}", cp->info->parent_struct.name, variant);
          g_variant_unref (variant);
          num_changes++;
        }
    }
  if (num_changes > 0)
    {
      GList *connections, *ll;
      GVariant *signal_variant;
      signal_variant = g_variant_ref_sink (g_variant_new ("(sa{sv}as)", "org.freedesktop.realmd.KerberosMembership",
                                           &builder, &invalidated_builder));
      connections = g_dbus_interface_skeleton_get_connections (G_DBUS_INTERFACE_SKELETON (skeleton));
      for (ll = connections; ll != NULL; ll = ll->next)
        {
          GDBusConnection *connection = ll->data;

          g_dbus_connection_emit_signal (connection,
                                         NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)),
                                         "org.freedesktop.DBus.Properties",
                                         "PropertiesChanged",
                                         signal_variant,
                                         NULL);
        }
      g_variant_unref (signal_variant);
      g_list_free_full (connections, g_object_unref);
    }
  else
    {
      g_variant_builder_clear (&builder);
      g_variant_builder_clear (&invalidated_builder);
    }
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
  skeleton->priv->changed_properties = NULL;
  skeleton->priv->changed_properties_idle_source = NULL;
  g_mutex_unlock (&skeleton->priv->lock);
  return FALSE;
}

static void
_goa_realm_kerberos_membership_schedule_emit_changed (GoaRealmKerberosMembershipSkeleton *skeleton, const _ExtendedGDBusPropertyInfo *info, guint prop_id, const GValue *orig_value)
{
  ChangedProperty *cp;
  GList *l;
  cp = NULL;
  for (l = skeleton->priv->changed_properties; l != NULL; l = l->next)
    {
      ChangedProperty *i_cp = l->data;
      if (i_cp->info == info)
        {
          cp = i_cp;
          break;
        }
    }
  if (cp == NULL)
    {
      cp = g_new0 (ChangedProperty, 1);
      cp->prop_id = prop_id;
      cp->info = info;
      skeleton->priv->changed_properties = g_list_prepend (skeleton->priv->changed_properties, cp);
      g_value_init (&cp->orig_value, G_VALUE_TYPE (orig_value));
      g_value_copy (orig_value, &cp->orig_value);
    }
}

static void
goa_realm_kerberos_membership_skeleton_notify (GObject      *object,
  GParamSpec *pspec G_GNUC_UNUSED)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (object);
  g_mutex_lock (&skeleton->priv->lock);
  if (skeleton->priv->changed_properties != NULL &&
      skeleton->priv->changed_properties_idle_source == NULL)
    {
      skeleton->priv->changed_properties_idle_source = g_idle_source_new ();
      g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);
      g_source_set_callback (skeleton->priv->changed_properties_idle_source, _goa_realm_kerberos_membership_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _goa_realm_kerberos_membership_emit_changed");
      g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);
      g_source_unref (skeleton->priv->changed_properties_idle_source);
    }
  g_mutex_unlock (&skeleton->priv->lock);
}

static void
goa_realm_kerberos_membership_skeleton_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 3);
  g_mutex_lock (&skeleton->priv->lock);
  g_object_freeze_notify (object);
  if (!_g_value_equal (value, &skeleton->priv->properties[prop_id - 1]))
    {
      if (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)) != NULL)
        _goa_realm_kerberos_membership_schedule_emit_changed (skeleton, _goa_realm_kerberos_membership_property_info_pointers[prop_id - 1], prop_id, &skeleton->priv->properties[prop_id - 1]);
      g_value_copy (value, &skeleton->priv->properties[prop_id - 1]);
      g_object_notify_by_pspec (object, pspec);
    }
  g_mutex_unlock (&skeleton->priv->lock);
  g_object_thaw_notify (object);
}

static void
goa_realm_kerberos_membership_skeleton_init (GoaRealmKerberosMembershipSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = goa_realm_kerberos_membership_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GOA_REALM_TYPE_KERBEROS_MEMBERSHIP_SKELETON, GoaRealmKerberosMembershipSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
  skeleton->priv->properties = g_new0 (GValue, 3);
  g_value_init (&skeleton->priv->properties[0], G_TYPE_STRING);
  g_value_init (&skeleton->priv->properties[1], G_TYPE_VARIANT);
  g_value_init (&skeleton->priv->properties[2], G_TYPE_VARIANT);
}

static const gchar *
goa_realm_kerberos_membership_skeleton_get_suggested_administrator (GoaRealmKerberosMembership *object)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_string (&(skeleton->priv->properties[0]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static GVariant *
goa_realm_kerberos_membership_skeleton_get_supported_join_credentials (GoaRealmKerberosMembership *object)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (object);
  GVariant *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_variant (&(skeleton->priv->properties[1]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static GVariant *
goa_realm_kerberos_membership_skeleton_get_supported_leave_credentials (GoaRealmKerberosMembership *object)
{
  GoaRealmKerberosMembershipSkeleton *skeleton = GOA_REALM_KERBEROS_MEMBERSHIP_SKELETON (object);
  GVariant *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_value_get_variant (&(skeleton->priv->properties[2]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static void
goa_realm_kerberos_membership_skeleton_class_init (GoaRealmKerberosMembershipSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = goa_realm_kerberos_membership_skeleton_finalize;
  gobject_class->get_property = goa_realm_kerberos_membership_skeleton_get_property;
  gobject_class->set_property = goa_realm_kerberos_membership_skeleton_set_property;
  gobject_class->notify       = goa_realm_kerberos_membership_skeleton_notify;


  goa_realm_kerberos_membership_override_properties (gobject_class, 1);

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = goa_realm_kerberos_membership_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = goa_realm_kerberos_membership_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = goa_realm_kerberos_membership_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = goa_realm_kerberos_membership_skeleton_dbus_interface_get_vtable;

#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
  g_type_class_add_private (klass, sizeof (GoaRealmKerberosMembershipSkeletonPrivate));
#endif
}

static void
goa_realm_kerberos_membership_skeleton_iface_init (GoaRealmKerberosMembershipIface *iface)
{
  iface->get_suggested_administrator = goa_realm_kerberos_membership_skeleton_get_suggested_administrator;
  iface->get_supported_join_credentials = goa_realm_kerberos_membership_skeleton_get_supported_join_credentials;
  iface->get_supported_leave_credentials = goa_realm_kerberos_membership_skeleton_get_supported_leave_credentials;
}

/**
 * goa_realm_kerberos_membership_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link>.
 *
 * Returns: (transfer full) (type GoaRealmKerberosMembershipSkeleton): The skeleton object.
 */
GoaRealmKerberosMembership *
goa_realm_kerberos_membership_skeleton_new (void)
{
  return GOA_REALM_KERBEROS_MEMBERSHIP (g_object_new (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for Object, ObjectProxy and ObjectSkeleton
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GoaRealmObject
 * @title: GoaRealmObject
 * @short_description: Specialized GDBusObject types
 *
 * This section contains the #GoaRealmObject, #GoaRealmObjectProxy, and #GoaRealmObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.
 */

/**
 * GoaRealmObject:
 *
 * The #GoaRealmObject type is a specialized container of interfaces.
 */

/**
 * GoaRealmObjectIface:
 * @parent_iface: The parent interface.
 *
 * Virtual table for the #GoaRealmObject interface.
 */

typedef GoaRealmObjectIface GoaRealmObjectInterface;
G_DEFINE_INTERFACE_WITH_CODE (GoaRealmObject, goa_realm_object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT);)

static void
goa_realm_object_default_init (GoaRealmObjectIface *iface)
{
  /**
   * GoaRealmObject:provider:
   *
   * The #GoaRealmProvider instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link>, if any.
   *
   * Connect to the #GObject::notify signal to get informed of property changes.
   */
  g_object_interface_install_property (iface, g_param_spec_object ("provider", "provider", "provider", GOA_REALM_TYPE_PROVIDER, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));

  /**
   * GoaRealmObject:service:
   *
   * The #GoaRealmService instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link>, if any.
   *
   * Connect to the #GObject::notify signal to get informed of property changes.
   */
  g_object_interface_install_property (iface, g_param_spec_object ("service", "service", "service", GOA_REALM_TYPE_SERVICE, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));

  /**
   * GoaRealmObject:common:
   *
   * The #GoaRealmCommon instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link>, if any.
   *
   * Connect to the #GObject::notify signal to get informed of property changes.
   */
  g_object_interface_install_property (iface, g_param_spec_object ("common", "common", "common", GOA_REALM_TYPE_COMMON, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));

  /**
   * GoaRealmObject:kerberos:
   *
   * The #GoaRealmKerberos instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link>, if any.
   *
   * Connect to the #GObject::notify signal to get informed of property changes.
   */
  g_object_interface_install_property (iface, g_param_spec_object ("kerberos", "kerberos", "kerberos", GOA_REALM_TYPE_KERBEROS, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));

  /**
   * GoaRealmObject:kerberos-membership:
   *
   * The #GoaRealmKerberosMembership instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link>, if any.
   *
   * Connect to the #GObject::notify signal to get informed of property changes.
   */
  g_object_interface_install_property (iface, g_param_spec_object ("kerberos-membership", "kerberos-membership", "kerberos-membership", GOA_REALM_TYPE_KERBEROS_MEMBERSHIP, G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));

}

/**
 * goa_realm_object_get_provider:
 * @object: A #GoaRealmObject.
 *
 * Gets the #GoaRealmProvider instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link> on @object, if any.
 *
 * Returns: (transfer full): A #GoaRealmProvider that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
 */
GoaRealmProvider *goa_realm_object_get_provider (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Provider");
  if (ret == NULL)
    return NULL;
  return GOA_REALM_PROVIDER (ret);
}

/**
 * goa_realm_object_get_service:
 * @object: A #GoaRealmObject.
 *
 * Gets the #GoaRealmService instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link> on @object, if any.
 *
 * Returns: (transfer full): A #GoaRealmService that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
 */
GoaRealmService *goa_realm_object_get_service (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Service");
  if (ret == NULL)
    return NULL;
  return GOA_REALM_SERVICE (ret);
}

/**
 * goa_realm_object_get_common:
 * @object: A #GoaRealmObject.
 *
 * Gets the #GoaRealmCommon instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link> on @object, if any.
 *
 * Returns: (transfer full): A #GoaRealmCommon that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
 */
GoaRealmCommon *goa_realm_object_get_common (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Realm");
  if (ret == NULL)
    return NULL;
  return GOA_REALM_COMMON (ret);
}

/**
 * goa_realm_object_get_kerberos:
 * @object: A #GoaRealmObject.
 *
 * Gets the #GoaRealmKerberos instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link> on @object, if any.
 *
 * Returns: (transfer full): A #GoaRealmKerberos that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
 */
GoaRealmKerberos *goa_realm_object_get_kerberos (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Kerberos");
  if (ret == NULL)
    return NULL;
  return GOA_REALM_KERBEROS (ret);
}

/**
 * goa_realm_object_get_kerberos_membership:
 * @object: A #GoaRealmObject.
 *
 * Gets the #GoaRealmKerberosMembership instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link> on @object, if any.
 *
 * Returns: (transfer full): A #GoaRealmKerberosMembership that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
 */
GoaRealmKerberosMembership *goa_realm_object_get_kerberos_membership (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.KerberosMembership");
  if (ret == NULL)
    return NULL;
  return GOA_REALM_KERBEROS_MEMBERSHIP (ret);
}


/**
 * goa_realm_object_peek_provider: (skip)
 * @object: A #GoaRealmObject.
 *
 * Like goa_realm_object_get_provider() but doesn't increase the reference count on the returned object.
 *
 * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
 *
 * Returns: (transfer none): A #GoaRealmProvider or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
 */
GoaRealmProvider *goa_realm_object_peek_provider (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Provider");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return GOA_REALM_PROVIDER (ret);
}

/**
 * goa_realm_object_peek_service: (skip)
 * @object: A #GoaRealmObject.
 *
 * Like goa_realm_object_get_service() but doesn't increase the reference count on the returned object.
 *
 * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
 *
 * Returns: (transfer none): A #GoaRealmService or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
 */
GoaRealmService *goa_realm_object_peek_service (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Service");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return GOA_REALM_SERVICE (ret);
}

/**
 * goa_realm_object_peek_common: (skip)
 * @object: A #GoaRealmObject.
 *
 * Like goa_realm_object_get_common() but doesn't increase the reference count on the returned object.
 *
 * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
 *
 * Returns: (transfer none): A #GoaRealmCommon or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
 */
GoaRealmCommon *goa_realm_object_peek_common (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Realm");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return GOA_REALM_COMMON (ret);
}

/**
 * goa_realm_object_peek_kerberos: (skip)
 * @object: A #GoaRealmObject.
 *
 * Like goa_realm_object_get_kerberos() but doesn't increase the reference count on the returned object.
 *
 * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
 *
 * Returns: (transfer none): A #GoaRealmKerberos or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
 */
GoaRealmKerberos *goa_realm_object_peek_kerberos (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Kerberos");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return GOA_REALM_KERBEROS (ret);
}

/**
 * goa_realm_object_peek_kerberos_membership: (skip)
 * @object: A #GoaRealmObject.
 *
 * Like goa_realm_object_get_kerberos_membership() but doesn't increase the reference count on the returned object.
 *
 * <warning>It is not safe to use the returned object if you are on another thread than the one where the #GDBusObjectManagerClient or #GDBusObjectManagerServer for @object is running.</warning>
 *
 * Returns: (transfer none): A #GoaRealmKerberosMembership or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
 */
GoaRealmKerberosMembership *goa_realm_object_peek_kerberos_membership (GoaRealmObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.KerberosMembership");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return GOA_REALM_KERBEROS_MEMBERSHIP (ret);
}


static void
goa_realm_object_notify (GDBusObject *object, GDBusInterface *interface)
{
  _ExtendedGDBusInterfaceInfo *info = (_ExtendedGDBusInterfaceInfo *) g_dbus_interface_get_info (interface);
  /* info can be NULL if the other end is using a D-Bus interface we don't know
   * anything about, for example old generated code in this process talking to
   * newer generated code in the other process. */
  if (info != NULL)
    g_object_notify (G_OBJECT (object), info->hyphen_name);
}

/**
 * GoaRealmObjectProxy:
 *
 * The #GoaRealmObjectProxy structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmObjectProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmObjectProxy.
 */

static void
goa_realm_object_proxy__goa_realm_object_iface_init (GoaRealmObjectIface *iface G_GNUC_UNUSED)
{
}

static void
goa_realm_object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
{
  iface->interface_added = goa_realm_object_notify;
  iface->interface_removed = goa_realm_object_notify;
}


G_DEFINE_TYPE_WITH_CODE (GoaRealmObjectProxy, goa_realm_object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_OBJECT, goa_realm_object_proxy__goa_realm_object_iface_init)
                         G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, goa_realm_object_proxy__g_dbus_object_iface_init))

static void
goa_realm_object_proxy_init (GoaRealmObjectProxy *object G_GNUC_UNUSED)
{
}

static void
goa_realm_object_proxy_set_property (GObject      *gobject,
  guint         prop_id,
  const GValue *value G_GNUC_UNUSED,
  GParamSpec   *pspec)
{
  G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}

static void
goa_realm_object_proxy_get_property (GObject      *gobject,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec)
{
  GoaRealmObjectProxy *object = GOA_REALM_OBJECT_PROXY (gobject);
  GDBusInterface *interface;

  switch (prop_id)
    {
    case 1:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Provider");
      g_value_take_object (value, interface);
      break;

    case 2:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Service");
      g_value_take_object (value, interface);
      break;

    case 3:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Realm");
      g_value_take_object (value, interface);
      break;

    case 4:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Kerberos");
      g_value_take_object (value, interface);
      break;

    case 5:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.KerberosMembership");
      g_value_take_object (value, interface);
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
      break;
  }
}

static void
goa_realm_object_proxy_class_init (GoaRealmObjectProxyClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

  gobject_class->set_property = goa_realm_object_proxy_set_property;
  gobject_class->get_property = goa_realm_object_proxy_get_property;

  g_object_class_override_property (gobject_class, 1, "provider");
  g_object_class_override_property (gobject_class, 2, "service");
  g_object_class_override_property (gobject_class, 3, "common");
  g_object_class_override_property (gobject_class, 4, "kerberos");
  g_object_class_override_property (gobject_class, 5, "kerberos-membership");
}

/**
 * goa_realm_object_proxy_new:
 * @connection: A #GDBusConnection.
 * @object_path: An object path.
 *
 * Creates a new proxy object.
 *
 * Returns: (transfer full): The proxy object.
 */
GoaRealmObjectProxy *
goa_realm_object_proxy_new (GDBusConnection *connection,
  const gchar *object_path)
{
  g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
  g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
  return GOA_REALM_OBJECT_PROXY (g_object_new (GOA_REALM_TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
}

/**
 * GoaRealmObjectSkeleton:
 *
 * The #GoaRealmObjectSkeleton structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmObjectSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmObjectSkeleton.
 */

static void
goa_realm_object_skeleton__goa_realm_object_iface_init (GoaRealmObjectIface *iface G_GNUC_UNUSED)
{
}


static void
goa_realm_object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
{
  iface->interface_added = goa_realm_object_notify;
  iface->interface_removed = goa_realm_object_notify;
}

G_DEFINE_TYPE_WITH_CODE (GoaRealmObjectSkeleton, goa_realm_object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
                         G_IMPLEMENT_INTERFACE (GOA_REALM_TYPE_OBJECT, goa_realm_object_skeleton__goa_realm_object_iface_init)
                         G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, goa_realm_object_skeleton__g_dbus_object_iface_init))

static void
goa_realm_object_skeleton_init (GoaRealmObjectSkeleton *object G_GNUC_UNUSED)
{
}

static void
goa_realm_object_skeleton_set_property (GObject      *gobject,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  GoaRealmObjectSkeleton *object = GOA_REALM_OBJECT_SKELETON (gobject);
  GDBusInterfaceSkeleton *interface;

  switch (prop_id)
    {
    case 1:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (GOA_REALM_IS_PROVIDER (interface));
          g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
        }
      else
        {
          g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.freedesktop.realmd.Provider");
        }
      break;

    case 2:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (GOA_REALM_IS_SERVICE (interface));
          g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
        }
      else
        {
          g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.freedesktop.realmd.Service");
        }
      break;

    case 3:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (GOA_REALM_IS_COMMON (interface));
          g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
        }
      else
        {
          g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.freedesktop.realmd.Realm");
        }
      break;

    case 4:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (GOA_REALM_IS_KERBEROS (interface));
          g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
        }
      else
        {
          g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.freedesktop.realmd.Kerberos");
        }
      break;

    case 5:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (GOA_REALM_IS_KERBEROS_MEMBERSHIP (interface));
          g_dbus_object_skeleton_add_interface (G_DBUS_OBJECT_SKELETON (object), interface);
        }
      else
        {
          g_dbus_object_skeleton_remove_interface_by_name (G_DBUS_OBJECT_SKELETON (object), "org.freedesktop.realmd.KerberosMembership");
        }
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
      break;
  }
}

static void
goa_realm_object_skeleton_get_property (GObject      *gobject,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec)
{
  GoaRealmObjectSkeleton *object = GOA_REALM_OBJECT_SKELETON (gobject);
  GDBusInterface *interface;

  switch (prop_id)
    {
    case 1:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Provider");
      g_value_take_object (value, interface);
      break;

    case 2:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Service");
      g_value_take_object (value, interface);
      break;

    case 3:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Realm");
      g_value_take_object (value, interface);
      break;

    case 4:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.Kerberos");
      g_value_take_object (value, interface);
      break;

    case 5:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.freedesktop.realmd.KerberosMembership");
      g_value_take_object (value, interface);
      break;

    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
      break;
  }
}

static void
goa_realm_object_skeleton_class_init (GoaRealmObjectSkeletonClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

  gobject_class->set_property = goa_realm_object_skeleton_set_property;
  gobject_class->get_property = goa_realm_object_skeleton_get_property;

  g_object_class_override_property (gobject_class, 1, "provider");
  g_object_class_override_property (gobject_class, 2, "service");
  g_object_class_override_property (gobject_class, 3, "common");
  g_object_class_override_property (gobject_class, 4, "kerberos");
  g_object_class_override_property (gobject_class, 5, "kerberos-membership");
}

/**
 * goa_realm_object_skeleton_new:
 * @object_path: An object path.
 *
 * Creates a new skeleton object.
 *
 * Returns: (transfer full): The skeleton object.
 */
GoaRealmObjectSkeleton *
goa_realm_object_skeleton_new (const gchar *object_path)
{
  g_return_val_if_fail (g_variant_is_object_path (object_path), NULL);
  return GOA_REALM_OBJECT_SKELETON (g_object_new (GOA_REALM_TYPE_OBJECT_SKELETON, "g-object-path", object_path, NULL));
}

/**
 * goa_realm_object_skeleton_set_provider:
 * @object: A #GoaRealmObjectSkeleton.
 * @interface_: (allow-none): A #GoaRealmProvider or %NULL to clear the interface.
 *
 * Sets the #GoaRealmProvider instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Provider.top_of_page">org.freedesktop.realmd.Provider</link> on @object.
 */
void goa_realm_object_skeleton_set_provider (GoaRealmObjectSkeleton *object, GoaRealmProvider *interface_)
{
  g_object_set (G_OBJECT (object), "provider", interface_, NULL);
}

/**
 * goa_realm_object_skeleton_set_service:
 * @object: A #GoaRealmObjectSkeleton.
 * @interface_: (allow-none): A #GoaRealmService or %NULL to clear the interface.
 *
 * Sets the #GoaRealmService instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Service.top_of_page">org.freedesktop.realmd.Service</link> on @object.
 */
void goa_realm_object_skeleton_set_service (GoaRealmObjectSkeleton *object, GoaRealmService *interface_)
{
  g_object_set (G_OBJECT (object), "service", interface_, NULL);
}

/**
 * goa_realm_object_skeleton_set_common:
 * @object: A #GoaRealmObjectSkeleton.
 * @interface_: (allow-none): A #GoaRealmCommon or %NULL to clear the interface.
 *
 * Sets the #GoaRealmCommon instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Realm.top_of_page">org.freedesktop.realmd.Realm</link> on @object.
 */
void goa_realm_object_skeleton_set_common (GoaRealmObjectSkeleton *object, GoaRealmCommon *interface_)
{
  g_object_set (G_OBJECT (object), "common", interface_, NULL);
}

/**
 * goa_realm_object_skeleton_set_kerberos:
 * @object: A #GoaRealmObjectSkeleton.
 * @interface_: (allow-none): A #GoaRealmKerberos or %NULL to clear the interface.
 *
 * Sets the #GoaRealmKerberos instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-Kerberos.top_of_page">org.freedesktop.realmd.Kerberos</link> on @object.
 */
void goa_realm_object_skeleton_set_kerberos (GoaRealmObjectSkeleton *object, GoaRealmKerberos *interface_)
{
  g_object_set (G_OBJECT (object), "kerberos", interface_, NULL);
}

/**
 * goa_realm_object_skeleton_set_kerberos_membership:
 * @object: A #GoaRealmObjectSkeleton.
 * @interface_: (allow-none): A #GoaRealmKerberosMembership or %NULL to clear the interface.
 *
 * Sets the #GoaRealmKerberosMembership instance for the D-Bus interface <link linkend="gdbus-interface-org-freedesktop-realmd-KerberosMembership.top_of_page">org.freedesktop.realmd.KerberosMembership</link> on @object.
 */
void goa_realm_object_skeleton_set_kerberos_membership (GoaRealmObjectSkeleton *object, GoaRealmKerberosMembership *interface_)
{
  g_object_set (G_OBJECT (object), "kerberos-membership", interface_, NULL);
}


/* ------------------------------------------------------------------------
 * Code for ObjectManager client
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GoaRealmObjectManagerClient
 * @title: GoaRealmObjectManagerClient
 * @short_description: Generated GDBusObjectManagerClient type
 *
 * This section contains a #GDBusObjectManagerClient that uses goa_realm_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc.
 */

/**
 * GoaRealmObjectManagerClient:
 *
 * The #GoaRealmObjectManagerClient structure contains only private data and should only be accessed using the provided API.
 */

/**
 * GoaRealmObjectManagerClientClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GoaRealmObjectManagerClient.
 */

G_DEFINE_TYPE (GoaRealmObjectManagerClient, goa_realm_object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT)

static void
goa_realm_object_manager_client_init (GoaRealmObjectManagerClient *manager G_GNUC_UNUSED)
{
}

static void
goa_realm_object_manager_client_class_init (GoaRealmObjectManagerClientClass *klass G_GNUC_UNUSED)
{
}

/**
 * goa_realm_object_manager_client_get_proxy_type:
 * @manager: A #GDBusObjectManagerClient.
 * @object_path: The object path of the remote object (unused).
 * @interface_name: (allow-none): Interface name of the remote object or %NULL to get the object proxy #GType.
 * @user_data: User data (unused).
 *
 * A #GDBusProxyTypeFunc that maps @interface_name to the generated #GDBusObjectProxy<!-- -->- and #GDBusProxy<!-- -->-derived types.
 *
 * Returns: A #GDBusProxy<!-- -->-derived #GType if @interface_name is not %NULL, otherwise the #GType for #GoaRealmObjectProxy.
 */
GType
goa_realm_object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager G_GNUC_UNUSED, const gchar *object_path G_GNUC_UNUSED, const gchar *interface_name, gpointer user_data G_GNUC_UNUSED)
{
  static gsize once_init_value = 0;
  static GHashTable *lookup_hash;
  GType ret;

  if (interface_name == NULL)
    return GOA_REALM_TYPE_OBJECT_PROXY;
  if (g_once_init_enter (&once_init_value))
    {
      lookup_hash = g_hash_table_new (g_str_hash, g_str_equal);
      g_hash_table_insert (lookup_hash, (gpointer) "org.freedesktop.realmd.Provider", GSIZE_TO_POINTER (GOA_REALM_TYPE_PROVIDER_PROXY));
      g_hash_table_insert (lookup_hash, (gpointer) "org.freedesktop.realmd.Service", GSIZE_TO_POINTER (GOA_REALM_TYPE_SERVICE_PROXY));
      g_hash_table_insert (lookup_hash, (gpointer) "org.freedesktop.realmd.Realm", GSIZE_TO_POINTER (GOA_REALM_TYPE_COMMON_PROXY));
      g_hash_table_insert (lookup_hash, (gpointer) "org.freedesktop.realmd.Kerberos", GSIZE_TO_POINTER (GOA_REALM_TYPE_KERBEROS_PROXY));
      g_hash_table_insert (lookup_hash, (gpointer) "org.freedesktop.realmd.KerberosMembership", GSIZE_TO_POINTER (GOA_REALM_TYPE_KERBEROS_MEMBERSHIP_PROXY));
      g_once_init_leave (&once_init_value, 1);
    }
  ret = (GType) GPOINTER_TO_SIZE (g_hash_table_lookup (lookup_hash, interface_name));
  if (ret == (GType) 0)
    ret = G_TYPE_DBUS_PROXY;
  return ret;
}

/**
 * goa_realm_object_manager_client_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates #GDBusObjectManagerClient using goa_realm_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_object_manager_client_new_finish() to get the result of the operation.
 *
 * See goa_realm_object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_object_manager_client_new (
    GDBusConnection        *connection,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GAsyncReadyCallback     callback,
    gpointer                user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", goa_realm_object_manager_client_get_proxy_type, NULL);
}

/**
 * goa_realm_object_manager_client_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_object_manager_client_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_object_manager_client_new().
 *
 * Returns: (transfer full) (type GoaRealmObjectManagerClient): The constructed object manager client or %NULL if @error is set.
 */
GDBusObjectManager *
goa_realm_object_manager_client_new_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}

/**
 * goa_realm_object_manager_client_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates #GDBusObjectManagerClient using goa_realm_object_manager_client_get_proxy_type() as the #GDBusProxyTypeFunc. See g_dbus_object_manager_client_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_object_manager_client_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmObjectManagerClient): The constructed object manager client or %NULL if @error is set.
 */
GDBusObjectManager *
goa_realm_object_manager_client_new_sync (
    GDBusConnection        *connection,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GError                **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", goa_realm_object_manager_client_get_proxy_type, NULL);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}


/**
 * goa_realm_object_manager_client_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like goa_realm_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
 * You can then call goa_realm_object_manager_client_new_for_bus_finish() to get the result of the operation.
 *
 * See goa_realm_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
goa_realm_object_manager_client_new_for_bus (
    GBusType                bus_type,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GAsyncReadyCallback     callback,
    gpointer                user_data)
{
  g_async_initable_new_async (GOA_REALM_TYPE_OBJECT_MANAGER_CLIENT, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", goa_realm_object_manager_client_get_proxy_type, NULL);
}

/**
 * goa_realm_object_manager_client_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to goa_realm_object_manager_client_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with goa_realm_object_manager_client_new_for_bus().
 *
 * Returns: (transfer full) (type GoaRealmObjectManagerClient): The constructed object manager client or %NULL if @error is set.
 */
GDBusObjectManager *
goa_realm_object_manager_client_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error)
{
  GObject *ret;
  GObject *source_object;
  source_object = g_async_result_get_source_object (res);
  ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
  g_object_unref (source_object);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}

/**
 * goa_realm_object_manager_client_new_for_bus_sync:
 * @bus_type: A #GBusType.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like goa_realm_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See goa_realm_object_manager_client_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GoaRealmObjectManagerClient): The constructed object manager client or %NULL if @error is set.
 */
GDBusObjectManager *
goa_realm_object_manager_client_new_for_bus_sync (
    GBusType                bus_type,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GError                **error)
{
  GInitable *ret;
  ret = g_initable_new (GOA_REALM_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", goa_realm_object_manager_client_get_proxy_type, NULL);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}


