GoaOAuth2Based: GNOME Online Accounts Reference Manual

## GoaOAuth2Based GoaOAuth2Based — Generated C code for the org.gnome.OnlineAccounts.OAuth2Based D-Bus interface |

## Functions

GDBusInterfaceInfo * | goa_oauth2_based_interface_info ()
guint | goa_oauth2_based_override_properties ()
const gchar * | goa_oauth2_based_get_client_id ()
void | goa_oauth2_based_set_client_id ()
gchar * | goa_oauth2_based_dup_client_id ()
const gchar * | goa_oauth2_based_get_client_secret ()
void | goa_oauth2_based_set_client_secret ()
gchar * | goa_oauth2_based_dup_client_secret ()
void | goa_oauth2_based_call_get_access_token ()
gboolean | goa_oauth2_based_call_get_access_token_finish ()
gboolean | goa_oauth2_based_call_get_access_token_sync ()
void | goa_oauth2_based_complete_get_access_token ()
void | goa_oauth2_based_proxy_new ()
GoaOAuth2Based * | goa_oauth2_based_proxy_new_finish ()
GoaOAuth2Based * | goa_oauth2_based_proxy_new_sync ()
void | goa_oauth2_based_proxy_new_for_bus ()
GoaOAuth2Based * | goa_oauth2_based_proxy_new_for_bus_finish ()
GoaOAuth2Based * | goa_oauth2_based_proxy_new_for_bus_sync ()
GoaOAuth2Based * | goa_oauth2_based_skeleton_new ()

## Properties

gchar * | client-id | Read / Write
gchar * | client-secret | Read / Write

## Signals

gboolean | handle-get-access-token | Run Last

## Types and Values

| GoaOAuth2Based
struct | GoaOAuth2BasedIface
struct | GoaOAuth2BasedProxy
struct | GoaOAuth2BasedProxyClass
struct | GoaOAuth2BasedSkeleton
struct | GoaOAuth2BasedSkeletonClass

## Object Hierarchy

        GInterface
        ╰── GoaOAuth2Based
        GObject
        ├── GDBusInterfaceSkeleton
        │   ╰── GoaOAuth2BasedSkeleton
        ╰── GDBusProxy
            ╰── GoaOAuth2BasedProxy

## Prerequisites

GoaOAuth2Based requires GObject.

## Implemented Interfaces

GoaOAuth2BasedProxy implements GDBusInterface, GInitable, GAsyncInitable and GoaOAuth2Based.

GoaOAuth2BasedSkeleton implements GDBusInterface and GoaOAuth2Based.

## Known Implementations

GoaOAuth2Based is implemented by GoaOAuth2BasedProxy and GoaOAuth2BasedSkeleton.

## Description

This section contains code for working with the org.gnome.OnlineAccounts.OAuth2Based D-Bus interface in C.

## Functions

### goa_oauth2_based_interface_info ()

    GDBusInterfaceInfo *
    goa_oauth2_based_interface_info (void);

Gets a machine-readable description of the org.gnome.OnlineAccounts.OAuth2Based D-Bus interface.

#### Returns

A GDBusInterfaceInfo. Do not free.

[transfer none]

### goa_oauth2_based_override_properties ()

    guint
    goa_oauth2_based_override_properties (GObjectClass *klass,
                                          guint property_id_begin);

Overrides all GObject properties in the GoaOAuth2Based interface for a concrete class. The properties are overridden in the order they are defined.

#### Parameters

klass | The class structure for a GObject derived class. |
property_id_begin | The property id to assign to the first overridden property. |

#### Returns

The last property id.

### goa_oauth2_based_get_client_id ()

    const gchar *
    goa_oauth2_based_get_client_id (GoaOAuth2Based *object);

Gets the value of the "ClientId" 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 `goa_oauth2_based_dup_client_id()` if on another thread.

[skip]

#### Parameters

object | A GoaOAuth2Based. |

#### Returns

The property value or `NULL` if the property is not set. Do not free the returned value, it belongs to `object` .

[transfer none][nullable]

### goa_oauth2_based_set_client_id ()

    void
    goa_oauth2_based_set_client_id (GoaOAuth2Based *object,
                                    const gchar *value);

Sets the "ClientId" 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.

[skip]

#### Parameters

object | A GoaOAuth2Based. |
value | The value to set. |

### goa_oauth2_based_dup_client_id ()

    gchar *
    goa_oauth2_based_dup_client_id (GoaOAuth2Based *object);

