/*
 * This file is generated by gdbus-codegen, do not modify it.
 *
 * The license of this code is the same as for the D-Bus interface description
 * it was derived from. Note that it links to GLib, so must comply with the
 * LGPL linking clauses.
 */

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

#include "org.gnome.SettingsDaemon.Smartcard.h"

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

#ifdef G_ENABLE_DEBUG
#define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
#define g_marshal_value_peek_char(v)     g_value_get_schar (v)
#define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
#define g_marshal_value_peek_int(v)      g_value_get_int (v)
#define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
#define g_marshal_value_peek_long(v)     g_value_get_long (v)
#define g_marshal_value_peek_ulong(v)    g_value_get_ulong (v)
#define g_marshal_value_peek_int64(v)    g_value_get_int64 (v)
#define g_marshal_value_peek_uint64(v)   g_value_get_uint64 (v)
#define g_marshal_value_peek_enum(v)     g_value_get_enum (v)
#define g_marshal_value_peek_flags(v)    g_value_get_flags (v)
#define g_marshal_value_peek_float(v)    g_value_get_float (v)
#define g_marshal_value_peek_double(v)   g_value_get_double (v)
#define g_marshal_value_peek_string(v)   (char*) g_value_get_string (v)
#define g_marshal_value_peek_param(v)    g_value_get_param (v)
#define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
#define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
#define g_marshal_value_peek_object(v)   g_value_get_object (v)
#define g_marshal_value_peek_variant(v)  g_value_get_variant (v)
#else /* !G_ENABLE_DEBUG */
/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
 *          Do not access GValues directly in your code. Instead, use the
 *          g_value_get_*() functions
 */
#define g_marshal_value_peek_boolean(v)  (v)->data[0].v_int
#define g_marshal_value_peek_char(v)     (v)->data[0].v_int
#define g_marshal_value_peek_uchar(v)    (v)->data[0].v_uint
#define g_marshal_value_peek_int(v)      (v)->data[0].v_int
#define g_marshal_value_peek_uint(v)     (v)->data[0].v_uint
#define g_marshal_value_peek_long(v)     (v)->data[0].v_long
#define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
#define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
#define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
#define g_marshal_value_peek_float(v)    (v)->data[0].v_float
#define g_marshal_value_peek_double(v)   (v)->data[0].v_double
#define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
#define g_marshal_value_peek_param(v)    (v)->data[0].v_pointer
#define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
#define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
#define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
#define g_marshal_value_peek_variant(v)  (v)->data[0].v_pointer
#endif /* !G_ENABLE_DEBUG */

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;
  guint use_gvariant : 1;
  guint emits_changed_signal : 1;
} _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;
}

static void
_g_dbus_codegen_marshal_BOOLEAN__OBJECT (
    GClosure     *closure,
    GValue       *return_value,
    unsigned int  n_param_values,
    const GValue *param_values,
    void         *invocation_hint G_GNUC_UNUSED,
    void         *marshal_data)
{
  typedef gboolean (*_GDbusCodegenMarshalBoolean_ObjectFunc)
       (void *data1,
        GDBusMethodInvocation *arg_method_invocation,
        void *data2);
  _GDbusCodegenMarshalBoolean_ObjectFunc callback;
  GCClosure *cc = (GCClosure*) closure;
  void *data1, *data2;
  gboolean v_return;

  g_return_if_fail (return_value != NULL);
  g_return_if_fail (n_param_values == 2);

  if (G_CCLOSURE_SWAP_DATA (closure))
    {
      data1 = closure->data;
      data2 = g_value_peek_pointer (param_values + 0);
    }
  else
    {
      data1 = g_value_peek_pointer (param_values + 0);
      data2 = closure->data;
    }

  callback = (_GDbusCodegenMarshalBoolean_ObjectFunc)
    (marshal_data ? marshal_data : cc->callback);

  v_return =
    callback (data1,
              g_marshal_value_peek_object (param_values + 1),
              data2);

  g_value_set_boolean (return_value, v_return);
}

/* ------------------------------------------------------------------------
 * Code for interface org.gnome.SettingsDaemon.Smartcard.Manager
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GsdSmartcardServiceManager
 * @title: GsdSmartcardServiceManager
 * @short_description: Generated C code for the org.gnome.SettingsDaemon.Smartcard.Manager D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.gnome.SettingsDaemon.Smartcard.Manager ---- */

static const _ExtendedGDBusArgInfo _gsd_smartcard_service_manager_method_info_get_login_token_OUT_ARG_token =
{
  {
    -1,
    (gchar *) "token",
    (gchar *) "o",
    NULL
  },
  FALSE
};

static const GDBusArgInfo * const _gsd_smartcard_service_manager_method_info_get_login_token_OUT_ARG_pointers[] =
{
  &_gsd_smartcard_service_manager_method_info_get_login_token_OUT_ARG_token.parent_struct,
  NULL
};

static const _ExtendedGDBusMethodInfo _gsd_smartcard_service_manager_method_info_get_login_token =
{
  {
    -1,
    (gchar *) "GetLoginToken",
    NULL,
    (GDBusArgInfo **) &_gsd_smartcard_service_manager_method_info_get_login_token_OUT_ARG_pointers,
    NULL
  },
  "handle-get-login-token",
  FALSE
};

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

static const GDBusArgInfo * const _gsd_smartcard_service_manager_method_info_get_inserted_tokens_OUT_ARG_pointers[] =
{
  &_gsd_smartcard_service_manager_method_info_get_inserted_tokens_OUT_ARG_tokens.parent_struct,
  NULL
};

static const _ExtendedGDBusMethodInfo _gsd_smartcard_service_manager_method_info_get_inserted_tokens =
{
  {
    -1,
    (gchar *) "GetInsertedTokens",
    NULL,
    (GDBusArgInfo **) &_gsd_smartcard_service_manager_method_info_get_inserted_tokens_OUT_ARG_pointers,
    NULL
  },
  "handle-get-inserted-tokens",
  FALSE
};

