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

#ifndef __INTERFACES_WATCHDOG_H__
#define __INTERFACES_WATCHDOG_H__

#include <gio/gio.h>

G_BEGIN_DECLS


/* ------------------------------------------------------------------------ */
/* Declarations for org.openbmc.Watchdog */

#define TYPE_WATCHDOG (watchdog_get_type ())
#define WATCHDOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_WATCHDOG, Watchdog))
#define IS_WATCHDOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_WATCHDOG))
#define WATCHDOG_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_WATCHDOG, WatchdogIface))

struct _Watchdog;
typedef struct _Watchdog Watchdog;
typedef struct _WatchdogIface WatchdogIface;

struct _WatchdogIface
{
  GTypeInterface parent_iface;



  gboolean (*handle_poke) (
    Watchdog *object,
    GDBusMethodInvocation *invocation);

  gboolean (*handle_start) (
    Watchdog *object,
    GDBusMethodInvocation *invocation);

  gboolean (*handle_stop) (
    Watchdog *object,
    GDBusMethodInvocation *invocation);

  gint  (*get_poll_interval) (Watchdog *object);

  gint  (*get_watchdog) (Watchdog *object);

  void (*watchdog_error) (
    Watchdog *object);

};

GType watchdog_get_type (void) G_GNUC_CONST;

GDBusInterfaceInfo *watchdog_interface_info (void);
guint watchdog_override_properties (GObjectClass *klass, guint property_id_begin);


/* D-Bus method call completion functions: */
void watchdog_complete_start (
    Watchdog *object,
    GDBusMethodInvocation *invocation);

void watchdog_complete_poke (
    Watchdog *object,
    GDBusMethodInvocation *invocation);

void watchdog_complete_stop (
    Watchdog *object,
    GDBusMethodInvocation *invocation);



/* D-Bus signal emissions functions: */
void watchdog_emit_watchdog_error (
    Watchdog *object);



/* D-Bus method calls: */
void watchdog_call_start (
    Watchdog *proxy,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data);

gboolean watchdog_call_start_finish (
    Watchdog *proxy,
    GAsyncResult *res,
    GError **error);

gboolean watchdog_call_start_sync (
    Watchdog *proxy,
    GCancellable *cancellable,
    GError **error);

void watchdog_call_poke (
    Watchdog *proxy,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data);

gboolean watchdog_call_poke_finish (
    Watchdog *proxy,
    GAsyncResult *res,
    GError **error);

gboolean watchdog_call_poke_sync (
    Watchdog *proxy,
    GCancellable *cancellable,
    GError **error);

void watchdog_call_stop (
    Watchdog *proxy,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data);

gboolean watchdog_call_stop_finish (
    Watchdog *proxy,
    GAsyncResult *res,
    GError **error);

gboolean watchdog_call_stop_sync (
    Watchdog *proxy,
    GCancellable *cancellable,
    GError **error);



/* D-Bus property accessors: */
gint watchdog_get_watchdog (Watchdog *object);
void watchdog_set_watchdog (Watchdog *object, gint value);

gint watchdog_get_poll_interval (Watchdog *object);
void watchdog_set_poll_interval (Watchdog *object, gint value);


/* ---- */

#define TYPE_WATCHDOG_PROXY (watchdog_proxy_get_type ())
#define WATCHDOG_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_WATCHDOG_PROXY, WatchdogProxy))
#define WATCHDOG_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_WATCHDOG_PROXY, WatchdogProxyClass))
#define WATCHDOG_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_WATCHDOG_PROXY, WatchdogProxyClass))
#define IS_WATCHDOG_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_WATCHDOG_PROXY))
#define IS_WATCHDOG_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_WATCHDOG_PROXY))

typedef struct _WatchdogProxy WatchdogProxy;
typedef struct _WatchdogProxyClass WatchdogProxyClass;
typedef struct _WatchdogProxyPrivate WatchdogProxyPrivate;

struct _WatchdogProxy
{
  /*< private >*/
  GDBusProxy parent_instance;
  WatchdogProxyPrivate *priv;
};

struct _WatchdogProxyClass
{
  GDBusProxyClass parent_class;
};

GType watchdog_proxy_get_type (void) G_GNUC_CONST;

void watchdog_proxy_new (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data);
Watchdog *watchdog_proxy_new_finish (
    GAsyncResult        *res,
    GError             **error);
Watchdog *watchdog_proxy_new_sync (
    GDBusConnection     *connection,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error);

void watchdog_proxy_new_for_bus (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GAsyncReadyCallback  callback,
    gpointer             user_data);
Watchdog *watchdog_proxy_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error);
Watchdog *watchdog_proxy_new_for_bus_sync (
    GBusType             bus_type,
    GDBusProxyFlags      flags,
    const gchar         *name,
    const gchar         *object_path,
    GCancellable        *cancellable,
    GError             **error);


/* ---- */

#define TYPE_WATCHDOG_SKELETON (watchdog_skeleton_get_type ())
#define WATCHDOG_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_WATCHDOG_SKELETON, WatchdogSkeleton))
#define WATCHDOG_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_WATCHDOG_SKELETON, WatchdogSkeletonClass))
#define WATCHDOG_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_WATCHDOG_SKELETON, WatchdogSkeletonClass))
#define IS_WATCHDOG_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_WATCHDOG_SKELETON))
#define IS_WATCHDOG_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_WATCHDOG_SKELETON))

