EGDataSession: Evolution-Data-Server Reference Manual

## EGDataSession EGDataSession — A GData (Google Data) session |

## Functions

gboolean | (*EGDataObjectCallback) ()
EGDataSession * | e_gdata_session_new ()
const gchar * | e_gdata_tasklist_get_id ()
void | e_gdata_tasklist_add_id ()
const gchar * | e_gdata_tasklist_get_etag ()
const gchar * | e_gdata_tasklist_get_title ()
void | e_gdata_tasklist_add_title ()
const gchar * | e_gdata_tasklist_get_self_link ()
gint64 | e_gdata_tasklist_get_updated ()
gboolean | e_gdata_session_tasklists_delete_sync ()
gboolean | e_gdata_session_tasklists_get_sync ()
gboolean | e_gdata_session_tasklists_insert_sync ()
gboolean | e_gdata_session_tasklists_list_sync ()
gboolean | e_gdata_session_tasklists_patch_sync ()
gboolean | e_gdata_session_tasklists_update_sync ()
const gchar * | e_gdata_task_get_id ()
void | e_gdata_task_add_id ()
const gchar * | e_gdata_task_get_etag ()
const gchar * | e_gdata_task_get_title ()
void | e_gdata_task_add_title ()
gint64 | e_gdata_task_get_updated ()
const gchar * | e_gdata_task_get_self_link ()
const gchar * | e_gdata_task_get_parent ()
const gchar * | e_gdata_task_get_position ()
const gchar * | e_gdata_task_get_notes ()
void | e_gdata_task_add_notes ()
EGDataTaskStatus | e_gdata_task_get_status ()
void | e_gdata_task_add_status ()
gint64 | e_gdata_task_get_due ()
void | e_gdata_task_add_due ()
gint64 | e_gdata_task_get_completed ()
void | e_gdata_task_add_completed ()
gboolean | e_gdata_task_get_deleted ()
gboolean | e_gdata_task_get_hidden ()
gboolean | e_gdata_session_tasks_clear_sync ()
gboolean | e_gdata_session_tasks_delete_sync ()
gboolean | e_gdata_session_tasks_get_sync ()
gboolean | e_gdata_session_tasks_insert_sync ()
gboolean | e_gdata_session_tasks_list_sync ()
gboolean | e_gdata_session_tasks_move_sync ()
gboolean | e_gdata_session_tasks_patch_sync ()
gboolean | e_gdata_session_tasks_update_sync ()

## Types and Values

struct | EGDataSession
enum | EGDataTaskStatus

## Object Hierarchy

        GObject
        ╰── SoupSession
            ╰── ESoupSession
                ╰── EGDataSession

## Includes

    #include <libedataserver/libedataserver.h>

## Description

The EGDataSession is a class to work with Google's GData API.

## Functions

### EGDataObjectCallback ()

    gboolean
    (*EGDataObjectCallback) (EGDataSession *gdata,
                             JsonObject *object,
                             gpointer user_data);

Callback used to traverse response from the server, which is an array.

#### Parameters

gdata | an EGDataSession |
object | a JSonObject with received content |
user_data | user data passed to the call |

#### Returns

whether the traverse can continue

Since: 3.46

### e_gdata_session_new ()

    EGDataSession *
    e_gdata_session_new (ESource *source);

Creates a new EGDataSession associated with the given `source` .

#### Parameters

source | an ESource |

#### Returns

a new EGDataSession; free it with `g_object_unref()`, when no longer needed.

[transfer full]

Since: 3.46

### e_gdata_tasklist_get_id ()

    const gchar *
    e_gdata_tasklist_get_id (JsonObject *tasklist);

Returns TaskList::id property.

#### Parameters

tasklist | a GData TaskList |

#### Returns

TaskList::id property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_tasklist_add_id ()

    void
    e_gdata_tasklist_add_id (JsonBuilder *builder,
                             const gchar *value);

Adds a TaskList::id property `value` into the `builder` , which should have started an object member.

#### Parameters

builder | a JsonBuilder with a started object member |
value | a TaskList::id property value |

Since: 3.46

### e_gdata_tasklist_get_etag ()

    const gchar *
    e_gdata_tasklist_get_etag (JsonObject *tasklist);

Returns TaskList::etag property.

#### Parameters

tasklist | a GData TaskList |

#### Returns

TaskList::etag property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_tasklist_get_title ()

    const gchar *
    e_gdata_tasklist_get_title (JsonObject *tasklist);

Returns TaskList::title property.

#### Parameters

tasklist | a GData TaskList |

#### Returns

TaskList::title property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_tasklist_add_title ()

    void
    e_gdata_tasklist_add_title (JsonBuilder *builder,
                                const gchar *value);

Adds a TaskList::title property `value` into the `builder` , which should have started an object member.

#### Parameters