static const GDBusMethodInfo * const _gsd_smartcard_service_manager_method_info_pointers[] =
{
  &_gsd_smartcard_service_manager_method_info_get_login_token.parent_struct,
  &_gsd_smartcard_service_manager_method_info_get_inserted_tokens.parent_struct,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _gsd_smartcard_service_manager_interface_info =
{
  {
    -1,
    (gchar *) "org.gnome.SettingsDaemon.Smartcard.Manager",
    (GDBusMethodInfo **) &_gsd_smartcard_service_manager_method_info_pointers,
    NULL,
    NULL,
    NULL
  },
  "manager",
};


/**
 * gsd_smartcard_service_manager_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
gsd_smartcard_service_manager_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_gsd_smartcard_service_manager_interface_info.parent_struct;
}

/**
 * gsd_smartcard_service_manager_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 #GsdSmartcardServiceManager interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
gsd_smartcard_service_manager_override_properties (GObjectClass *klass G_GNUC_UNUSED, guint property_id_begin)
{
  return property_id_begin - 1;
}


inline static void
gsd_smartcard_service_manager_method_marshal_get_login_token (
    GClosure     *closure,
    GValue       *return_value,
    unsigned int  n_param_values,
    const GValue *param_values,
    void         *invocation_hint,
    void         *marshal_data)
{
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
}

inline static void
gsd_smartcard_service_manager_method_marshal_get_inserted_tokens (
    GClosure     *closure,
    GValue       *return_value,
    unsigned int  n_param_values,
    const GValue *param_values,
    void         *invocation_hint,
    void         *marshal_data)
{
  _g_dbus_codegen_marshal_BOOLEAN__OBJECT (closure,
    return_value, n_param_values, param_values, invocation_hint, marshal_data);
}


/**
 * GsdSmartcardServiceManager:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link>.
 */

/**
 * GsdSmartcardServiceManagerIface:
 * @parent_iface: The parent interface.
 * @handle_get_inserted_tokens: Handler for the #GsdSmartcardServiceManager::handle-get-inserted-tokens signal.
 * @handle_get_login_token: Handler for the #GsdSmartcardServiceManager::handle-get-login-token signal.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link>.
 */

typedef GsdSmartcardServiceManagerIface GsdSmartcardServiceManagerInterface;
G_DEFINE_INTERFACE (GsdSmartcardServiceManager, gsd_smartcard_service_manager, G_TYPE_OBJECT)

static void
gsd_smartcard_service_manager_default_init (GsdSmartcardServiceManagerIface *iface)
{
  /* GObject signals for incoming D-Bus method calls: */
  /**
   * GsdSmartcardServiceManager::handle-get-login-token:
   * @object: A #GsdSmartcardServiceManager.
   * @invocation: A #GDBusMethodInvocation.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-Smartcard-Manager.GetLoginToken">GetLoginToken()</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 gsd_smartcard_service_manager_complete_get_login_token() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-get-login-token",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GsdSmartcardServiceManagerIface, handle_get_login_token),
    g_signal_accumulator_true_handled,
    NULL,
      gsd_smartcard_service_manager_method_marshal_get_login_token,
    G_TYPE_BOOLEAN,
    1,
    G_TYPE_DBUS_METHOD_INVOCATION);

  /**
   * GsdSmartcardServiceManager::handle-get-inserted-tokens:
   * @object: A #GsdSmartcardServiceManager.
   * @invocation: A #GDBusMethodInvocation.
   *
   * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-gnome-SettingsDaemon-Smartcard-Manager.GetInsertedTokens">GetInsertedTokens()</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 gsd_smartcard_service_manager_complete_get_inserted_tokens() or e.g. g_dbus_method_invocation_return_error() on it) and no other signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
   *
   * Returns: %G_DBUS_METHOD_INVOCATION_HANDLED or %TRUE if the invocation was handled, %G_DBUS_METHOD_INVOCATION_UNHANDLED or %FALSE to let other signal handlers run.
   */
  g_signal_new ("handle-get-inserted-tokens",
    G_TYPE_FROM_INTERFACE (iface),
    G_SIGNAL_RUN_LAST,
    G_STRUCT_OFFSET (GsdSmartcardServiceManagerIface, handle_get_inserted_tokens),
    g_signal_accumulator_true_handled,
    NULL,
      gsd_smartcard_service_manager_method_marshal_get_inserted_tokens,
    G_TYPE_BOOLEAN,
    1,
    G_TYPE_DBUS_METHOD_INVOCATION);

}

/**
 * gsd_smartcard_service_manager_call_get_login_token:
 * @proxy: A #GsdSmartcardServiceManagerProxy.
 * @cancellable: (nullable): 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-gnome-SettingsDaemon-Smartcard-Manager.GetLoginToken">GetLoginToken()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_manager_call_get_login_token_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_manager_call_get_login_token_sync() for the synchronous, blocking version of this method.
 */
void
gsd_smartcard_service_manager_call_get_login_token (
    GsdSmartcardServiceManager *proxy,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "GetLoginToken",
    g_variant_new ("()"),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * gsd_smartcard_service_manager_call_get_login_token_finish:
 * @proxy: A #GsdSmartcardServiceManagerProxy.
 * @out_token: (out) (optional): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_manager_call_get_login_token().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with gsd_smartcard_service_manager_call_get_login_token().
 *
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
 */
gboolean
gsd_smartcard_service_manager_call_get_login_token_finish (
    GsdSmartcardServiceManager *proxy,
    gchar ** out_token,
    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,
                 "(o)",
                 out_token);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * gsd_smartcard_service_manager_call_get_login_token_sync:
 * @proxy: A #GsdSmartcardServiceManagerProxy.
 * @out_token: (out) (optional): Return location for return parameter or %NULL to ignore.
 * @cancellable: (nullable): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-Smartcard-Manager.GetLoginToken">GetLoginToken()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_manager_call_get_login_token() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
 */
gboolean
gsd_smartcard_service_manager_call_get_login_token_sync (
    GsdSmartcardServiceManager *proxy,
    gchar ** out_token,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "GetLoginToken",
    g_variant_new ("()"),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(o)",
                 out_token);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * gsd_smartcard_service_manager_call_get_inserted_tokens:
 * @proxy: A #GsdSmartcardServiceManagerProxy.
 * @cancellable: (nullable): 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-gnome-SettingsDaemon-Smartcard-Manager.GetInsertedTokens">GetInsertedTokens()</link> D-Bus method on @proxy.
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_manager_call_get_inserted_tokens_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_manager_call_get_inserted_tokens_sync() for the synchronous, blocking version of this method.
 */
void
gsd_smartcard_service_manager_call_get_inserted_tokens (
    GsdSmartcardServiceManager *proxy,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_dbus_proxy_call (G_DBUS_PROXY (proxy),
    "GetInsertedTokens",
    g_variant_new ("()"),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    callback,
    user_data);
}

/**
 * gsd_smartcard_service_manager_call_get_inserted_tokens_finish:
 * @proxy: A #GsdSmartcardServiceManagerProxy.
 * @out_tokens: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_manager_call_get_inserted_tokens().
 * @error: Return location for error or %NULL.
 *
 * Finishes an operation started with gsd_smartcard_service_manager_call_get_inserted_tokens().
 *
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
 */
gboolean
gsd_smartcard_service_manager_call_get_inserted_tokens_finish (
    GsdSmartcardServiceManager *proxy,
    gchar *** out_tokens,
    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,
                 "(^ao)",
                 out_tokens);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * gsd_smartcard_service_manager_call_get_inserted_tokens_sync:
 * @proxy: A #GsdSmartcardServiceManagerProxy.
 * @out_tokens: (out) (optional) (array zero-terminated=1): Return location for return parameter or %NULL to ignore.
 * @cancellable: (nullable): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL.
 *
 * Synchronously invokes the <link linkend="gdbus-method-org-gnome-SettingsDaemon-Smartcard-Manager.GetInsertedTokens">GetInsertedTokens()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_manager_call_get_inserted_tokens() for the asynchronous version of this method.
 *
 * Returns: (skip): %TRUE if the call succeeded, %FALSE if @error is set.
 */
gboolean
gsd_smartcard_service_manager_call_get_inserted_tokens_sync (
    GsdSmartcardServiceManager *proxy,
    gchar *** out_tokens,
    GCancellable *cancellable,
    GError **error)
{
  GVariant *_ret;
  _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
    "GetInsertedTokens",
    g_variant_new ("()"),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    cancellable,
    error);
  if (_ret == NULL)
    goto _out;
  g_variant_get (_ret,
                 "(^ao)",
                 out_tokens);
  g_variant_unref (_ret);
_out:
  return _ret != NULL;
}

/**
 * gsd_smartcard_service_manager_complete_get_login_token:
 * @object: A #GsdSmartcardServiceManager.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @token: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-Smartcard-Manager.GetLoginToken">GetLoginToken()</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
gsd_smartcard_service_manager_complete_get_login_token (
    GsdSmartcardServiceManager *object G_GNUC_UNUSED,
    GDBusMethodInvocation *invocation,
    const gchar *token)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(o)",
                   token));
}

/**
 * gsd_smartcard_service_manager_complete_get_inserted_tokens:
 * @object: A #GsdSmartcardServiceManager.
 * @invocation: (transfer full): A #GDBusMethodInvocation.
 * @tokens: Parameter to return.
 *
 * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-gnome-SettingsDaemon-Smartcard-Manager.GetInsertedTokens">GetInsertedTokens()</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
gsd_smartcard_service_manager_complete_get_inserted_tokens (
    GsdSmartcardServiceManager *object G_GNUC_UNUSED,
    GDBusMethodInvocation *invocation,
    const gchar *const *tokens)
{
  g_dbus_method_invocation_return_value (invocation,
    g_variant_new ("(^ao)",
                   tokens));
}

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

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

/**
 * GsdSmartcardServiceManagerProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceManagerProxy.
 */

struct _GsdSmartcardServiceManagerProxyPrivate
{
  GData *qdata;
};

static void gsd_smartcard_service_manager_proxy_iface_init (GsdSmartcardServiceManagerIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceManagerProxy, gsd_smartcard_service_manager_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (GsdSmartcardServiceManagerProxy)
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_MANAGER, gsd_smartcard_service_manager_proxy_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceManagerProxy, gsd_smartcard_service_manager_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_MANAGER, gsd_smartcard_service_manager_proxy_iface_init))

#endif
static void
gsd_smartcard_service_manager_proxy_finalize (GObject *object)
{
  GsdSmartcardServiceManagerProxy *proxy = GSD_SMARTCARD_SERVICE_MANAGER_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (gsd_smartcard_service_manager_proxy_parent_class)->finalize (object);
}

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

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

static void
gsd_smartcard_service_manager_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 *) &_gsd_smartcard_service_manager_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], GSD_SMARTCARD_SERVICE_TYPE_MANAGER);
  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, GSD_SMARTCARD_SERVICE_TYPE_MANAGER);
  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
gsd_smartcard_service_manager_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  GsdSmartcardServiceManagerProxy *proxy = GSD_SMARTCARD_SERVICE_MANAGER_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 *) &_gsd_smartcard_service_manager_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 *) &_gsd_smartcard_service_manager_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
gsd_smartcard_service_manager_proxy_init (GsdSmartcardServiceManagerProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = gsd_smartcard_service_manager_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_SMARTCARD_SERVICE_TYPE_MANAGER_PROXY, GsdSmartcardServiceManagerProxyPrivate);
#endif

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

static void
gsd_smartcard_service_manager_proxy_class_init (GsdSmartcardServiceManagerProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = gsd_smartcard_service_manager_proxy_finalize;
  gobject_class->get_property = gsd_smartcard_service_manager_proxy_get_property;
  gobject_class->set_property = gsd_smartcard_service_manager_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = gsd_smartcard_service_manager_proxy_g_signal;
  proxy_class->g_properties_changed = gsd_smartcard_service_manager_proxy_g_properties_changed;

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

static void
gsd_smartcard_service_manager_proxy_iface_init (GsdSmartcardServiceManagerIface *iface G_GNUC_UNUSED)
{
}

/**
 * gsd_smartcard_service_manager_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): 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-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_manager_proxy_new_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_manager_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
gsd_smartcard_service_manager_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 (GSD_SMARTCARD_SERVICE_TYPE_MANAGER_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.gnome.SettingsDaemon.Smartcard.Manager", NULL);
}

/**
 * gsd_smartcard_service_manager_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_manager_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with gsd_smartcard_service_manager_proxy_new().
 *
 * Returns: (transfer full) (type GsdSmartcardServiceManagerProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceManager *
gsd_smartcard_service_manager_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 GSD_SMARTCARD_SERVICE_MANAGER (ret);
  else
    return NULL;
}

/**
 * gsd_smartcard_service_manager_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): 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-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_manager_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceManagerProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceManager *
gsd_smartcard_service_manager_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GSD_SMARTCARD_SERVICE_TYPE_MANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.Smartcard.Manager", NULL);
  if (ret != NULL)
    return GSD_SMARTCARD_SERVICE_MANAGER (ret);
  else
    return NULL;
}


/**
 * gsd_smartcard_service_manager_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: (nullable): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like gsd_smartcard_service_manager_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_manager_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_manager_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
gsd_smartcard_service_manager_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 (GSD_SMARTCARD_SERVICE_TYPE_MANAGER_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.gnome.SettingsDaemon.Smartcard.Manager", NULL);
}

/**
 * gsd_smartcard_service_manager_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_manager_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with gsd_smartcard_service_manager_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type GsdSmartcardServiceManagerProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceManager *
gsd_smartcard_service_manager_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 GSD_SMARTCARD_SERVICE_MANAGER (ret);
  else
    return NULL;
}

/**
 * gsd_smartcard_service_manager_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: (nullable): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like gsd_smartcard_service_manager_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_manager_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceManagerProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceManager *
gsd_smartcard_service_manager_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 (GSD_SMARTCARD_SERVICE_TYPE_MANAGER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.Smartcard.Manager", NULL);
  if (ret != NULL)
    return GSD_SMARTCARD_SERVICE_MANAGER (ret);
  else
    return NULL;
}


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

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

/**
 * GsdSmartcardServiceManagerSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceManagerSkeleton.
 */

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

static void
_gsd_smartcard_service_manager_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)
{
  GsdSmartcardServiceManagerSkeleton *skeleton = GSD_SMARTCARD_SERVICE_MANAGER_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], GSD_SMARTCARD_SERVICE_TYPE_MANAGER);
  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, GSD_SMARTCARD_SERVICE_TYPE_MANAGER);
  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 *
_gsd_smartcard_service_manager_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)
{
  GsdSmartcardServiceManagerSkeleton *skeleton = GSD_SMARTCARD_SERVICE_MANAGER_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 *) &_gsd_smartcard_service_manager_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
_gsd_smartcard_service_manager_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)
{
  GsdSmartcardServiceManagerSkeleton *skeleton = GSD_SMARTCARD_SERVICE_MANAGER_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 *) &_gsd_smartcard_service_manager_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 _gsd_smartcard_service_manager_skeleton_vtable =
{
  _gsd_smartcard_service_manager_skeleton_handle_method_call,
  _gsd_smartcard_service_manager_skeleton_handle_get_property,
  _gsd_smartcard_service_manager_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
gsd_smartcard_service_manager_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return gsd_smartcard_service_manager_interface_info ();
}

static GDBusInterfaceVTable *
gsd_smartcard_service_manager_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_gsd_smartcard_service_manager_skeleton_vtable;
}