typedef struct _WatchdogSkeleton WatchdogSkeleton;
typedef struct _WatchdogSkeletonClass WatchdogSkeletonClass;
typedef struct _WatchdogSkeletonPrivate WatchdogSkeletonPrivate;

struct _WatchdogSkeleton
{
  /*< private >*/
  GDBusInterfaceSkeleton parent_instance;
  WatchdogSkeletonPrivate *priv;
};

struct _WatchdogSkeletonClass
{
  GDBusInterfaceSkeletonClass parent_class;
};

GType watchdog_skeleton_get_type (void) G_GNUC_CONST;

Watchdog *watchdog_skeleton_new (void);


/* ---- */

#define TYPE_OBJECT (object_get_type ())
#define OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT, Object))
#define IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT))
#define OBJECT_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), TYPE_OBJECT, Object))

struct _Object;
typedef struct _Object Object;
typedef struct _ObjectIface ObjectIface;

struct _ObjectIface
{
  GTypeInterface parent_iface;
};

GType object_get_type (void) G_GNUC_CONST;

Watchdog *object_get_watchdog (Object *object);
Watchdog *object_peek_watchdog (Object *object);

#define TYPE_OBJECT_PROXY (object_proxy_get_type ())
#define OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_PROXY, ObjectProxy))
#define OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_PROXY, ObjectProxyClass))
#define OBJECT_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_PROXY, ObjectProxyClass))
#define IS_OBJECT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_PROXY))
#define IS_OBJECT_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_PROXY))

typedef struct _ObjectProxy ObjectProxy;
typedef struct _ObjectProxyClass ObjectProxyClass;
typedef struct _ObjectProxyPrivate ObjectProxyPrivate;

struct _ObjectProxy
{
  /*< private >*/
  GDBusObjectProxy parent_instance;
  ObjectProxyPrivate *priv;
};

struct _ObjectProxyClass
{
  GDBusObjectProxyClass parent_class;
};

GType object_proxy_get_type (void) G_GNUC_CONST;
ObjectProxy *object_proxy_new (GDBusConnection *connection, const gchar *object_path);

#define TYPE_OBJECT_SKELETON (object_skeleton_get_type ())
#define OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_SKELETON, ObjectSkeleton))
#define OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
#define OBJECT_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_SKELETON, ObjectSkeletonClass))
#define IS_OBJECT_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_SKELETON))
#define IS_OBJECT_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_SKELETON))

typedef struct _ObjectSkeleton ObjectSkeleton;
typedef struct _ObjectSkeletonClass ObjectSkeletonClass;
typedef struct _ObjectSkeletonPrivate ObjectSkeletonPrivate;

struct _ObjectSkeleton
{
  /*< private >*/
  GDBusObjectSkeleton parent_instance;
  ObjectSkeletonPrivate *priv;
};

struct _ObjectSkeletonClass
{
  GDBusObjectSkeletonClass parent_class;
};

GType object_skeleton_get_type (void) G_GNUC_CONST;
ObjectSkeleton *object_skeleton_new (const gchar *object_path);
void object_skeleton_set_watchdog (ObjectSkeleton *object, Watchdog *interface_);

/* ---- */

#define TYPE_OBJECT_MANAGER_CLIENT (object_manager_client_get_type ())
#define OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClient))
#define OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
#define OBJECT_MANAGER_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TYPE_OBJECT_MANAGER_CLIENT, ObjectManagerClientClass))
#define IS_OBJECT_MANAGER_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TYPE_OBJECT_MANAGER_CLIENT))
#define IS_OBJECT_MANAGER_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TYPE_OBJECT_MANAGER_CLIENT))

typedef struct _ObjectManagerClient ObjectManagerClient;
typedef struct _ObjectManagerClientClass ObjectManagerClientClass;
typedef struct _ObjectManagerClientPrivate ObjectManagerClientPrivate;

struct _ObjectManagerClient
{
  /*< private >*/
  GDBusObjectManagerClient parent_instance;
  ObjectManagerClientPrivate *priv;
};

struct _ObjectManagerClientClass
{
  GDBusObjectManagerClientClass parent_class;
};

GType object_manager_client_get_type (void) G_GNUC_CONST;

GType object_manager_client_get_proxy_type (GDBusObjectManagerClient *manager, const gchar *object_path, const gchar *interface_name, gpointer user_data);

void object_manager_client_new (
    GDBusConnection        *connection,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GAsyncReadyCallback     callback,
    gpointer                user_data);
GDBusObjectManager *object_manager_client_new_finish (
    GAsyncResult        *res,
    GError             **error);
GDBusObjectManager *object_manager_client_new_sync (
    GDBusConnection        *connection,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GError                **error);

void 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);
GDBusObjectManager *object_manager_client_new_for_bus_finish (
    GAsyncResult        *res,
    GError             **error);
GDBusObjectManager *object_manager_client_new_for_bus_sync (
    GBusType                bus_type,
    GDBusObjectManagerClientFlags  flags,
    const gchar            *name,
    const gchar            *object_path,
    GCancellable           *cancellable,
    GError                **error);


G_END_DECLS

#endif /* __INTERFACES_WATCHDOG_H__ */