builder | a JsonBuilder with a started object member |
value | a TaskList::title property value |

Since: 3.46

### e_gdata_tasklist_get_self_link ()

    const gchar *
    e_gdata_tasklist_get_self_link (JsonObject *tasklist);

Returns TaskList::selfLink property.

#### Parameters

tasklist | a GData TaskList |

#### Returns

TaskList::selfLink property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_tasklist_get_updated ()

    gint64
    e_gdata_tasklist_get_updated (JsonObject *tasklist);

Returns TaskList::updated property, as Unix time.

#### Parameters

tasklist | a GData TaskList |

#### Returns

TaskList::updated property or 0, when not found

Since: 3.46

### e_gdata_session_tasklists_delete_sync ()

    gboolean
    e_gdata_session_tasklists_delete_sync (EGDataSession *self,
                                           const gchar *tasklist_id,
                                           GCancellable *cancellable,
                                           GError **error);

Deletes a task list `tasklist_id` .

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasklists_get_sync ()

    gboolean
    e_gdata_session_tasklists_get_sync (EGDataSession *self,
                                        const gchar *tasklist_id,
                                        JsonObject **out_tasklist,
                                        GCancellable *cancellable,
                                        GError **error);

Gets a task list `tasklist_id` and returns it as a JsonObject, which should be freed with `json_object_unref()`, when no longer needed.