static GVariant *
gsd_smartcard_service_manager_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  GsdSmartcardServiceManagerSkeleton *skeleton = GSD_SMARTCARD_SERVICE_MANAGER_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
#else
  g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}"));
#endif
  if (_gsd_smartcard_service_manager_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _gsd_smartcard_service_manager_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _gsd_smartcard_service_manager_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _gsd_smartcard_service_manager_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.gnome.SettingsDaemon.Smartcard.Manager", 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
gsd_smartcard_service_manager_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton G_GNUC_UNUSED)
{
}

static void gsd_smartcard_service_manager_skeleton_iface_init (GsdSmartcardServiceManagerIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceManagerSkeleton, gsd_smartcard_service_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (GsdSmartcardServiceManagerSkeleton)
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_MANAGER, gsd_smartcard_service_manager_skeleton_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceManagerSkeleton, gsd_smartcard_service_manager_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_MANAGER, gsd_smartcard_service_manager_skeleton_iface_init))

#endif
static void
gsd_smartcard_service_manager_skeleton_finalize (GObject *object)
{
  GsdSmartcardServiceManagerSkeleton *skeleton = GSD_SMARTCARD_SERVICE_MANAGER_SKELETON (object);
  g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  /* coverity[missing_lock : SUPPRESS] */
  g_clear_pointer (&skeleton->priv->changed_properties_idle_source, g_source_destroy);
#else
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
skeleton->priv->changed_properties_idle_source = NULL;
#endif
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (gsd_smartcard_service_manager_skeleton_parent_class)->finalize (object);
}

static void
gsd_smartcard_service_manager_skeleton_init (GsdSmartcardServiceManagerSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = gsd_smartcard_service_manager_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_SMARTCARD_SERVICE_TYPE_MANAGER_SKELETON, GsdSmartcardServiceManagerSkeletonPrivate);
#endif

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

static void
gsd_smartcard_service_manager_skeleton_class_init (GsdSmartcardServiceManagerSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

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

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = gsd_smartcard_service_manager_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = gsd_smartcard_service_manager_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = gsd_smartcard_service_manager_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = gsd_smartcard_service_manager_skeleton_dbus_interface_get_vtable;

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

static void
gsd_smartcard_service_manager_skeleton_iface_init (GsdSmartcardServiceManagerIface *iface G_GNUC_UNUSED)
{
}

/**
 * gsd_smartcard_service_manager_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link>.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceManagerSkeleton): The skeleton object.
 */
GsdSmartcardServiceManager *
gsd_smartcard_service_manager_skeleton_new (void)
{
  return GSD_SMARTCARD_SERVICE_MANAGER (g_object_new (GSD_SMARTCARD_SERVICE_TYPE_MANAGER_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.gnome.SettingsDaemon.Smartcard.Driver
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GsdSmartcardServiceDriver
 * @title: GsdSmartcardServiceDriver
 * @short_description: Generated C code for the org.gnome.SettingsDaemon.Smartcard.Driver D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.gnome.SettingsDaemon.Smartcard.Driver ---- */

static const _ExtendedGDBusPropertyInfo _gsd_smartcard_service_driver_property_info_library =
{
  {
    -1,
    (gchar *) "Library",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "library",
  FALSE,
  TRUE
};

static const _ExtendedGDBusPropertyInfo _gsd_smartcard_service_driver_property_info_description =
{
  {
    -1,
    (gchar *) "Description",
    (gchar *) "s",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "description",
  FALSE,
  TRUE
};

static const GDBusPropertyInfo * const _gsd_smartcard_service_driver_property_info_pointers[] =
{
  &_gsd_smartcard_service_driver_property_info_library.parent_struct,
  &_gsd_smartcard_service_driver_property_info_description.parent_struct,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _gsd_smartcard_service_driver_interface_info =
{
  {
    -1,
    (gchar *) "org.gnome.SettingsDaemon.Smartcard.Driver",
    NULL,
    NULL,
    (GDBusPropertyInfo **) &_gsd_smartcard_service_driver_property_info_pointers,
    NULL
  },
  "driver",
};


/**
 * gsd_smartcard_service_driver_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
gsd_smartcard_service_driver_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_gsd_smartcard_service_driver_interface_info.parent_struct;
}

/**
 * gsd_smartcard_service_driver_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 #GsdSmartcardServiceDriver interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
gsd_smartcard_service_driver_override_properties (GObjectClass *klass, guint property_id_begin)
{
  g_object_class_override_property (klass, property_id_begin++, "library");
  g_object_class_override_property (klass, property_id_begin++, "description");
  return property_id_begin - 1;
}



/**
 * GsdSmartcardServiceDriver:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link>.
 */

/**
 * GsdSmartcardServiceDriverIface:
 * @parent_iface: The parent interface.
 * @get_description: Getter for the #GsdSmartcardServiceDriver:description property.
 * @get_library: Getter for the #GsdSmartcardServiceDriver:library property.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link>.
 */

typedef GsdSmartcardServiceDriverIface GsdSmartcardServiceDriverInterface;
G_DEFINE_INTERFACE (GsdSmartcardServiceDriver, gsd_smartcard_service_driver, G_TYPE_OBJECT)

static void
gsd_smartcard_service_driver_default_init (GsdSmartcardServiceDriverIface *iface)
{
  /* GObject properties for D-Bus properties: */
  /**
   * GsdSmartcardServiceDriver:library:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Driver.Library">"Library"</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 ("library", "Library", "Library", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GsdSmartcardServiceDriver:description:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Driver.Description">"Description"</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 ("description", "Description", "Description", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

/**
 * gsd_smartcard_service_driver_get_library: (skip)
 * @object: A #GsdSmartcardServiceDriver.
 *
 * Gets the value of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Driver.Library">"Library"</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.
 *
 * 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 gsd_smartcard_service_driver_dup_library() if on another thread.
 *
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
gsd_smartcard_service_driver_get_library (GsdSmartcardServiceDriver *object)
{
  g_return_val_if_fail (GSD_SMARTCARD_SERVICE_IS_DRIVER (object), NULL);

  return GSD_SMARTCARD_SERVICE_DRIVER_GET_IFACE (object)->get_library (object);
}

/**
 * gsd_smartcard_service_driver_dup_library: (skip)
 * @object: A #GsdSmartcardServiceDriver.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Driver.Library">"Library"</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) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
gsd_smartcard_service_driver_dup_library (GsdSmartcardServiceDriver *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "library", &value, NULL);
  return value;
}

/**
 * gsd_smartcard_service_driver_set_library: (skip)
 * @object: A #GsdSmartcardServiceDriver.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Driver.Library">"Library"</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
gsd_smartcard_service_driver_set_library (GsdSmartcardServiceDriver *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "library", value, NULL);
}

/**
 * gsd_smartcard_service_driver_get_description: (skip)
 * @object: A #GsdSmartcardServiceDriver.
 *
 * Gets the value of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Driver.Description">"Description"</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.
 *
 * 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 gsd_smartcard_service_driver_dup_description() if on another thread.
 *
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
gsd_smartcard_service_driver_get_description (GsdSmartcardServiceDriver *object)
{
  g_return_val_if_fail (GSD_SMARTCARD_SERVICE_IS_DRIVER (object), NULL);

  return GSD_SMARTCARD_SERVICE_DRIVER_GET_IFACE (object)->get_description (object);
}

/**
 * gsd_smartcard_service_driver_dup_description: (skip)
 * @object: A #GsdSmartcardServiceDriver.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Driver.Description">"Description"</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) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
gsd_smartcard_service_driver_dup_description (GsdSmartcardServiceDriver *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "description", &value, NULL);
  return value;
}

/**
 * gsd_smartcard_service_driver_set_description: (skip)
 * @object: A #GsdSmartcardServiceDriver.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Driver.Description">"Description"</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
gsd_smartcard_service_driver_set_description (GsdSmartcardServiceDriver *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "description", value, NULL);
}

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

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

/**
 * GsdSmartcardServiceDriverProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceDriverProxy.
 */

struct _GsdSmartcardServiceDriverProxyPrivate
{
  GData *qdata;
};

static void gsd_smartcard_service_driver_proxy_iface_init (GsdSmartcardServiceDriverIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceDriverProxy, gsd_smartcard_service_driver_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (GsdSmartcardServiceDriverProxy)
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_DRIVER, gsd_smartcard_service_driver_proxy_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceDriverProxy, gsd_smartcard_service_driver_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_DRIVER, gsd_smartcard_service_driver_proxy_iface_init))

#endif
static void
gsd_smartcard_service_driver_proxy_finalize (GObject *object)
{
  GsdSmartcardServiceDriverProxy *proxy = GSD_SMARTCARD_SERVICE_DRIVER_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (gsd_smartcard_service_driver_proxy_parent_class)->finalize (object);
}

static void
gsd_smartcard_service_driver_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 = (const _ExtendedGDBusPropertyInfo *) _gsd_smartcard_service_driver_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
gsd_smartcard_service_driver_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.gnome.SettingsDaemon.Smartcard.Driver: %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
gsd_smartcard_service_driver_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 = (const _ExtendedGDBusPropertyInfo *) _gsd_smartcard_service_driver_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.gnome.SettingsDaemon.Smartcard.Driver", info->parent_struct.name, variant),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    NULL, (GAsyncReadyCallback) gsd_smartcard_service_driver_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
  g_variant_unref (variant);
}

static void
gsd_smartcard_service_driver_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 *) &_gsd_smartcard_service_driver_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], GSD_SMARTCARD_SERVICE_TYPE_DRIVER);
  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, GSD_SMARTCARD_SERVICE_TYPE_DRIVER);
  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
gsd_smartcard_service_driver_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  GsdSmartcardServiceDriverProxy *proxy = GSD_SMARTCARD_SERVICE_DRIVER_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 *) &_gsd_smartcard_service_driver_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 *) &_gsd_smartcard_service_driver_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 *
gsd_smartcard_service_driver_proxy_get_library (GsdSmartcardServiceDriver *object)
{
  GsdSmartcardServiceDriverProxy *proxy = GSD_SMARTCARD_SERVICE_DRIVER_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Library");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static const gchar *
gsd_smartcard_service_driver_proxy_get_description (GsdSmartcardServiceDriver *object)
{
  GsdSmartcardServiceDriverProxy *proxy = GSD_SMARTCARD_SERVICE_DRIVER_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Description");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static void
gsd_smartcard_service_driver_proxy_init (GsdSmartcardServiceDriverProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = gsd_smartcard_service_driver_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_SMARTCARD_SERVICE_TYPE_DRIVER_PROXY, GsdSmartcardServiceDriverProxyPrivate);
#endif

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

static void
gsd_smartcard_service_driver_proxy_class_init (GsdSmartcardServiceDriverProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = gsd_smartcard_service_driver_proxy_finalize;
  gobject_class->get_property = gsd_smartcard_service_driver_proxy_get_property;
  gobject_class->set_property = gsd_smartcard_service_driver_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = gsd_smartcard_service_driver_proxy_g_signal;
  proxy_class->g_properties_changed = gsd_smartcard_service_driver_proxy_g_properties_changed;

  gsd_smartcard_service_driver_override_properties (gobject_class, 1);

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

static void
gsd_smartcard_service_driver_proxy_iface_init (GsdSmartcardServiceDriverIface *iface)
{
  iface->get_library = gsd_smartcard_service_driver_proxy_get_library;
  iface->get_description = gsd_smartcard_service_driver_proxy_get_description;
}

/**
 * gsd_smartcard_service_driver_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): 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-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_driver_proxy_new_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_driver_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
gsd_smartcard_service_driver_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 (GSD_SMARTCARD_SERVICE_TYPE_DRIVER_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.gnome.SettingsDaemon.Smartcard.Driver", NULL);
}

/**
 * gsd_smartcard_service_driver_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_driver_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with gsd_smartcard_service_driver_proxy_new().
 *
 * Returns: (transfer full) (type GsdSmartcardServiceDriverProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceDriver *
gsd_smartcard_service_driver_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 GSD_SMARTCARD_SERVICE_DRIVER (ret);
  else
    return NULL;
}

/**
 * gsd_smartcard_service_driver_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): 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-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_driver_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceDriverProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceDriver *
gsd_smartcard_service_driver_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GSD_SMARTCARD_SERVICE_TYPE_DRIVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.Smartcard.Driver", NULL);
  if (ret != NULL)
    return GSD_SMARTCARD_SERVICE_DRIVER (ret);
  else
    return NULL;
}


/**
 * gsd_smartcard_service_driver_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: (nullable): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like gsd_smartcard_service_driver_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_driver_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_driver_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
gsd_smartcard_service_driver_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 (GSD_SMARTCARD_SERVICE_TYPE_DRIVER_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.gnome.SettingsDaemon.Smartcard.Driver", NULL);
}

/**
 * gsd_smartcard_service_driver_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_driver_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with gsd_smartcard_service_driver_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type GsdSmartcardServiceDriverProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceDriver *
gsd_smartcard_service_driver_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 GSD_SMARTCARD_SERVICE_DRIVER (ret);
  else
    return NULL;
}

/**
 * gsd_smartcard_service_driver_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: (nullable): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like gsd_smartcard_service_driver_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_driver_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceDriverProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceDriver *
gsd_smartcard_service_driver_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 (GSD_SMARTCARD_SERVICE_TYPE_DRIVER_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.Smartcard.Driver", NULL);
  if (ret != NULL)
    return GSD_SMARTCARD_SERVICE_DRIVER (ret);
  else
    return NULL;
}


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

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

/**
 * GsdSmartcardServiceDriverSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceDriverSkeleton.
 */

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

static void
_gsd_smartcard_service_driver_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)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_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], GSD_SMARTCARD_SERVICE_TYPE_DRIVER);
  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, GSD_SMARTCARD_SERVICE_TYPE_DRIVER);
  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 *
