ESourceResource

## ESourceResource ESourceResource — ESource extension for a remote resource |

## Synopsis

    #include <libedataserver/libedataserver.h>

    struct              ESourceResource;
    #define             E_SOURCE_EXTENSION_RESOURCE
    const gchar *       e_source_resource_get_identity      (ESourceResource *extension);
    gchar *             e_source_resource_dup_identity      (ESourceResource *extension);
    void                e_source_resource_set_identity      (ESourceResource *extension,
                                                             const gchar *identity);

## Object Hierarchy

      GObject
       +----ESourceExtension
             +----ESourceResource

## Properties

      "identity"                 gchar*                : Read / Write / Construct

## Description

The ESourceResource extension holds the server-assigned identity of a remote calendar, address book, or whatever else an ESource can represent.

This extension is typically used by an ECollectionBackend to note a server-assigned resource identity in an ESource. Then in a later session, after querying the server for available resources, a resource identity can be paired with the same ESource "uid" from the previous session, allowing locally cached data from the previous session to be reused.

Access the extension as follows:

    1
    2
    3
    4
    5
    #include <libedataserver/libedataserver.h>

    ESourceResource *extension;

    extension = e_source_get_extension (source, E_SOURCE_EXTENSION_RESOURCE);

## Details

### struct ESourceResource

    struct ESourceResource;

Contains only private data that should be read and manipulated using the functions below.

Since 3.6

### E_SOURCE_EXTENSION_RESOURCE

    #define E_SOURCE_EXTENSION_RESOURCE "Resource"

Pass this extension name to `e_source_get_extension()` to access ESourceResource. This is also used as a group name in key files.

Since 3.6

### e_source_resource_get_identity ()

    const gchar *       e_source_resource_get_identity      (ESourceResource *extension);

Returns the server-assigned identity of the remote resource associated with the ESource to which `extension` belongs.

`extension` : | an ESourceResource
Returns : | the identity of a remote resource

Since 3.6

### e_source_resource_dup_identity ()

    gchar *             e_source_resource_dup_identity      (ESourceResource *extension);

Thread-safe variation of `e_source_resource_get_identity()`. Use this function when accessing `extension` from multiple threads.

The returned string should be freed with `g_free()` when no longer needed.

`extension` : | an ESourceResource
Returns : | a newly-allocated copy of "identity"

Since 3.6

### e_source_resource_set_identity ()

    void                e_source_resource_set_identity      (ESourceResource *extension,
                                                             const gchar *identity);

Sets the server-assigned identity of the remote resource associated with the ESource to which `extension` belongs.

The internal copy of `identity` is automatically stripped of leading and trailing whitespace. If the resulting string is empty, `NULL` is set instead.

`extension` : | an ESourceResource
`identity` : | the identity of a remote resource. [allow-none]

Since 3.6

## Property Details

### The `"identity"` property

      "identity"                 gchar*                : Read / Write / Construct

Resource identity.

Default value: NULL