Gets a copy of the "ClientId" D-Bus property.

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

[skip]

#### Parameters

object | A GoaOAuth2Based. |

#### Returns

The property value or `NULL` if the property is not set. The returned value should be freed with `g_free()`.

[transfer full][nullable]

### goa_oauth2_based_get_client_secret ()

    const gchar *
    goa_oauth2_based_get_client_secret (GoaOAuth2Based *object);

Gets the value of the "ClientSecret" 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 `goa_oauth2_based_dup_client_secret()` if on another thread.

[skip]

#### Parameters

object | A GoaOAuth2Based. |

#### Returns

The property value or `NULL` if the property is not set. Do not free the returned value, it belongs to `object` .

[transfer none][nullable]

### goa_oauth2_based_set_client_secret ()

    void
    goa_oauth2_based_set_client_secret (GoaOAuth2Based *object,
                                        const gchar *value);

Sets the "ClientSecret" 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.

[skip]

#### Parameters

object | A GoaOAuth2Based. |
value | The value to set. |

### goa_oauth2_based_dup_client_secret ()

    gchar *
    goa_oauth2_based_dup_client_secret (GoaOAuth2Based *object);

Gets a copy of the "ClientSecret" D-Bus property.

Since this D-Bus property is readable, it is meaningful to use this function on both the client- and service-side.

[skip]

#### Parameters

object | A GoaOAuth2Based. |

#### Returns

The property value or `NULL` if the property is not set. The returned value should be freed with `g_free()`.

[transfer full][nullable]