_gsd_smartcard_service_driver_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)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_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 *) &_gsd_smartcard_service_driver_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
_gsd_smartcard_service_driver_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)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_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 *) &_gsd_smartcard_service_driver_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 _gsd_smartcard_service_driver_skeleton_vtable =
{
  _gsd_smartcard_service_driver_skeleton_handle_method_call,
  _gsd_smartcard_service_driver_skeleton_handle_get_property,
  _gsd_smartcard_service_driver_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
gsd_smartcard_service_driver_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return gsd_smartcard_service_driver_interface_info ();
}

static GDBusInterfaceVTable *
gsd_smartcard_service_driver_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_gsd_smartcard_service_driver_skeleton_vtable;
}

static GVariant *
gsd_smartcard_service_driver_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
#else
  g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}"));
#endif
  if (_gsd_smartcard_service_driver_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _gsd_smartcard_service_driver_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _gsd_smartcard_service_driver_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _gsd_smartcard_service_driver_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.gnome.SettingsDaemon.Smartcard.Driver", 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 _gsd_smartcard_service_driver_emit_changed (gpointer user_data);

static void
gsd_smartcard_service_driver_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_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)
    _gsd_smartcard_service_driver_emit_changed (skeleton);
}

static void gsd_smartcard_service_driver_skeleton_iface_init (GsdSmartcardServiceDriverIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceDriverSkeleton, gsd_smartcard_service_driver_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (GsdSmartcardServiceDriverSkeleton)
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_DRIVER, gsd_smartcard_service_driver_skeleton_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceDriverSkeleton, gsd_smartcard_service_driver_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_DRIVER, gsd_smartcard_service_driver_skeleton_iface_init))

#endif
static void
gsd_smartcard_service_driver_skeleton_finalize (GObject *object)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_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 GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  /* coverity[missing_lock : SUPPRESS] */
  g_clear_pointer (&skeleton->priv->changed_properties_idle_source, g_source_destroy);
#else
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
skeleton->priv->changed_properties_idle_source = NULL;
#endif
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (gsd_smartcard_service_driver_skeleton_parent_class)->finalize (object);
}

static void
gsd_smartcard_service_driver_skeleton_get_property (GObject      *object,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec G_GNUC_UNUSED)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_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
_gsd_smartcard_service_driver_emit_changed (gpointer user_data)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_SKELETON (user_data);
  GList *l;
  GVariantBuilder builder;
  GVariantBuilder invalidated_builder;
  guint num_changes;

  g_mutex_lock (&skeleton->priv->lock);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as"));
#else
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
#endif
  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.gnome.SettingsDaemon.Smartcard.Driver",
                                           &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
