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

## Functions

const gchar * | e_source_resource_get_identity ()
gchar * | e_source_resource_dup_identity ()
void | e_source_resource_set_identity ()

## Types and Values

#define | E_SOURCE_EXTENSION_RESOURCE
struct | ESourceResource
struct | ESourceResourceClass

## Includes

    #include <libedataserver/libedataserver.h>

## 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);

## Functions

### 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.

#### Parameters

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.

#### Parameters

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.

#### Parameters

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

Since: 3.6

## Types and Values

### 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

### struct ESourceResource

    struct ESourceResource {
    	ESourceExtension parent;
    	ESourceResourcePrivate *priv;
    };

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

Since: 3.6

### struct ESourceResourceClass

    struct ESourceResourceClass {
    	ESourceExtensionClass parent_class;
    };