### goa_oauth2_based_call_get_access_token ()

    void
    goa_oauth2_based_call_get_access_token
                                   (GoaOAuth2Based *proxy,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Asynchronously invokes the `GetAccessToken()` 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. You can then call `goa_oauth2_based_call_get_access_token_finish()` to get the result of the operation.

See `goa_oauth2_based_call_get_access_token_sync()` for the synchronous, blocking version of this method.

#### Parameters

proxy | A GoaOAuth2BasedProxy. |
cancellable | A GCancellable or `NULL`. | [nullable]
callback | A GAsyncReadyCallback to call when the request is satisfied or `NULL`. |
user_data | User data to pass to `callback` . |

### goa_oauth2_based_call_get_access_token_finish ()

    gboolean
    goa_oauth2_based_call_get_access_token_finish
                                   (GoaOAuth2Based *proxy,
                                    gchar **out_access_token,
                                    gint *out_expires_in,
                                    GAsyncResult *res,
                                    GError **error);

Finishes an operation started with `goa_oauth2_based_call_get_access_token()`.

#### Parameters

proxy | A GoaOAuth2BasedProxy. |
out_access_token | Return location for return parameter or `NULL` to ignore. | [out][optional]
out_expires_in | Return location for return parameter or `NULL` to ignore. | [out][optional]
res | The GAsyncResult obtained from the GAsyncReadyCallback passed to `goa_oauth2_based_call_get_access_token()`. |
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if the call succeded, `FALSE` if `error` is set.

[skip]

### goa_oauth2_based_call_get_access_token_sync ()

    gboolean
    goa_oauth2_based_call_get_access_token_sync
                                   (GoaOAuth2Based *proxy,
                                    gchar **out_access_token,
                                    gint *out_expires_in,
                                    GCancellable *cancellable,
                                    GError **error);

Synchronously invokes the `GetAccessToken()` D-Bus method on `proxy` . The calling thread is blocked until a reply is received.

See `goa_oauth2_based_call_get_access_token()` for the asynchronous version of this method.

#### Parameters

proxy | A GoaOAuth2BasedProxy. |
out_access_token | Return location for return parameter or `NULL` to ignore. | [out][optional]
out_expires_in | Return location for return parameter or `NULL` to ignore. | [out][optional]
cancellable | A GCancellable or `NULL`. | [nullable]
error | Return location for error or `NULL`. |

#### Returns

`TRUE` if the call succeded, `FALSE` if `error` is set.

[skip]

### goa_oauth2_based_complete_get_access_token ()

    void
    goa_oauth2_based_complete_get_access_token
                                   (GoaOAuth2Based *object,
                                    GDBusMethodInvocation *invocation,
                                    const gchar *access_token,
                                    gint expires_in);

Helper function used in service implementations to finish handling invocations of the `GetAccessToken()` 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.

#### Parameters

object | A GoaOAuth2Based. |
invocation | A GDBusMethodInvocation. | [transfer full]
access_token | Parameter to return. |
expires_in | Parameter to return. |

### goa_oauth2_based_proxy_new ()

    void
    goa_oauth2_based_proxy_new (GDBusConnection *connection,
                                GDBusProxyFlags flags,
                                const gchar *name,
                                const gchar *object_path,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously creates a proxy for the D-Bus interface org.gnome.OnlineAccounts.OAuth2Based. 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. You can then call `goa_oauth2_based_proxy_new_finish()` to get the result of the operation.

See `goa_oauth2_based_proxy_new_sync()` for the synchronous, blocking version of this constructor.

#### Parameters

connection | A GDBusConnection. |
flags | Flags from the GDBusProxyFlags enumeration. |
name | A bus name (well-known or unique) or `NULL` if `connection` is not a message bus connection. | [nullable]
object_path | An object path. |
cancellable | A GCancellable or `NULL`. | [nullable]
callback | A GAsyncReadyCallback to call when the request is satisfied. |
user_data | User data to pass to `callback` . |

### goa_oauth2_based_proxy_new_finish ()

    GoaOAuth2Based *
    goa_oauth2_based_proxy_new_finish (GAsyncResult *res,
                                       GError **error);

Finishes an operation started with `goa_oauth2_based_proxy_new()`.

#### Parameters

res | The GAsyncResult obtained from the GAsyncReadyCallback passed to `goa_oauth2_based_proxy_new()`. |
error | Return location for error or `NULL` |

#### Returns

The constructed proxy object or `NULL` if `error` is set.

[transfer full][type GoaOAuth2BasedProxy]

### goa_oauth2_based_proxy_new_sync ()

    GoaOAuth2Based *
    goa_oauth2_based_proxy_new_sync (GDBusConnection *connection,
                                     GDBusProxyFlags flags,
                                     const gchar *name,
                                     const gchar *object_path,
                                     GCancellable *cancellable,
                                     GError **error);

Synchronously creates a proxy for the D-Bus interface org.gnome.OnlineAccounts.OAuth2Based. See `g_dbus_proxy_new_sync()` for more details.

The calling thread is blocked until a reply is received.

See `goa_oauth2_based_proxy_new()` for the asynchronous version of this constructor.

#### Parameters

connection | A GDBusConnection. |
flags | Flags from the GDBusProxyFlags enumeration. |
name | A bus name (well-known or unique) or `NULL` if `connection` is not a message bus connection. | [nullable]
object_path | An object path. |
cancellable | A GCancellable or `NULL`. | [nullable]
error | Return location for error or `NULL` |

#### Returns

The constructed proxy object or `NULL` if `error` is set.

[transfer full][type GoaOAuth2BasedProxy]

### goa_oauth2_based_proxy_new_for_bus ()

    void
    goa_oauth2_based_proxy_new_for_bus (GBusType bus_type,
                                        GDBusProxyFlags flags,
                                        const gchar *name,
                                        const gchar *object_path,
                                        GCancellable *cancellable,
                                        GAsyncReadyCallback callback,
                                        gpointer user_data);

Like `goa_oauth2_based_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. You can then call `goa_oauth2_based_proxy_new_for_bus_finish()` to get the result of the operation.

See `goa_oauth2_based_proxy_new_for_bus_sync()` for the synchronous, blocking version of this constructor.

#### Parameters

bus_type | A GBusType. |
flags | Flags from the GDBusProxyFlags enumeration. |
name | A bus name (well-known or unique). |
object_path | An object path. |
cancellable | A GCancellable or `NULL`. | [nullable]
callback | A GAsyncReadyCallback to call when the request is satisfied. |
user_data | User data to pass to `callback` . |

### goa_oauth2_based_proxy_new_for_bus_finish ()

    GoaOAuth2Based *
    goa_oauth2_based_proxy_new_for_bus_finish
                                   (GAsyncResult *res,
                                    GError **error);

Finishes an operation started with `goa_oauth2_based_proxy_new_for_bus()`.

#### Parameters

res | The GAsyncResult obtained from the GAsyncReadyCallback passed to `goa_oauth2_based_proxy_new_for_bus()`. |
error | Return location for error or `NULL` |

#### Returns

The constructed proxy object or `NULL` if `error` is set.

[transfer full][type GoaOAuth2BasedProxy]

### goa_oauth2_based_proxy_new_for_bus_sync ()

    GoaOAuth2Based *
    goa_oauth2_based_proxy_new_for_bus_sync
                                   (GBusType bus_type,
                                    GDBusProxyFlags flags,
                                    const gchar *name,
                                    const gchar *object_path,
                                    GCancellable *cancellable,
                                    GError **error);

Like `goa_oauth2_based_proxy_new_sync()` but takes a GBusType instead of a GDBusConnection.

The calling thread is blocked until a reply is received.

See `goa_oauth2_based_proxy_new_for_bus()` for the asynchronous version of this constructor.

#### Parameters

bus_type | A GBusType. |
flags | Flags from the GDBusProxyFlags enumeration. |
name | A bus name (well-known or unique). |
object_path | An object path. |
cancellable | A GCancellable or `NULL`. | [nullable]
error | Return location for error or `NULL` |

#### Returns

The constructed proxy object or `NULL` if `error` is set.

[transfer full][type GoaOAuth2BasedProxy]

### goa_oauth2_based_skeleton_new ()

    GoaOAuth2Based *
    goa_oauth2_based_skeleton_new (void);

Creates a skeleton object for the D-Bus interface org.gnome.OnlineAccounts.OAuth2Based.

#### Returns

The skeleton object.

[transfer full][type GoaOAuth2BasedSkeleton]

## Types and Values

### GoaOAuth2Based

    typedef struct _GoaOAuth2Based GoaOAuth2Based;

Abstract interface type for the D-Bus interface org.gnome.OnlineAccounts.OAuth2Based.

### struct GoaOAuth2BasedIface

    struct GoaOAuth2BasedIface {
      GTypeInterface parent_iface;

      gboolean (*handle_get_access_token) (
        GoaOAuth2Based *object,
        GDBusMethodInvocation *invocation);

      const gchar * (*get_client_id) (GoaOAuth2Based *object);

      const gchar * (*get_client_secret) (GoaOAuth2Based *object);
    };

Virtual table for the D-Bus interface org.gnome.OnlineAccounts.OAuth2Based.

#### Members

GTypeInterface `parent_iface`; | The parent interface. |
`handle_get_access_token` () | Handler for the “handle-get-access-token” signal. |
`get_client_id` () | Getter for the “client-id” property. |
`get_client_secret` () | Getter for the “client-secret” property. |

### struct GoaOAuth2BasedProxy

    struct GoaOAuth2BasedProxy;

The GoaOAuth2BasedProxy structure contains only private data and should only be accessed using the provided API.

### struct GoaOAuth2BasedProxyClass

    struct GoaOAuth2BasedProxyClass {
      GDBusProxyClass parent_class;
    };

Class structure for GoaOAuth2BasedProxy.

#### Members

### struct GoaOAuth2BasedSkeleton

    struct GoaOAuth2BasedSkeleton;

The GoaOAuth2BasedSkeleton structure contains only private data and should only be accessed using the provided API.

### struct GoaOAuth2BasedSkeletonClass

    struct GoaOAuth2BasedSkeletonClass {
      GDBusInterfaceSkeletonClass parent_class;
    };

Class structure for GoaOAuth2BasedSkeleton.

#### Members

## Property Details

### The `“client-id”` property

      “client-id”                gchar *

Represents the D-Bus property "ClientId".

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.

Owner: GoaOAuth2Based

Flags: Read / Write

Default value: NULL

### The `“client-secret”` property

      “client-secret”            gchar *

Represents the D-Bus property "ClientSecret".

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.

Owner: GoaOAuth2Based

Flags: Read / Write

Default value: NULL

## Signal Details

### The `“handle-get-access-token”` signal

    gboolean
    user_function (GoaOAuth2Based        *object,
                   GDBusMethodInvocation *invocation,
                   gpointer               user_data)

Signal emitted when a remote caller is invoking the `GetAccessToken()` D-Bus method.

If a signal handler returns `TRUE`, it means the signal handler will handle the invocation (e.g. take a reference to `invocation` and eventually call `goa_oauth2_based_complete_get_access_token()` or e.g. `g_dbus_method_invocation_return_error()` on it) and no order signal handlers will run. If no signal handler handles the invocation, the `G_DBUS_ERROR_UNKNOWN_METHOD` error is returned.

#### Parameters

object | A GoaOAuth2Based. |
invocation | A GDBusMethodInvocation. |
user_data | user data set when the signal handler was connected. |

#### Returns

`TRUE` if the invocation was handled, `FALSE` to let other signal handlers run.

Flags: Run Last