_gsd_smartcard_service_driver_schedule_emit_changed (GsdSmartcardServiceDriverSkeleton *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
gsd_smartcard_service_driver_skeleton_notify (GObject      *object,
  GParamSpec *pspec G_GNUC_UNUSED)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_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, _gsd_smartcard_service_driver_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gsd_smartcard_service_driver_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
gsd_smartcard_service_driver_skeleton_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  const _ExtendedGDBusPropertyInfo *info;
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 2);
  info = (const _ExtendedGDBusPropertyInfo *) _gsd_smartcard_service_driver_property_info_pointers[prop_id - 1];
  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 &&
          info->emits_changed_signal)
        _gsd_smartcard_service_driver_schedule_emit_changed (skeleton, info, 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
gsd_smartcard_service_driver_skeleton_init (GsdSmartcardServiceDriverSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = gsd_smartcard_service_driver_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_SMARTCARD_SERVICE_TYPE_DRIVER_SKELETON, GsdSmartcardServiceDriverSkeletonPrivate);
#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 *
gsd_smartcard_service_driver_skeleton_get_library (GsdSmartcardServiceDriver *object)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[0]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *
gsd_smartcard_service_driver_skeleton_get_description (GsdSmartcardServiceDriver *object)
{
  GsdSmartcardServiceDriverSkeleton *skeleton = GSD_SMARTCARD_SERVICE_DRIVER_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[1]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static void
gsd_smartcard_service_driver_skeleton_class_init (GsdSmartcardServiceDriverSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = gsd_smartcard_service_driver_skeleton_finalize;
  gobject_class->get_property = gsd_smartcard_service_driver_skeleton_get_property;
  gobject_class->set_property = gsd_smartcard_service_driver_skeleton_set_property;
  gobject_class->notify       = gsd_smartcard_service_driver_skeleton_notify;


  gsd_smartcard_service_driver_override_properties (gobject_class, 1);

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = gsd_smartcard_service_driver_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = gsd_smartcard_service_driver_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = gsd_smartcard_service_driver_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = gsd_smartcard_service_driver_skeleton_dbus_interface_get_vtable;

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

static void
gsd_smartcard_service_driver_skeleton_iface_init (GsdSmartcardServiceDriverIface *iface)
{
  iface->get_library = gsd_smartcard_service_driver_skeleton_get_library;
  iface->get_description = gsd_smartcard_service_driver_skeleton_get_description;
}

/**
 * gsd_smartcard_service_driver_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link>.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceDriverSkeleton): The skeleton object.
 */
GsdSmartcardServiceDriver *
gsd_smartcard_service_driver_skeleton_new (void)
{
  return GSD_SMARTCARD_SERVICE_DRIVER (g_object_new (GSD_SMARTCARD_SERVICE_TYPE_DRIVER_SKELETON, NULL));
}

/* ------------------------------------------------------------------------
 * Code for interface org.gnome.SettingsDaemon.Smartcard.Token
 * ------------------------------------------------------------------------
 */

/**
 * SECTION:GsdSmartcardServiceToken
 * @title: GsdSmartcardServiceToken
 * @short_description: Generated C code for the org.gnome.SettingsDaemon.Smartcard.Token D-Bus interface
 *
 * This section contains code for working with the <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link> D-Bus interface in C.
 */

/* ---- Introspection data for org.gnome.SettingsDaemon.Smartcard.Token ---- */

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

static const _ExtendedGDBusPropertyInfo _gsd_smartcard_service_token_property_info_driver =
{
  {
    -1,
    (gchar *) "Driver",
    (gchar *) "o",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "driver",
  FALSE,
  TRUE
};

static const _ExtendedGDBusPropertyInfo _gsd_smartcard_service_token_property_info_is_inserted =
{
  {
    -1,
    (gchar *) "IsInserted",
    (gchar *) "b",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "is-inserted",
  FALSE,
  TRUE
};

static const _ExtendedGDBusPropertyInfo _gsd_smartcard_service_token_property_info_used_to_login =
{
  {
    -1,
    (gchar *) "UsedToLogin",
    (gchar *) "b",
    G_DBUS_PROPERTY_INFO_FLAGS_READABLE,
    NULL
  },
  "used-to-login",
  FALSE,
  TRUE
};

static const GDBusPropertyInfo * const _gsd_smartcard_service_token_property_info_pointers[] =
{
  &_gsd_smartcard_service_token_property_info_name.parent_struct,
  &_gsd_smartcard_service_token_property_info_driver.parent_struct,
  &_gsd_smartcard_service_token_property_info_is_inserted.parent_struct,
  &_gsd_smartcard_service_token_property_info_used_to_login.parent_struct,
  NULL
};

static const _ExtendedGDBusInterfaceInfo _gsd_smartcard_service_token_interface_info =
{
  {
    -1,
    (gchar *) "org.gnome.SettingsDaemon.Smartcard.Token",
    NULL,
    NULL,
    (GDBusPropertyInfo **) &_gsd_smartcard_service_token_property_info_pointers,
    NULL
  },
  "token",
};


/**
 * gsd_smartcard_service_token_interface_info:
 *
 * Gets a machine-readable description of the <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link> D-Bus interface.
 *
 * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
 */
GDBusInterfaceInfo *
gsd_smartcard_service_token_interface_info (void)
{
  return (GDBusInterfaceInfo *) &_gsd_smartcard_service_token_interface_info.parent_struct;
}

/**
 * gsd_smartcard_service_token_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 #GsdSmartcardServiceToken interface for a concrete class.
 * The properties are overridden in the order they are defined.
 *
 * Returns: The last property id.
 */
guint
gsd_smartcard_service_token_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++, "driver");
  g_object_class_override_property (klass, property_id_begin++, "is-inserted");
  g_object_class_override_property (klass, property_id_begin++, "used-to-login");
  return property_id_begin - 1;
}



/**
 * GsdSmartcardServiceToken:
 *
 * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link>.
 */

/**
 * GsdSmartcardServiceTokenIface:
 * @parent_iface: The parent interface.
 * @get_driver: Getter for the #GsdSmartcardServiceToken:driver property.
 * @get_is_inserted: Getter for the #GsdSmartcardServiceToken:is-inserted property.
 * @get_name: Getter for the #GsdSmartcardServiceToken:name property.
 * @get_used_to_login: Getter for the #GsdSmartcardServiceToken:used-to-login property.
 *
 * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link>.
 */

typedef GsdSmartcardServiceTokenIface GsdSmartcardServiceTokenInterface;
G_DEFINE_INTERFACE (GsdSmartcardServiceToken, gsd_smartcard_service_token, G_TYPE_OBJECT)

static void
gsd_smartcard_service_token_default_init (GsdSmartcardServiceTokenIface *iface)
{
  /* GObject properties for D-Bus properties: */
  /**
   * GsdSmartcardServiceToken:name:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.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));
  /**
   * GsdSmartcardServiceToken:driver:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.Driver">"Driver"</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 ("driver", "Driver", "Driver", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GsdSmartcardServiceToken:is-inserted:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.IsInserted">"IsInserted"</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_boolean ("is-inserted", "IsInserted", "IsInserted", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
  /**
   * GsdSmartcardServiceToken:used-to-login:
   *
   * Represents the D-Bus property <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.UsedToLogin">"UsedToLogin"</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_boolean ("used-to-login", "UsedToLogin", "UsedToLogin", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}

/**
 * gsd_smartcard_service_token_get_name: (skip)
 * @object: A #GsdSmartcardServiceToken.
 *
 * Gets the value of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.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.
 *
 * 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 gsd_smartcard_service_token_dup_name() if on another thread.
 *
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
gsd_smartcard_service_token_get_name (GsdSmartcardServiceToken *object)
{
  g_return_val_if_fail (GSD_SMARTCARD_SERVICE_IS_TOKEN (object), NULL);

  return GSD_SMARTCARD_SERVICE_TOKEN_GET_IFACE (object)->get_name (object);
}

/**
 * gsd_smartcard_service_token_dup_name: (skip)
 * @object: A #GsdSmartcardServiceToken.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.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) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
gsd_smartcard_service_token_dup_name (GsdSmartcardServiceToken *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "name", &value, NULL);
  return value;
}

/**
 * gsd_smartcard_service_token_set_name: (skip)
 * @object: A #GsdSmartcardServiceToken.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.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
gsd_smartcard_service_token_set_name (GsdSmartcardServiceToken *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "name", value, NULL);
}

/**
 * gsd_smartcard_service_token_get_driver: (skip)
 * @object: A #GsdSmartcardServiceToken.
 *
 * Gets the value of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.Driver">"Driver"</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.
 *
 * 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 gsd_smartcard_service_token_dup_driver() if on another thread.
 *
 * Returns: (transfer none) (nullable): The property value or %NULL if the property is not set. Do not free the returned value, it belongs to @object.
 */
const gchar *
gsd_smartcard_service_token_get_driver (GsdSmartcardServiceToken *object)
{
  g_return_val_if_fail (GSD_SMARTCARD_SERVICE_IS_TOKEN (object), NULL);

  return GSD_SMARTCARD_SERVICE_TOKEN_GET_IFACE (object)->get_driver (object);
}

/**
 * gsd_smartcard_service_token_dup_driver: (skip)
 * @object: A #GsdSmartcardServiceToken.
 *
 * Gets a copy of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.Driver">"Driver"</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) (nullable): The property value or %NULL if the property is not set. The returned value should be freed with g_free().
 */
gchar *
gsd_smartcard_service_token_dup_driver (GsdSmartcardServiceToken *object)
{
  gchar *value;
  g_object_get (G_OBJECT (object), "driver", &value, NULL);
  return value;
}

/**
 * gsd_smartcard_service_token_set_driver: (skip)
 * @object: A #GsdSmartcardServiceToken.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.Driver">"Driver"</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
gsd_smartcard_service_token_set_driver (GsdSmartcardServiceToken *object, const gchar *value)
{
  g_object_set (G_OBJECT (object), "driver", value, NULL);
}

/**
 * gsd_smartcard_service_token_get_is_inserted: (skip)
 * @object: A #GsdSmartcardServiceToken.
 *
 * Gets the value of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.IsInserted">"IsInserted"</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: The property value.
 */
gboolean 
gsd_smartcard_service_token_get_is_inserted (GsdSmartcardServiceToken *object)
{
  g_return_val_if_fail (GSD_SMARTCARD_SERVICE_IS_TOKEN (object), FALSE);

  return GSD_SMARTCARD_SERVICE_TOKEN_GET_IFACE (object)->get_is_inserted (object);
}

/**
 * gsd_smartcard_service_token_set_is_inserted: (skip)
 * @object: A #GsdSmartcardServiceToken.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.IsInserted">"IsInserted"</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
gsd_smartcard_service_token_set_is_inserted (GsdSmartcardServiceToken *object, gboolean value)
{
  g_object_set (G_OBJECT (object), "is-inserted", value, NULL);
}

/**
 * gsd_smartcard_service_token_get_used_to_login: (skip)
 * @object: A #GsdSmartcardServiceToken.
 *
 * Gets the value of the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.UsedToLogin">"UsedToLogin"</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: The property value.
 */
gboolean 
gsd_smartcard_service_token_get_used_to_login (GsdSmartcardServiceToken *object)
{
  g_return_val_if_fail (GSD_SMARTCARD_SERVICE_IS_TOKEN (object), FALSE);

  return GSD_SMARTCARD_SERVICE_TOKEN_GET_IFACE (object)->get_used_to_login (object);
}

/**
 * gsd_smartcard_service_token_set_used_to_login: (skip)
 * @object: A #GsdSmartcardServiceToken.
 * @value: The value to set.
 *
 * Sets the <link linkend="gdbus-property-org-gnome-SettingsDaemon-Smartcard-Token.UsedToLogin">"UsedToLogin"</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
gsd_smartcard_service_token_set_used_to_login (GsdSmartcardServiceToken *object, gboolean value)
{
  g_object_set (G_OBJECT (object), "used-to-login", value, NULL);
}

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

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

/**
 * GsdSmartcardServiceTokenProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceTokenProxy.
 */

struct _GsdSmartcardServiceTokenProxyPrivate
{
  GData *qdata;
};

static void gsd_smartcard_service_token_proxy_iface_init (GsdSmartcardServiceTokenIface *iface);

#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceTokenProxy, gsd_smartcard_service_token_proxy, G_TYPE_DBUS_PROXY,
                         G_ADD_PRIVATE (GsdSmartcardServiceTokenProxy)
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_TOKEN, gsd_smartcard_service_token_proxy_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceTokenProxy, gsd_smartcard_service_token_proxy, G_TYPE_DBUS_PROXY,
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_TOKEN, gsd_smartcard_service_token_proxy_iface_init))

#endif
static void
gsd_smartcard_service_token_proxy_finalize (GObject *object)
{
  GsdSmartcardServiceTokenProxy *proxy = GSD_SMARTCARD_SERVICE_TOKEN_PROXY (object);
  g_datalist_clear (&proxy->priv->qdata);
  G_OBJECT_CLASS (gsd_smartcard_service_token_proxy_parent_class)->finalize (object);
}

static void
gsd_smartcard_service_token_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 < 4);
  info = (const _ExtendedGDBusPropertyInfo *) _gsd_smartcard_service_token_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
gsd_smartcard_service_token_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.gnome.SettingsDaemon.Smartcard.Token: %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
gsd_smartcard_service_token_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 < 4);
  info = (const _ExtendedGDBusPropertyInfo *) _gsd_smartcard_service_token_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.gnome.SettingsDaemon.Smartcard.Token", info->parent_struct.name, variant),
    G_DBUS_CALL_FLAGS_NONE,
    -1,
    NULL, (GAsyncReadyCallback) gsd_smartcard_service_token_proxy_set_property_cb, (GDBusPropertyInfo *) &info->parent_struct);
  g_variant_unref (variant);
}

static void
gsd_smartcard_service_token_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 *) &_gsd_smartcard_service_token_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], GSD_SMARTCARD_SERVICE_TYPE_TOKEN);
  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, GSD_SMARTCARD_SERVICE_TYPE_TOKEN);
  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
gsd_smartcard_service_token_proxy_g_properties_changed (GDBusProxy *_proxy,
  GVariant *changed_properties,
  const gchar *const *invalidated_properties)
{
  GsdSmartcardServiceTokenProxy *proxy = GSD_SMARTCARD_SERVICE_TOKEN_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 *) &_gsd_smartcard_service_token_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 *) &_gsd_smartcard_service_token_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 *
gsd_smartcard_service_token_proxy_get_name (GsdSmartcardServiceToken *object)
{
  GsdSmartcardServiceTokenProxy *proxy = GSD_SMARTCARD_SERVICE_TOKEN_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 *
gsd_smartcard_service_token_proxy_get_driver (GsdSmartcardServiceToken *object)
{
  GsdSmartcardServiceTokenProxy *proxy = GSD_SMARTCARD_SERVICE_TOKEN_PROXY (object);
  GVariant *variant;
  const gchar *value = NULL;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "Driver");
  if (variant != NULL)
    {
      value = g_variant_get_string (variant, NULL);
      g_variant_unref (variant);
    }
  return value;
}

static gboolean 
gsd_smartcard_service_token_proxy_get_is_inserted (GsdSmartcardServiceToken *object)
{
  GsdSmartcardServiceTokenProxy *proxy = GSD_SMARTCARD_SERVICE_TOKEN_PROXY (object);
  GVariant *variant;
  gboolean value = FALSE;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "IsInserted");
  if (variant != NULL)
    {
      value = g_variant_get_boolean (variant);
      g_variant_unref (variant);
    }
  return value;
}