There can be used `e_gdata_tasklist_get_id()`, `e_gdata_tasklist_get_etag()`, `e_gdata_tasklist_get_title()`, `e_gdata_tasklist_get_self_link()`, `e_gdata_tasklist_get_updated()` to read the properties of the task list.

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
out_tasklist | tasklist object. | [out][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasklists_insert_sync ()

    gboolean
    e_gdata_session_tasklists_insert_sync (EGDataSession *self,
                                           const gchar *title,
                                           JsonObject **out_inserted_tasklist,
                                           GCancellable *cancellable,
                                           GError **error);

Creates a new task list, titled `title` . The `out_inserted_tasklist` should be freed with `json_object_unref()`, when no longer needed.

#### Parameters

self | an EGDataSession |
title | title to set |
out_inserted_tasklist | the created task list. | [out][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasklists_list_sync ()

    gboolean
    e_gdata_session_tasklists_list_sync (EGDataSession *self,
                                         EGDataQuery *query,
                                         EGDataObjectCallback cb,
                                         gpointer user_data,
                                         GCancellable *cancellable,
                                         GError **error);

Lists all configured task lists for the user, calling the `cb` for each of them.

#### Parameters

self | an EGDataSession |
query | an EGDataQuery to limit returned task lists, or `NULL`. | [nullable]
cb | an EGDataObjectCallback to call for each found task list. | [scope call][closure user_data]
user_data | user data passed to the `cb` |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasklists_patch_sync ()

    gboolean
    e_gdata_session_tasklists_patch_sync (EGDataSession *self,
                                          const gchar *tasklist_id,
                                          JsonBuilder *tasklist_properties,
                                          JsonObject **out_patched_tasklist,
                                          GCancellable *cancellable,
                                          GError **error);

Changes properties of a task list `tasklist_id` .

If not `NULL`, free the `out_patched_tasklist` with `json_object_unref()`, when no longer needed.

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
tasklist_properties | task list properties to change |
out_patched_tasklist | where to store patched task list, or `NULL`. | [out][optional][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasklists_update_sync ()

    gboolean
    e_gdata_session_tasklists_update_sync (EGDataSession *self,
                                           const gchar *tasklist_id,
                                           JsonBuilder *tasklist,
                                           JsonObject **out_updated_tasklist,
                                           GCancellable *cancellable,
                                           GError **error);

Updates a task list `tasklist_id` with values from the `tasklist` .

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
tasklist | task list object to update the task list with |
out_updated_tasklist | where to store updated task list, or `NULL`. | [out][optional][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_task_get_id ()

    const gchar *
    e_gdata_task_get_id (JsonObject *task);

Returns Task::id property.

#### Parameters

task | a GData Task |

#### Returns

Task::id property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_task_add_id ()

    void
    e_gdata_task_add_id (JsonBuilder *builder,
                         const gchar *value);

Adds a Task::id property `value` into the `builder` , which should have started an object member.

#### Parameters

builder | a JsonBuilder with a started object member |
value | a Task::id property value |

Since: 3.46

### e_gdata_task_get_etag ()

    const gchar *
    e_gdata_task_get_etag (JsonObject *task);

Returns Task::etag property.

#### Parameters

task | a GData Task |

#### Returns

Task::etag property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_task_get_title ()

    const gchar *
    e_gdata_task_get_title (JsonObject *task);

Returns Task::title property.

#### Parameters

task | a GData Task |

#### Returns

Task::title property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_task_add_title ()

    void
    e_gdata_task_add_title (JsonBuilder *builder,
                            const gchar *value);

Adds a Task::title property `value` into the `builder` , which should have started an object member.

#### Parameters

builder | a JsonBuilder with a started object member |
value | a Task::title property value |

Since: 3.46

### e_gdata_task_get_updated ()

    gint64
    e_gdata_task_get_updated (JsonObject *task);

Returns Task::updated property, as Unix time.

#### Parameters

task | a GData Task |

#### Returns

Task::updated property or 0, when not found

Since: 3.46

### e_gdata_task_get_self_link ()

    const gchar *
    e_gdata_task_get_self_link (JsonObject *task);

Returns Task::selfLink property.

#### Parameters

task | a GData TaskList |

#### Returns

Task::selfLink property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_task_get_parent ()

    const gchar *
    e_gdata_task_get_parent (JsonObject *task);

Returns Task::parent property.

#### Parameters

task | a GData Task |

#### Returns

Task::parent property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_task_get_position ()

    const gchar *
    e_gdata_task_get_position (JsonObject *task);

Returns Task::position property.

#### Parameters

task | a GData Task |

#### Returns

Task::position property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_task_get_notes ()

    const gchar *
    e_gdata_task_get_notes (JsonObject *task);

Returns Task::notes property.

#### Parameters

task | a GData Task |

#### Returns

Task::notes property or `NULL`, when not found.

[transfer none][nullable]

Since: 3.46

### e_gdata_task_add_notes ()

    void
    e_gdata_task_add_notes (JsonBuilder *builder,
                            const gchar *value);

Adds a Task::notes property `value` into the `builder` , which should have started an object member.

When the `value` is `NULL`, then adds a NULL-object, to indicate removal of the property.

#### Parameters

builder | a JsonBuilder with a started object member |
value | a Task::notes property value. | [nullable]

Since: 3.46

### e_gdata_task_get_status ()

    EGDataTaskStatus
    e_gdata_task_get_status (JsonObject *task);

Returns Task::status property.

#### Parameters

task | a GData Task |

#### Returns

Task::status property as EGDataTaskStatus or `E_GDATA_TASK_STATUS_UNKNOWN`, when not found or has set an unknown value.

Since: 3.46

### e_gdata_task_add_status ()

    void
    e_gdata_task_add_status (JsonBuilder *builder,
                             EGDataTaskStatus value);

Adds a Task::status property `value` into the `builder` , which should have started an object member.

When the `value` is `E_GDATA_TASK_STATUS_UNKNOWN`, then adds a NULL-object, to indicate removal of the property.

#### Parameters

builder | a JsonBuilder with a started object member |
value | a Task::status property value |

Since: 3.46

### e_gdata_task_get_due ()

    gint64
    e_gdata_task_get_due (JsonObject *task);

Returns Task::due property, as Unix time.

#### Parameters

task | a GData Task |

#### Returns

Task::due property or 0, when not found

Since: 3.46

### e_gdata_task_add_due ()

    void
    e_gdata_task_add_due (JsonBuilder *builder,
                          gint64 value);

Adds a Task::due property `value` into the `builder` , which should have started an object member.

When the `value` is 0, then adds a NULL-object, to indicate removal of the property.

#### Parameters

builder | a JsonBuilder with a started object member |
value | a Task::due property value, as Unix time |

Since: 3.46

### e_gdata_task_get_completed ()

    gint64
    e_gdata_task_get_completed (JsonObject *task);

Returns Task::completed property, as Unix time.

#### Parameters

task | a GData Task |

#### Returns

Task::completed property or 0, when not found

Since: 3.46

### e_gdata_task_add_completed ()

    void
    e_gdata_task_add_completed (JsonBuilder *builder,
                                gint64 value);

Adds a Task:completed property `value` into the `builder` , which should have started an object member.

When the `value` is 0, then adds a NULL-object, to indicate removal of the property.

#### Parameters

builder | a JsonBuilder with a started object member |
value | a Task::completed property value, as Unix time |

Since: 3.46

### e_gdata_task_get_deleted ()

    gboolean
    e_gdata_task_get_deleted (JsonObject *task);

Returns Task::deleted property, as Unix time.

#### Parameters

task | a GData Task |

#### Returns

Task::deleted property or `FALSE`, when not found

Since: 3.46

### e_gdata_task_get_hidden ()

    gboolean
    e_gdata_task_get_hidden (JsonObject *task);

Returns Task::hidden property, as Unix time.

#### Parameters

task | a GData Task |

#### Returns

Task::hidden property or `FALSE`, when not found

Since: 3.46

### e_gdata_session_tasks_clear_sync ()

    gboolean
    e_gdata_session_tasks_clear_sync (EGDataSession *self,
                                      const gchar *tasklist_id,
                                      GCancellable *cancellable,
                                      GError **error);

Clears all completed tasks from the task list `tasklist_id` . The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list.

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasks_delete_sync ()

    gboolean
    e_gdata_session_tasks_delete_sync (EGDataSession *self,
                                       const gchar *tasklist_id,
                                       const gchar *task_id,
                                       GCancellable *cancellable,
                                       GError **error);

Deletes a task `task_id` from a task list `tasklist_id` .

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
task_id | id of a task |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasks_get_sync ()

    gboolean
    e_gdata_session_tasks_get_sync (EGDataSession *self,
                                    const gchar *tasklist_id,
                                    const gchar *task_id,
                                    JsonObject **out_task,
                                    GCancellable *cancellable,
                                    GError **error);

Gets a task `task_id` from a task list `tasklist_id` and returns it as a JsonObject, which should be freed with `json_object_unref()`, when no longer needed.

There can be used `e_gdata_task_get_id()`, `e_gdata_task_get_etag()`, `e_gdata_task_get_title()` and other e_gdata_task_... functions to read the properties of the task.

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
task_id | id of a task |
out_task | task object. | [out][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasks_insert_sync ()

    gboolean
    e_gdata_session_tasks_insert_sync (EGDataSession *self,
                                       const gchar *tasklist_id,
                                       JsonBuilder *task,
                                       const gchar *parent_task_id,
                                       const gchar *previous_task_id,
                                       JsonObject **out_inserted_task,
                                       GCancellable *cancellable,
                                       GError **error);

Creates a new task `task` in the task list `tasklist_id` . The `out_inserted_task` should be freed with `json_object_unref()`, when no longer needed.

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
task | a JsonBuilder with the task object |
parent_task_id | parent task identifier, or `NULL` to create at the top-level. | [nullable]
previous_task_id | previous sibling task identifier, or `NULL` to create at the first position among its siblings. | [nullable]
out_inserted_task | the created task. | [out][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasks_list_sync ()

    gboolean
    e_gdata_session_tasks_list_sync (EGDataSession *self,
                                     const gchar *tasklist_id,
                                     EGDataQuery *query,
                                     EGDataObjectCallback cb,
                                     gpointer user_data,
                                     GCancellable *cancellable,
                                     GError **error);

Lists all tasks in the task list `tasklist_id` , calling the `cb` for each of them.

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
query | an EGDataQuery to limit returned tasks, or `NULL`. | [nullable]
cb | an EGDataObjectCallback to call for each found task. | [scope call][closure user_data]
user_data | user data passed to the `cb` |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasks_move_sync ()

    gboolean
    e_gdata_session_tasks_move_sync (EGDataSession *self,
                                     const gchar *tasklist_id,
                                     const gchar *task_id,
                                     const gchar *parent_task_id,
                                     const gchar *previous_task_id,
                                     GCancellable *cancellable,
                                     GError **error);

Moves the specified task `task_id` to another position in the task list `tasklist_id` . This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
task_id | id of a task |
parent_task_id | parent task identifier, or `NULL` to move at the top-level. | [nullable]
previous_task_id | previous sibling task identifier, or `NULL` to move at the first position among its siblings. | [nullable]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasks_patch_sync ()

    gboolean
    e_gdata_session_tasks_patch_sync (EGDataSession *self,
                                      const gchar *tasklist_id,
                                      const gchar *task_id,
                                      JsonBuilder *task_properties,
                                      JsonObject **out_patched_task,
                                      GCancellable *cancellable,
                                      GError **error);

Changes properties `task_properties` of a task `task_id` in the task list `tasklist_id` .

If not `NULL`, free the `out_patched_task` with `json_object_unref()`, when no longer needed.

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
task_id | id of a task |
task_properties | task properties to change |
out_patched_task | where to set patches task, or `NULL`. | [out][optional][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

### e_gdata_session_tasks_update_sync ()

    gboolean
    e_gdata_session_tasks_update_sync (EGDataSession *self,
                                       const gchar *tasklist_id,
                                       const gchar *task_id,
                                       JsonBuilder *task,
                                       JsonObject **out_updated_task,
                                       GCancellable *cancellable,
                                       GError **error);

Updates a task `task_id` in a task list `tasklist_id` to the values from the `task` .

#### Parameters

self | an EGDataSession |
tasklist_id | id of a task list |
task_id | id of a task |
task | task object to update the task with |
out_updated_task | where to store updated task, or `NULL`. | [out][optional][transfer full]
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

whether succeeded

Since: 3.46

## Types and Values

### struct EGDataSession

    struct EGDataSession;

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

Since: 3.46

### enum EGDataTaskStatus

Holds status of a task.

#### Members

E_GDATA_TASK_STATUS_UNKNOWN | unknown status |
E_GDATA_TASK_STATUS_NEEDS_ACTION | the task needs action |
E_GDATA_TASK_STATUS_COMPLETED | the task is completed |

Since: 3.46