static gboolean 
gsd_smartcard_service_token_proxy_get_used_to_login (GsdSmartcardServiceToken *object)
{
  GsdSmartcardServiceTokenProxy *proxy = GSD_SMARTCARD_SERVICE_TOKEN_PROXY (object);
  GVariant *variant;
  gboolean value = FALSE;
  variant = g_dbus_proxy_get_cached_property (G_DBUS_PROXY (proxy), "UsedToLogin");
  if (variant != NULL)
    {
      value = g_variant_get_boolean (variant);
      g_variant_unref (variant);
    }
  return value;
}

static void
gsd_smartcard_service_token_proxy_init (GsdSmartcardServiceTokenProxy *proxy)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  proxy->priv = gsd_smartcard_service_token_proxy_get_instance_private (proxy);
#else
  proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, GSD_SMARTCARD_SERVICE_TYPE_TOKEN_PROXY, GsdSmartcardServiceTokenProxyPrivate);
#endif

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

static void
gsd_smartcard_service_token_proxy_class_init (GsdSmartcardServiceTokenProxyClass *klass)
{
  GObjectClass *gobject_class;
  GDBusProxyClass *proxy_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize     = gsd_smartcard_service_token_proxy_finalize;
  gobject_class->get_property = gsd_smartcard_service_token_proxy_get_property;
  gobject_class->set_property = gsd_smartcard_service_token_proxy_set_property;

  proxy_class = G_DBUS_PROXY_CLASS (klass);
  proxy_class->g_signal = gsd_smartcard_service_token_proxy_g_signal;
  proxy_class->g_properties_changed = gsd_smartcard_service_token_proxy_g_properties_changed;

  gsd_smartcard_service_token_override_properties (gobject_class, 1);

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

static void
gsd_smartcard_service_token_proxy_iface_init (GsdSmartcardServiceTokenIface *iface)
{
  iface->get_name = gsd_smartcard_service_token_proxy_get_name;
  iface->get_driver = gsd_smartcard_service_token_proxy_get_driver;
  iface->get_is_inserted = gsd_smartcard_service_token_proxy_get_is_inserted;
  iface->get_used_to_login = gsd_smartcard_service_token_proxy_get_used_to_login;
}

/**
 * gsd_smartcard_service_token_proxy_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): 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-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link>. See g_dbus_proxy_new() for more details.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_token_proxy_new_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_token_proxy_new_sync() for the synchronous, blocking version of this constructor.
 */
void
gsd_smartcard_service_token_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 (GSD_SMARTCARD_SERVICE_TYPE_TOKEN_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.gnome.SettingsDaemon.Smartcard.Token", NULL);
}

/**
 * gsd_smartcard_service_token_proxy_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_token_proxy_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with gsd_smartcard_service_token_proxy_new().
 *
 * Returns: (transfer full) (type GsdSmartcardServiceTokenProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceToken *
gsd_smartcard_service_token_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 GSD_SMARTCARD_SERVICE_TOKEN (ret);
  else
    return NULL;
}

/**
 * gsd_smartcard_service_token_proxy_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusProxyFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): 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-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link>. See g_dbus_proxy_new_sync() for more details.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_token_proxy_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceTokenProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceToken *
gsd_smartcard_service_token_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error)
{
  GInitable *ret;
  ret = g_initable_new (GSD_SMARTCARD_SERVICE_TYPE_TOKEN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.Smartcard.Token", NULL);
  if (ret != NULL)
    return GSD_SMARTCARD_SERVICE_TOKEN (ret);
  else
    return NULL;
}


/**
 * gsd_smartcard_service_token_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: (nullable): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like gsd_smartcard_service_token_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_token_proxy_new_for_bus_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_token_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
gsd_smartcard_service_token_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 (GSD_SMARTCARD_SERVICE_TYPE_TOKEN_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.gnome.SettingsDaemon.Smartcard.Token", NULL);
}

/**
 * gsd_smartcard_service_token_proxy_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_token_proxy_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with gsd_smartcard_service_token_proxy_new_for_bus().
 *
 * Returns: (transfer full) (type GsdSmartcardServiceTokenProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceToken *
gsd_smartcard_service_token_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 GSD_SMARTCARD_SERVICE_TOKEN (ret);
  else
    return NULL;
}

/**
 * gsd_smartcard_service_token_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: (nullable): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like gsd_smartcard_service_token_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_token_proxy_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceTokenProxy): The constructed proxy object or %NULL if @error is set.
 */
GsdSmartcardServiceToken *
gsd_smartcard_service_token_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 (GSD_SMARTCARD_SERVICE_TYPE_TOKEN_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.gnome.SettingsDaemon.Smartcard.Token", NULL);
  if (ret != NULL)
    return GSD_SMARTCARD_SERVICE_TOKEN (ret);
  else
    return NULL;
}


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

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

/**
 * GsdSmartcardServiceTokenSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceTokenSkeleton.
 */

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

static void
_gsd_smartcard_service_token_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)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_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], GSD_SMARTCARD_SERVICE_TYPE_TOKEN);
  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, GSD_SMARTCARD_SERVICE_TYPE_TOKEN);
  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 *
_gsd_smartcard_service_token_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)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_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 *) &_gsd_smartcard_service_token_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
_gsd_smartcard_service_token_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)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_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 *) &_gsd_smartcard_service_token_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 _gsd_smartcard_service_token_skeleton_vtable =
{
  _gsd_smartcard_service_token_skeleton_handle_method_call,
  _gsd_smartcard_service_token_skeleton_handle_get_property,
  _gsd_smartcard_service_token_skeleton_handle_set_property,
  {NULL}
};

static GDBusInterfaceInfo *
gsd_smartcard_service_token_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return gsd_smartcard_service_token_interface_info ();
}

static GDBusInterfaceVTable *
gsd_smartcard_service_token_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
{
  return (GDBusInterfaceVTable *) &_gsd_smartcard_service_token_skeleton_vtable;
}

static GVariant *
gsd_smartcard_service_token_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_SKELETON (_skeleton);

  GVariantBuilder builder;
  guint n;
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
#else
  g_variant_builder_init(&builder, G_VARIANT_TYPE ("a{sv}"));
#endif
  if (_gsd_smartcard_service_token_interface_info.parent_struct.properties == NULL)
    goto out;
  for (n = 0; _gsd_smartcard_service_token_interface_info.parent_struct.properties[n] != NULL; n++)
    {
      GDBusPropertyInfo *info = _gsd_smartcard_service_token_interface_info.parent_struct.properties[n];
      if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
        {
          GVariant *value;
          value = _gsd_smartcard_service_token_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.gnome.SettingsDaemon.Smartcard.Token", 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 _gsd_smartcard_service_token_emit_changed (gpointer user_data);

static void
gsd_smartcard_service_token_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_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)
    _gsd_smartcard_service_token_emit_changed (skeleton);
}

static void gsd_smartcard_service_token_skeleton_iface_init (GsdSmartcardServiceTokenIface *iface);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceTokenSkeleton, gsd_smartcard_service_token_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_ADD_PRIVATE (GsdSmartcardServiceTokenSkeleton)
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_TOKEN, gsd_smartcard_service_token_skeleton_iface_init))

#else
G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceTokenSkeleton, gsd_smartcard_service_token_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_TOKEN, gsd_smartcard_service_token_skeleton_iface_init))

#endif
static void
gsd_smartcard_service_token_skeleton_finalize (GObject *object)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_SKELETON (object);
  guint n;
  for (n = 0; n < 4; 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 GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  /* coverity[missing_lock : SUPPRESS] */
  g_clear_pointer (&skeleton->priv->changed_properties_idle_source, g_source_destroy);
#else
  if (skeleton->priv->changed_properties_idle_source != NULL)
    g_source_destroy (skeleton->priv->changed_properties_idle_source);
skeleton->priv->changed_properties_idle_source = NULL;
#endif
  g_main_context_unref (skeleton->priv->context);
  g_mutex_clear (&skeleton->priv->lock);
  G_OBJECT_CLASS (gsd_smartcard_service_token_skeleton_parent_class)->finalize (object);
}

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

static gboolean
_gsd_smartcard_service_token_emit_changed (gpointer user_data)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_SKELETON (user_data);
  GList *l;
  GVariantBuilder builder;
  GVariantBuilder invalidated_builder;
  guint num_changes;

  g_mutex_lock (&skeleton->priv->lock);
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_84
  g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init_static (&invalidated_builder, G_VARIANT_TYPE ("as"));
#else
  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
  g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as"));
#endif
  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.gnome.SettingsDaemon.Smartcard.Token",
                                           &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
_gsd_smartcard_service_token_schedule_emit_changed (GsdSmartcardServiceTokenSkeleton *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
gsd_smartcard_service_token_skeleton_notify (GObject      *object,
  GParamSpec *pspec G_GNUC_UNUSED)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_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, _gsd_smartcard_service_token_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);
      g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _gsd_smartcard_service_token_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
gsd_smartcard_service_token_skeleton_set_property (GObject      *object,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  const _ExtendedGDBusPropertyInfo *info;
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_SKELETON (object);
  g_assert (prop_id != 0 && prop_id - 1 < 4);
  info = (const _ExtendedGDBusPropertyInfo *) _gsd_smartcard_service_token_property_info_pointers[prop_id - 1];
  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 &&
          info->emits_changed_signal)
        _gsd_smartcard_service_token_schedule_emit_changed (skeleton, info, 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
gsd_smartcard_service_token_skeleton_init (GsdSmartcardServiceTokenSkeleton *skeleton)
{
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
  skeleton->priv = gsd_smartcard_service_token_skeleton_get_instance_private (skeleton);
#else
  skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, GSD_SMARTCARD_SERVICE_TYPE_TOKEN_SKELETON, GsdSmartcardServiceTokenSkeletonPrivate);
#endif

  g_mutex_init (&skeleton->priv->lock);
  skeleton->priv->context = g_main_context_ref_thread_default ();
  skeleton->priv->properties = g_new0 (GValue, 4);
  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_BOOLEAN);
  g_value_init (&skeleton->priv->properties[3], G_TYPE_BOOLEAN);
}

static const gchar *
gsd_smartcard_service_token_skeleton_get_name (GsdSmartcardServiceToken *object)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[0]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static const gchar *
gsd_smartcard_service_token_skeleton_get_driver (GsdSmartcardServiceToken *object)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_SKELETON (object);
  const gchar *value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_marshal_value_peek_string (&(skeleton->priv->properties[1]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static gboolean 
gsd_smartcard_service_token_skeleton_get_is_inserted (GsdSmartcardServiceToken *object)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_SKELETON (object);
  gboolean value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_marshal_value_peek_boolean (&(skeleton->priv->properties[2]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static gboolean 
gsd_smartcard_service_token_skeleton_get_used_to_login (GsdSmartcardServiceToken *object)
{
  GsdSmartcardServiceTokenSkeleton *skeleton = GSD_SMARTCARD_SERVICE_TOKEN_SKELETON (object);
  gboolean value;
  g_mutex_lock (&skeleton->priv->lock);
  value = g_marshal_value_peek_boolean (&(skeleton->priv->properties[3]));
  g_mutex_unlock (&skeleton->priv->lock);
  return value;
}

static void
gsd_smartcard_service_token_skeleton_class_init (GsdSmartcardServiceTokenSkeletonClass *klass)
{
  GObjectClass *gobject_class;
  GDBusInterfaceSkeletonClass *skeleton_class;

  gobject_class = G_OBJECT_CLASS (klass);
  gobject_class->finalize = gsd_smartcard_service_token_skeleton_finalize;
  gobject_class->get_property = gsd_smartcard_service_token_skeleton_get_property;
  gobject_class->set_property = gsd_smartcard_service_token_skeleton_set_property;
  gobject_class->notify       = gsd_smartcard_service_token_skeleton_notify;


  gsd_smartcard_service_token_override_properties (gobject_class, 1);

  skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
  skeleton_class->get_info = gsd_smartcard_service_token_skeleton_dbus_interface_get_info;
  skeleton_class->get_properties = gsd_smartcard_service_token_skeleton_dbus_interface_get_properties;
  skeleton_class->flush = gsd_smartcard_service_token_skeleton_dbus_interface_flush;
  skeleton_class->get_vtable = gsd_smartcard_service_token_skeleton_dbus_interface_get_vtable;

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

static void
gsd_smartcard_service_token_skeleton_iface_init (GsdSmartcardServiceTokenIface *iface)
{
  iface->get_name = gsd_smartcard_service_token_skeleton_get_name;
  iface->get_driver = gsd_smartcard_service_token_skeleton_get_driver;
  iface->get_is_inserted = gsd_smartcard_service_token_skeleton_get_is_inserted;
  iface->get_used_to_login = gsd_smartcard_service_token_skeleton_get_used_to_login;
}

/**
 * gsd_smartcard_service_token_skeleton_new:
 *
 * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link>.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceTokenSkeleton): The skeleton object.
 */
GsdSmartcardServiceToken *
gsd_smartcard_service_token_skeleton_new (void)
{
  return GSD_SMARTCARD_SERVICE_TOKEN (g_object_new (GSD_SMARTCARD_SERVICE_TYPE_TOKEN_SKELETON, NULL));
}

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

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

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

/**
 * GsdSmartcardServiceObjectIface:
 * @parent_iface: The parent interface.
 *
 * Virtual table for the #GsdSmartcardServiceObject interface.
 */

typedef GsdSmartcardServiceObjectIface GsdSmartcardServiceObjectInterface;
G_DEFINE_INTERFACE_WITH_CODE (GsdSmartcardServiceObject, gsd_smartcard_service_object, G_TYPE_OBJECT, g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_DBUS_OBJECT);)

static void
gsd_smartcard_service_object_default_init (GsdSmartcardServiceObjectIface *iface)
{
  /**
   * GsdSmartcardServiceObject:manager:
   *
   * The #GsdSmartcardServiceManager instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</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 ("manager", "manager", "manager", GSD_SMARTCARD_SERVICE_TYPE_MANAGER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  /**
   * GsdSmartcardServiceObject:driver:
   *
   * The #GsdSmartcardServiceDriver instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</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 ("driver", "driver", "driver", GSD_SMARTCARD_SERVICE_TYPE_DRIVER, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

  /**
   * GsdSmartcardServiceObject:token:
   *
   * The #GsdSmartcardServiceToken instance corresponding to the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</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 ("token", "token", "token", GSD_SMARTCARD_SERVICE_TYPE_TOKEN, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));

}

/**
 * gsd_smartcard_service_object_get_manager:
 * @object: A #GsdSmartcardServiceObject.
 *
 * Gets the #GsdSmartcardServiceManager instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link> on @object, if any.
 *
 * Returns: (transfer full) (nullable): A #GsdSmartcardServiceManager that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
 */
GsdSmartcardServiceManager *gsd_smartcard_service_object_get_manager (GsdSmartcardServiceObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Manager");
  if (ret == NULL)
    return NULL;
  return GSD_SMARTCARD_SERVICE_MANAGER (ret);
}

/**
 * gsd_smartcard_service_object_get_driver:
 * @object: A #GsdSmartcardServiceObject.
 *
 * Gets the #GsdSmartcardServiceDriver instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link> on @object, if any.
 *
 * Returns: (transfer full) (nullable): A #GsdSmartcardServiceDriver that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
 */
GsdSmartcardServiceDriver *gsd_smartcard_service_object_get_driver (GsdSmartcardServiceObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Driver");
  if (ret == NULL)
    return NULL;
  return GSD_SMARTCARD_SERVICE_DRIVER (ret);
}

/**
 * gsd_smartcard_service_object_get_token:
 * @object: A #GsdSmartcardServiceObject.
 *
 * Gets the #GsdSmartcardServiceToken instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link> on @object, if any.
 *
 * Returns: (transfer full) (nullable): A #GsdSmartcardServiceToken that must be freed with g_object_unref() or %NULL if @object does not implement the interface.
 */
GsdSmartcardServiceToken *gsd_smartcard_service_object_get_token (GsdSmartcardServiceObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Token");
  if (ret == NULL)
    return NULL;
  return GSD_SMARTCARD_SERVICE_TOKEN (ret);
}


/**
 * gsd_smartcard_service_object_peek_manager: (skip)
 * @object: A #GsdSmartcardServiceObject.
 *
 * Like gsd_smartcard_service_object_get_manager() but doesn't increase the reference count on the returned object.
 *
 * 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.
 *
 * Returns: (transfer none) (nullable): A #GsdSmartcardServiceManager or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
 */
GsdSmartcardServiceManager *gsd_smartcard_service_object_peek_manager (GsdSmartcardServiceObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Manager");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return GSD_SMARTCARD_SERVICE_MANAGER (ret);
}

/**
 * gsd_smartcard_service_object_peek_driver: (skip)
 * @object: A #GsdSmartcardServiceObject.
 *
 * Like gsd_smartcard_service_object_get_driver() but doesn't increase the reference count on the returned object.
 *
 * 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.
 *
 * Returns: (transfer none) (nullable): A #GsdSmartcardServiceDriver or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
 */
GsdSmartcardServiceDriver *gsd_smartcard_service_object_peek_driver (GsdSmartcardServiceObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Driver");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return GSD_SMARTCARD_SERVICE_DRIVER (ret);
}

/**
 * gsd_smartcard_service_object_peek_token: (skip)
 * @object: A #GsdSmartcardServiceObject.
 *
 * Like gsd_smartcard_service_object_get_token() but doesn't increase the reference count on the returned object.
 *
 * 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.
 *
 * Returns: (transfer none) (nullable): A #GsdSmartcardServiceToken or %NULL if @object does not implement the interface. Do not free the returned object, it is owned by @object.
 */
GsdSmartcardServiceToken *gsd_smartcard_service_object_peek_token (GsdSmartcardServiceObject *object)
{
  GDBusInterface *ret;
  ret = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Token");
  if (ret == NULL)
    return NULL;
  g_object_unref (ret);
  return GSD_SMARTCARD_SERVICE_TOKEN (ret);
}


static void
gsd_smartcard_service_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);
}

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

/**
 * GsdSmartcardServiceObjectProxyClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceObjectProxy.
 */

static void
gsd_smartcard_service_object_proxy__gsd_smartcard_service_object_iface_init (GsdSmartcardServiceObjectIface *iface G_GNUC_UNUSED)
{
}

static void
gsd_smartcard_service_object_proxy__g_dbus_object_iface_init (GDBusObjectIface *iface)
{
  iface->interface_added = gsd_smartcard_service_object_notify;
  iface->interface_removed = gsd_smartcard_service_object_notify;
}


G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceObjectProxy, gsd_smartcard_service_object_proxy, G_TYPE_DBUS_OBJECT_PROXY,
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_OBJECT, gsd_smartcard_service_object_proxy__gsd_smartcard_service_object_iface_init)
                         G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, gsd_smartcard_service_object_proxy__g_dbus_object_iface_init))

static void
gsd_smartcard_service_object_proxy_init (GsdSmartcardServiceObjectProxy *object G_GNUC_UNUSED)
{
}

static void
gsd_smartcard_service_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
gsd_smartcard_service_object_proxy_get_property (GObject      *gobject,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec)
{
  GsdSmartcardServiceObjectProxy *object = GSD_SMARTCARD_SERVICE_OBJECT_PROXY (gobject);
  GDBusInterface *interface;

  switch (prop_id)
    {
    case 1:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Manager");
      g_value_take_object (value, interface);
      break;

    case 2:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Driver");
      g_value_take_object (value, interface);
      break;

    case 3:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Token");
      g_value_take_object (value, interface);
      break;

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

static void
gsd_smartcard_service_object_proxy_class_init (GsdSmartcardServiceObjectProxyClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

  gobject_class->set_property = gsd_smartcard_service_object_proxy_set_property;
  gobject_class->get_property = gsd_smartcard_service_object_proxy_get_property;

  g_object_class_override_property (gobject_class, 1, "manager");
  g_object_class_override_property (gobject_class, 2, "driver");
  g_object_class_override_property (gobject_class, 3, "token");
}

/**
 * gsd_smartcard_service_object_proxy_new:
 * @connection: A #GDBusConnection.
 * @object_path: An object path.
 *
 * Creates a new proxy object.
 *
 * Returns: (transfer full): The proxy object.
 */
GsdSmartcardServiceObjectProxy *
gsd_smartcard_service_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 GSD_SMARTCARD_SERVICE_OBJECT_PROXY (g_object_new (GSD_SMARTCARD_SERVICE_TYPE_OBJECT_PROXY, "g-connection", connection, "g-object-path", object_path, NULL));
}

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

/**
 * GsdSmartcardServiceObjectSkeletonClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceObjectSkeleton.
 */

static void
gsd_smartcard_service_object_skeleton__gsd_smartcard_service_object_iface_init (GsdSmartcardServiceObjectIface *iface G_GNUC_UNUSED)
{
}


static void
gsd_smartcard_service_object_skeleton__g_dbus_object_iface_init (GDBusObjectIface *iface)
{
  iface->interface_added = gsd_smartcard_service_object_notify;
  iface->interface_removed = gsd_smartcard_service_object_notify;
}

G_DEFINE_TYPE_WITH_CODE (GsdSmartcardServiceObjectSkeleton, gsd_smartcard_service_object_skeleton, G_TYPE_DBUS_OBJECT_SKELETON,
                         G_IMPLEMENT_INTERFACE (GSD_SMARTCARD_SERVICE_TYPE_OBJECT, gsd_smartcard_service_object_skeleton__gsd_smartcard_service_object_iface_init)
                         G_IMPLEMENT_INTERFACE (G_TYPE_DBUS_OBJECT, gsd_smartcard_service_object_skeleton__g_dbus_object_iface_init))

static void
gsd_smartcard_service_object_skeleton_init (GsdSmartcardServiceObjectSkeleton *object G_GNUC_UNUSED)
{
}

static void
gsd_smartcard_service_object_skeleton_set_property (GObject      *gobject,
  guint         prop_id,
  const GValue *value,
  GParamSpec   *pspec)
{
  GsdSmartcardServiceObjectSkeleton *object = GSD_SMARTCARD_SERVICE_OBJECT_SKELETON (gobject);
  GDBusInterfaceSkeleton *interface;

  switch (prop_id)
    {
    case 1:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (GSD_SMARTCARD_SERVICE_IS_MANAGER (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.gnome.SettingsDaemon.Smartcard.Manager");
        }
      break;

    case 2:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (GSD_SMARTCARD_SERVICE_IS_DRIVER (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.gnome.SettingsDaemon.Smartcard.Driver");
        }
      break;

    case 3:
      interface = g_value_get_object (value);
      if (interface != NULL)
        {
          g_warn_if_fail (GSD_SMARTCARD_SERVICE_IS_TOKEN (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.gnome.SettingsDaemon.Smartcard.Token");
        }
      break;

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

static void
gsd_smartcard_service_object_skeleton_get_property (GObject      *gobject,
  guint         prop_id,
  GValue       *value,
  GParamSpec   *pspec)
{
  GsdSmartcardServiceObjectSkeleton *object = GSD_SMARTCARD_SERVICE_OBJECT_SKELETON (gobject);
  GDBusInterface *interface;

  switch (prop_id)
    {
    case 1:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Manager");
      g_value_take_object (value, interface);
      break;

    case 2:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Driver");
      g_value_take_object (value, interface);
      break;

    case 3:
      interface = g_dbus_object_get_interface (G_DBUS_OBJECT (object), "org.gnome.SettingsDaemon.Smartcard.Token");
      g_value_take_object (value, interface);
      break;

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

static void
gsd_smartcard_service_object_skeleton_class_init (GsdSmartcardServiceObjectSkeletonClass *klass)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);

  gobject_class->set_property = gsd_smartcard_service_object_skeleton_set_property;
  gobject_class->get_property = gsd_smartcard_service_object_skeleton_get_property;

  g_object_class_override_property (gobject_class, 1, "manager");
  g_object_class_override_property (gobject_class, 2, "driver");
  g_object_class_override_property (gobject_class, 3, "token");
}

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

/**
 * gsd_smartcard_service_object_skeleton_set_manager:
 * @object: A #GsdSmartcardServiceObjectSkeleton.
 * @interface_: (nullable): A #GsdSmartcardServiceManager or %NULL to clear the interface.
 *
 * Sets the #GsdSmartcardServiceManager instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Manager.top_of_page">org.gnome.SettingsDaemon.Smartcard.Manager</link> on @object.
 */
void gsd_smartcard_service_object_skeleton_set_manager (GsdSmartcardServiceObjectSkeleton *object, GsdSmartcardServiceManager *interface_)
{
  g_object_set (G_OBJECT (object), "manager", interface_, NULL);
}

/**
 * gsd_smartcard_service_object_skeleton_set_driver:
 * @object: A #GsdSmartcardServiceObjectSkeleton.
 * @interface_: (nullable): A #GsdSmartcardServiceDriver or %NULL to clear the interface.
 *
 * Sets the #GsdSmartcardServiceDriver instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Driver.top_of_page">org.gnome.SettingsDaemon.Smartcard.Driver</link> on @object.
 */
void gsd_smartcard_service_object_skeleton_set_driver (GsdSmartcardServiceObjectSkeleton *object, GsdSmartcardServiceDriver *interface_)
{
  g_object_set (G_OBJECT (object), "driver", interface_, NULL);
}

/**
 * gsd_smartcard_service_object_skeleton_set_token:
 * @object: A #GsdSmartcardServiceObjectSkeleton.
 * @interface_: (nullable): A #GsdSmartcardServiceToken or %NULL to clear the interface.
 *
 * Sets the #GsdSmartcardServiceToken instance for the D-Bus interface <link linkend="gdbus-interface-org-gnome-SettingsDaemon-Smartcard-Token.top_of_page">org.gnome.SettingsDaemon.Smartcard.Token</link> on @object.
 */
void gsd_smartcard_service_object_skeleton_set_token (GsdSmartcardServiceObjectSkeleton *object, GsdSmartcardServiceToken *interface_)
{
  g_object_set (G_OBJECT (object), "token", interface_, NULL);
}


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

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

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

/**
 * GsdSmartcardServiceObjectManagerClientClass:
 * @parent_class: The parent class.
 *
 * Class structure for #GsdSmartcardServiceObjectManagerClient.
 */

G_DEFINE_TYPE (GsdSmartcardServiceObjectManagerClient, gsd_smartcard_service_object_manager_client, G_TYPE_DBUS_OBJECT_MANAGER_CLIENT)

static void
gsd_smartcard_service_object_manager_client_init (GsdSmartcardServiceObjectManagerClient *manager G_GNUC_UNUSED)
{
}

static void
gsd_smartcard_service_object_manager_client_class_init (GsdSmartcardServiceObjectManagerClientClass *klass G_GNUC_UNUSED)
{
}

/**
 * gsd_smartcard_service_object_manager_client_get_proxy_type:
 * @manager: A #GDBusObjectManagerClient.
 * @object_path: The object path of the remote object (unused).
 * @interface_name: (nullable): 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 derived and #GDBusProxy derived types.
 *
 * Returns: A #GDBusProxy derived #GType if @interface_name is not %NULL, otherwise the #GType for #GsdSmartcardServiceObjectProxy.
 */
GType
gsd_smartcard_service_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 GSD_SMARTCARD_SERVICE_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.gnome.SettingsDaemon.Smartcard.Manager", (gpointer) (guintptr) (GSD_SMARTCARD_SERVICE_TYPE_MANAGER_PROXY));
      g_hash_table_insert (lookup_hash, (gpointer) "org.gnome.SettingsDaemon.Smartcard.Driver", (gpointer) (guintptr) (GSD_SMARTCARD_SERVICE_TYPE_DRIVER_PROXY));
      g_hash_table_insert (lookup_hash, (gpointer) "org.gnome.SettingsDaemon.Smartcard.Token", (gpointer) (guintptr) (GSD_SMARTCARD_SERVICE_TYPE_TOKEN_PROXY));
      g_once_init_leave (&once_init_value, 1);
    }
  ret = (GType) (guintptr) (g_hash_table_lookup (lookup_hash, interface_name));
  if (ret == (GType) 0)
    ret = G_TYPE_DBUS_PROXY;
  return ret;
}

/**
 * gsd_smartcard_service_object_manager_client_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): 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 gsd_smartcard_service_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 thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_object_manager_client_new_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_object_manager_client_new_sync() for the synchronous, blocking version of this constructor.
 */
void
gsd_smartcard_service_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 (GSD_SMARTCARD_SERVICE_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", gsd_smartcard_service_object_manager_client_get_proxy_type, NULL);
}

/**
 * gsd_smartcard_service_object_manager_client_new_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_object_manager_client_new().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with gsd_smartcard_service_object_manager_client_new().
 *
 * Returns: (transfer full) (type GsdSmartcardServiceObjectManagerClient): The constructed object manager client or %NULL if @error is set.
 */
GDBusObjectManager *
gsd_smartcard_service_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;
}

/**
 * gsd_smartcard_service_object_manager_client_new_sync:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @name: (nullable): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
 * @object_path: An object path.
 * @cancellable: (nullable): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Synchronously creates #GDBusObjectManagerClient using gsd_smartcard_service_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 gsd_smartcard_service_object_manager_client_new() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceObjectManagerClient): The constructed object manager client or %NULL if @error is set.
 */
GDBusObjectManager *
gsd_smartcard_service_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 (GSD_SMARTCARD_SERVICE_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "connection", connection, "object-path", object_path, "get-proxy-type-func", gsd_smartcard_service_object_manager_client_get_proxy_type, NULL);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}


/**
 * gsd_smartcard_service_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: (nullable): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Like gsd_smartcard_service_object_manager_client_new() but takes a #GBusType instead of a #GDBusConnection.
 *
 * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
 * You can then call gsd_smartcard_service_object_manager_client_new_for_bus_finish() to get the result of the operation.
 *
 * See gsd_smartcard_service_object_manager_client_new_for_bus_sync() for the synchronous, blocking version of this constructor.
 */
void
gsd_smartcard_service_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 (GSD_SMARTCARD_SERVICE_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", gsd_smartcard_service_object_manager_client_get_proxy_type, NULL);
}

/**
 * gsd_smartcard_service_object_manager_client_new_for_bus_finish:
 * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to gsd_smartcard_service_object_manager_client_new_for_bus().
 * @error: Return location for error or %NULL
 *
 * Finishes an operation started with gsd_smartcard_service_object_manager_client_new_for_bus().
 *
 * Returns: (transfer full) (type GsdSmartcardServiceObjectManagerClient): The constructed object manager client or %NULL if @error is set.
 */
GDBusObjectManager *
gsd_smartcard_service_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;
}

/**
 * gsd_smartcard_service_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: (nullable): A #GCancellable or %NULL.
 * @error: Return location for error or %NULL
 *
 * Like gsd_smartcard_service_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection.
 *
 * The calling thread is blocked until a reply is received.
 *
 * See gsd_smartcard_service_object_manager_client_new_for_bus() for the asynchronous version of this constructor.
 *
 * Returns: (transfer full) (type GsdSmartcardServiceObjectManagerClient): The constructed object manager client or %NULL if @error is set.
 */
GDBusObjectManager *
gsd_smartcard_service_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 (GSD_SMARTCARD_SERVICE_TYPE_OBJECT_MANAGER_CLIENT, cancellable, error, "flags", flags, "name", name, "bus-type", bus_type, "object-path", object_path, "get-proxy-type-func", gsd_smartcard_service_object_manager_client_get_proxy_type, NULL);
  if (ret != NULL)
    return G_DBUS_OBJECT_MANAGER (ret);
  else
    return NULL;
}


