Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GDataBatchOperation: GData Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GData Reference Manual">
<link rel="up" href="ch04.html" title="Batch Operation API">
<link rel="prev" href="GDataBatchable.html" title="GDataBatchable">
<link rel="next" href="ch05.html" title="Authentication/Authorization API">
<meta name="generator" content="GTK-Doc V1.26.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GDataBatchOperation.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GDataBatchOperation.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#GDataBatchOperation.properties" class="shortcut">Properties</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch04.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GDataBatchable.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="ch05.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GDataBatchOperation"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GDataBatchOperation.top_of_page"></a>GDataBatchOperation</span></h2>
<p>GDataBatchOperation — GData batch operation object</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GDataBatchOperation.stability-level"></a><h2>Stability Level</h2>
<acronym title="The intention of a Stable interface is to enable arbitrary third parties to
develop applications to these interfaces, release them, and have confidence that
they will run on all minor releases of the product (after the one in which the
interface was introduced, and within the same major release). Even at a major
release, incompatible changes are expected to be rare, and to have strong
justifications.
"><span class="acronym">Stable</span></acronym>, unless otherwise indicated
</div>
<div class="refsect1">
<a name="GDataBatchOperation.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()">*GDataBatchOperationCallback</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-query" title="gdata_batch_operation_add_query ()">gdata_batch_operation_add_query</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-insertion" title="gdata_batch_operation_add_insertion ()">gdata_batch_operation_add_insertion</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-update" title="gdata_batch_operation_add_update ()">gdata_batch_operation_add_update</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-deletion" title="gdata_batch_operation_add_deletion ()">gdata_batch_operation_add_deletion</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()">gdata_batch_operation_run</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run-async" title="gdata_batch_operation_run_async ()">gdata_batch_operation_run_async</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run-finish" title="gdata_batch_operation_run_finish ()">gdata_batch_operation_run_finish</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GDataService.html" title="GDataService"><span class="returnvalue">GDataService</span></a> *
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-get-service" title="gdata_batch_operation_get_service ()">gdata_batch_operation_get_service</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="returnvalue">GDataAuthorizationDomain</span></a> *
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-get-authorization-domain" title="gdata_batch_operation_get_authorization_domain ()">gdata_batch_operation_get_authorization_domain</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-get-feed-uri" title="gdata_batch_operation_get_feed_uri ()">gdata_batch_operation_get_feed_uri</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GDataBatchOperation.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> *</td>
<td class="property_name"><a class="link" href="GDataBatchOperation.html#GDataBatchOperation--authorization-domain" title="The “authorization-domain” property">authorization-domain</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GDataBatchOperation.html#GDataBatchOperation--feed-uri" title="The “feed-uri” property">feed-uri</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> *</td>
<td class="property_name"><a class="link" href="GDataBatchOperation.html#GDataBatchOperation--service" title="The “service” property">service</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GDataBatchOperation.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GDataBatchOperation.html#GDataBatchOperation-struct" title="GDataBatchOperation">GDataBatchOperation</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GDataBatchOperation.html#GDataBatchOperationClass" title="GDataBatchOperationClass">GDataBatchOperationClass</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GDataBatchOperation.html#GDataBatchOperationType" title="enum GDataBatchOperationType">GDataBatchOperationType</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GDataBatchOperation.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="../gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
    <span class="lineart">╰──</span> GDataBatchOperation
</pre>
</div>
<div class="refsect1">
<a name="GDataBatchOperation.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdata/gdata-batch-operation.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GDataBatchOperation.description"></a><h2>Description</h2>
<p><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> is a transient standalone class which represents and handles a single batch operation request to a service. To make a batch
operation request: create a new <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a>; add the required queries, insertions, updates and deletions to the operation using
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-query" title="gdata_batch_operation_add_query ()"><code class="function">gdata_batch_operation_add_query()</code></a>, <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-insertion" title="gdata_batch_operation_add_insertion ()"><code class="function">gdata_batch_operation_add_insertion()</code></a>, <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-update" title="gdata_batch_operation_add_update ()"><code class="function">gdata_batch_operation_add_update()</code></a> and
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-deletion" title="gdata_batch_operation_add_deletion ()"><code class="function">gdata_batch_operation_add_deletion()</code></a>, respectively; run the request with <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a> or <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run-async" title="gdata_batch_operation_run_async ()"><code class="function">gdata_batch_operation_run_async()</code></a>; and
handle the results in the callback functions which are invoked by the operation as the results are received and parsed.</p>
<p>If authorization is required for any of the requests in the batch operation, the <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> set in <a class="link" href="GDataBatchOperation.html#GDataBatchOperation--service" title="The “service” property"><span class="type">“service”</span></a> must have
a <a class="link" href="GDataAuthorizer.html" title="GDataAuthorizer"><span class="type">GDataAuthorizer</span></a> set as its <a class="link" href="GDataService.html#GDataService--authorizer" title="The “authorizer” property"><span class="type">“authorizer”</span></a> property, and that authorizer must be authorized for the <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> set
in <a class="link" href="GDataBatchOperation.html#GDataBatchOperation--authorization-domain" title="The “authorization-domain” property"><span class="type">“authorization-domain”</span></a>. It's not possible for requests in a single batch operation to be authorized under multiple domains;
in that case, the requests must be split up across several batch operations using different authorization domains.</p>
<p>If all of the requests in the batch operation don't require authorization (i.e. they all operate on public data; see the documentation for the
<a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> subclass in question's operations for details of which require authorization), <a class="link" href="GDataBatchOperation.html#GDataBatchOperation--authorization-domain" title="The “authorization-domain” property"><span class="type">“authorization-domain”</span></a> can be set
to <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to save the overhead of sending authorization data to the online service.</p>
<div class="example">
<a name="id-1.3.4.3.9.5"></a><p class="title"><b>Example 5. Running a Synchronous Operation</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="usertype">guint</span><span class="normal"> op_id</span><span class="symbol">,</span><span class="normal"> op_id2</span><span class="symbol">;</span>
<span class="usertype">GDataBatchOperation</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">operation</span><span class="symbol">;</span>
<span class="usertype">GDataContactsContact</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">contact</span><span class="symbol">;</span>
<span class="usertype">GDataService</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">service</span><span class="symbol">;</span>
<span class="usertype">GDataAuthorizationDomain</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">domain</span><span class="symbol">;</span>

<span class="normal">service </span><span class="symbol">=</span><span class="normal"> </span><span class="function">create_contacts_service</span><span class="normal"> </span><span class="symbol">();</span>
<span class="normal">domain </span><span class="symbol">=</span><span class="normal"> </span><span class="function">get_authorization_domain_from_service</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service</span><span class="symbol">);</span>
<span class="normal">contact </span><span class="symbol">=</span><span class="normal"> </span><span class="function">create_new_contact</span><span class="normal"> </span><span class="symbol">();</span>
<span class="normal">batch_link </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDataFeed.html#gdata-feed-look-up-link">gdata_feed_look_up_link</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">contacts_feed</span><span class="symbol">,</span><span class="normal"> <a href="GDataLink.html#GDATA-LINK-BATCH:CAPS">GDATA_LINK_BATCH</a></span><span class="symbol">);</span>

<span class="normal">operation </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDataBatchable.html#gdata-batchable-create-operation">gdata_batchable_create_operation</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GDATA_BATCHABLE</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service</span><span class="symbol">),</span><span class="normal"> domain</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="GDataLink.html#gdata-link-get-uri">gdata_link_get_uri</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">batch_link</span><span class="symbol">));</span>

<span class="comment">/* Add to the operation to insert a new contact and query for another one */</span>
<span class="normal">op_id </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDataBatchOperation.html#gdata-batch-operation-add-insertion">gdata_batch_operation_add_insertion</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">operation</span><span class="symbol">,</span><span class="normal"> </span><span class="function">GDATA_ENTRY</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">contact</span><span class="symbol">),</span><span class="normal"> insertion_cb</span><span class="symbol">,</span><span class="normal"> user_data</span><span class="symbol">);</span>
<span class="normal">op_id2 </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GDataBatchOperation.html#gdata-batch-operation-add-query">gdata_batch_operation_add_query</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">operation</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="GDataEntry.html#gdata-entry-get-id">gdata_entry_get_id</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">other_contact</span><span class="symbol">),</span><span class="normal"> GDATA_TYPE_CONTACTS_CONTACT</span><span class="symbol">,</span><span class="normal"> query_cb</span><span class="symbol">,</span><span class="normal"> user_data</span><span class="symbol">);</span>

<span class="function"><a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">contact</span><span class="symbol">);</span>
<span class="function"><a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">domain</span><span class="symbol">);</span>
<span class="function"><a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">service</span><span class="symbol">);</span>

<span class="comment">/* Run the operations in a blocking fashion. Ideally, check and free the error as appropriate after running the operation. */</span>
<span class="function"><a href="GDataBatchOperation.html#gdata-batch-operation-run">gdata_batch_operation_run</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">operation</span><span class="symbol">,</span><span class="normal"> <a href="../glib/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">error</span><span class="symbol">);</span>

<span class="function"><a href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">operation</span><span class="symbol">);</span>

<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">insertion_cb</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">guint</span><span class="normal"> operation_id</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GDataBatchOperationType</span><span class="normal"> operation_type</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GDataEntry</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">entry</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GError</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">error</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> user_data</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">    </span><span class="comment">/* operation_id == op_id, operation_type == GDATA_BATCH_OPERATION_INSERTION */</span>

<span class="normal">    </span><span class="comment">/* Process the new inserted entry, ideally after checking for errors. Note that the entry should be reffed if it needs to stay</span>
<span class="comment">     * alive after execution of the callback finishes. */</span>
<span class="normal">    </span><span class="function">process_inserted_entry</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">entry</span><span class="symbol">,</span><span class="normal"> user_data</span><span class="symbol">);</span>
<span class="cbracket">}</span>

<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span>
<span class="function">query_cb</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">guint</span><span class="normal"> operation_id</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GDataBatchOperationType</span><span class="normal"> operation_type</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GDataEntry</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">entry</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">GError</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">error</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> user_data</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">    </span><span class="comment">/* operation_id == op_id2, operation_type == GDATA_BATCH_OPERATION_QUERY */</span>

<span class="normal">    </span><span class="comment">/* Process the results of the query, ideally after checking for errors. Note that the entry should be reffed if it needs to</span>
<span class="comment">     * stay alive after execution of the callback finishes. */</span>
<span class="normal">    </span><span class="function">process_queried_entry</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">entry</span><span class="symbol">,</span><span class="normal"> user_data</span><span class="symbol">);</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<br class="example-break">
</div>
<div class="refsect1">
<a name="GDataBatchOperation.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="GDataBatchOperationCallback"></a><h3>GDataBatchOperationCallback ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GDataBatchOperationCallback<span class="c_punctuation">)</span> (<em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> operation_id</code></em>,
                                <em class="parameter"><code><a class="link" href="GDataBatchOperation.html#GDataBatchOperationType" title="enum GDataBatchOperationType"><span class="type">GDataBatchOperationType</span></a> operation_type</code></em>,
                                <em class="parameter"><code><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> *entry</code></em>,
                                <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>,
                                <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>Callback function called once for each operation in a batch operation run. The operation is identified by <em class="parameter"><code>operation_id</code></em>
 and <em class="parameter"><code>operation_type</code></em>
 (where
<em class="parameter"><code>operation_id</code></em>
 is the ID returned by the relevant call to <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-query" title="gdata_batch_operation_add_query ()"><code class="function">gdata_batch_operation_add_query()</code></a>, <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-insertion" title="gdata_batch_operation_add_insertion ()"><code class="function">gdata_batch_operation_add_insertion()</code></a>,
<a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-update" title="gdata_batch_operation_add_update ()"><code class="function">gdata_batch_operation_add_update()</code></a> or <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-deletion" title="gdata_batch_operation_add_deletion ()"><code class="function">gdata_batch_operation_add_deletion()</code></a>, and <em class="parameter"><code>operation_type</code></em>
 shows which one of the above was called).</p>
<p>If the operation was successful, the resulting <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> will be passed in as <em class="parameter"><code>entry</code></em>
, and <em class="parameter"><code>error</code></em>
 will be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Otherwise, <em class="parameter"><code>entry</code></em>
 will be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
and a descriptive error will be in <em class="parameter"><code>error</code></em>
. If <em class="parameter"><code>operation_type</code></em>
 is <a class="link" href="GDataBatchOperation.html#GDATA-BATCH-OPERATION-DELETION:CAPS"><code class="literal">GDATA_BATCH_OPERATION_DELETION</code></a>, <em class="parameter"><code>entry</code></em>
 will always be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, and <em class="parameter"><code>error</code></em>
 will be
<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> or non-<a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> as appropriate.</p>
<p>If the callback code needs to retain a copy of <em class="parameter"><code>entry</code></em>
, it must be referenced (with <a href="../gobject/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a>). Similarly, <em class="parameter"><code>error</code></em>
 is owned by the calling code,
and must not be freed.</p>
<p>The callback is called in the main thread, and there is no guarantee on the order in which the callbacks for the operations in a run are executed,
or whether they will be called in a timely manner. It is, however, guaranteed that they will all be called before the <span class="type">GAsyncReadyCallback</span> which
signals the completion of the run (if initiated with <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run-async" title="gdata_batch_operation_run_async ()"><code class="function">gdata_batch_operation_run_async()</code></a>) is called; or <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a> returns (if
initiated synchronously).</p>
<div class="refsect3">
<a name="GDataBatchOperationCallback.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>operation_id</p></td>
<td class="parameter_description"><p>the operation ID returned from gdata_batch_operation_add_*()</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>operation_type</p></td>
<td class="parameter_description"><p>the type of operation which was requested</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>entry</p></td>
<td class="parameter_description"><p>the result of the operation, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> describing any error which occurred, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data passed to the callback</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-add-query"></a><h3>gdata_batch_operation_add_query ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gdata_batch_operation_add_query (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>,
                                 <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *id</code></em>,
                                 <em class="parameter"><code><a href="../gobject/gobject-Type-Information.html#GType"><span class="type">GType</span></a> entry_type</code></em>,
                                 <em class="parameter"><code><a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> callback</code></em>,
                                 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>Add a query to the <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a>, to be executed when the operation is run. The query will return a <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> (of subclass type
<em class="parameter"><code>entry_type</code></em>
) representing the given entry <em class="parameter"><code>id</code></em>
. The ID is of the same format as that returned by <a class="link" href="GDataEntry.html#gdata-entry-get-id" title="gdata_entry_get_id ()"><code class="function">gdata_entry_get_id()</code></a>.</p>
<p>Note that a single batch operation should not operate on a given <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> more than once, as there's no guarantee about the order in which the
batch operation's operations will be performed.</p>
<p><em class="parameter"><code>callback</code></em>
 will be called when the <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> is run with <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a> (in which case it will be called in the thread which
ran the batch operation), or with <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run-async" title="gdata_batch_operation_run_async ()"><code class="function">gdata_batch_operation_run_async()</code></a> (in which case it will be called in an idle handler in the main thread). The
<em class="parameter"><code>operation_id</code></em>
 passed to the callback will match the return value of <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-query" title="gdata_batch_operation_add_query ()"><code class="function">gdata_batch_operation_add_query()</code></a>, and the <em class="parameter"><code>operation_type</code></em>
 will be
<a class="link" href="GDataBatchOperation.html#GDATA-BATCH-OPERATION-QUERY:CAPS"><code class="literal">GDATA_BATCH_OPERATION_QUERY</code></a>. If the query was successful, the resulting entry will be passed to the callback function as <em class="parameter"><code>entry</code></em>
, and <em class="parameter"><code>error</code></em>
 will
be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. If, however, the query was unsuccessful, <em class="parameter"><code>entry</code></em>
 will be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and <em class="parameter"><code>error</code></em>
 will contain a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> detailing what went wrong.</p>
<div class="refsect3">
<a name="gdata-batch-operation-add-query.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>id</p></td>
<td class="parameter_description"><p>the ID of the entry being queried for</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>entry_type</p></td>
<td class="parameter_description"><p>the type of the entry which will be returned</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> to call when the query is finished, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>data to pass to the <em class="parameter"><code>callback</code></em>
function. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-add-query.returns"></a><h4>Returns</h4>
<p> operation ID for the added query, or <code class="code">0</code></p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-add-insertion"></a><h3>gdata_batch_operation_add_insertion ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gdata_batch_operation_add_insertion (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>,
                                     <em class="parameter"><code><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> *entry</code></em>,
                                     <em class="parameter"><code><a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> callback</code></em>,
                                     <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>Add an entry to the <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a>, to be inserted on the server when the operation is run. The insertion will return the inserted version
of <em class="parameter"><code>entry</code></em>
. <em class="parameter"><code>entry</code></em>
 is reffed by the function, so may be freed after it returns.</p>
<p><em class="parameter"><code>callback</code></em>
 will be called as specified in the documentation for <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-query" title="gdata_batch_operation_add_query ()"><code class="function">gdata_batch_operation_add_query()</code></a>, with an <em class="parameter"><code>operation_type</code></em>
 of
<a class="link" href="GDataBatchOperation.html#GDATA-BATCH-OPERATION-INSERTION:CAPS"><code class="literal">GDATA_BATCH_OPERATION_INSERTION</code></a>.</p>
<div class="refsect3">
<a name="gdata-batch-operation-add-insertion.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>entry</p></td>
<td class="parameter_description"><p>the <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> to insert</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> to call when the insertion is finished, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>data to pass to the <em class="parameter"><code>callback</code></em>
function. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-add-insertion.returns"></a><h4>Returns</h4>
<p> operation ID for the added insertion, or <code class="code">0</code></p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-add-update"></a><h3>gdata_batch_operation_add_update ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gdata_batch_operation_add_update (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>,
                                  <em class="parameter"><code><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> *entry</code></em>,
                                  <em class="parameter"><code><a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> callback</code></em>,
                                  <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>Add an entry to the <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a>, to be updated on the server when the operation is run. The update will return the updated version of
<em class="parameter"><code>entry</code></em>
. <em class="parameter"><code>entry</code></em>
 is reffed by the function, so may be freed after it returns.</p>
<p>Note that a single batch operation should not operate on a given <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> more than once, as there's no guarantee about the order in which the
batch operation's operations will be performed.</p>
<p><em class="parameter"><code>callback</code></em>
 will be called as specified in the documentation for <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-query" title="gdata_batch_operation_add_query ()"><code class="function">gdata_batch_operation_add_query()</code></a>, with an <em class="parameter"><code>operation_type</code></em>
 of
<a class="link" href="GDataBatchOperation.html#GDATA-BATCH-OPERATION-UPDATE:CAPS"><code class="literal">GDATA_BATCH_OPERATION_UPDATE</code></a>.</p>
<div class="refsect3">
<a name="gdata-batch-operation-add-update.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>entry</p></td>
<td class="parameter_description"><p>the <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> to update</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> to call when the update is finished, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>data to pass to the <em class="parameter"><code>callback</code></em>
function. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-add-update.returns"></a><h4>Returns</h4>
<p> operation ID for the added update, or <code class="code">0</code></p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-add-deletion"></a><h3>gdata_batch_operation_add_deletion ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gdata_batch_operation_add_deletion (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>,
                                    <em class="parameter"><code><a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> *entry</code></em>,
                                    <em class="parameter"><code><a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> callback</code></em>,
                                    <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>Add an entry to the <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a>, to be deleted on the server when the operation is run. <em class="parameter"><code>entry</code></em>
 is reffed by the function, so may be freed
after it returns.</p>
<p>Note that a single batch operation should not operate on a given <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> more than once, as there's no guarantee about the order in which the
batch operation's operations will be performed.</p>
<p><em class="parameter"><code>callback</code></em>
 will be called as specified in the documentation for <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-add-query" title="gdata_batch_operation_add_query ()"><code class="function">gdata_batch_operation_add_query()</code></a>, with an <em class="parameter"><code>operation_type</code></em>
 of
<a class="link" href="GDataBatchOperation.html#GDATA-BATCH-OPERATION-DELETION:CAPS"><code class="literal">GDATA_BATCH_OPERATION_DELETION</code></a>.</p>
<div class="refsect3">
<a name="gdata-batch-operation-add-deletion.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>entry</p></td>
<td class="parameter_description"><p>the <a class="link" href="GDataEntry.html" title="GDataEntry"><span class="type">GDataEntry</span></a> to delete</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> to call when the deletion is finished, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>data to pass to the <em class="parameter"><code>callback</code></em>
function. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-add-deletion.returns"></a><h4>Returns</h4>
<p> operation ID for the added deletion, or <code class="code">0</code></p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-run"></a><h3>gdata_batch_operation_run ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gdata_batch_operation_run (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>,
                           <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
                           <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Run the <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> synchronously. This will send all the operations in the batch operation to the server, and call their respective
callbacks synchronously (i.e. before <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a> returns, and in the same thread that called <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a>) as the
server returns results for each operation.</p>
<p>The callbacks for all of the operations in the batch operation are always guaranteed to be called, even if the batch operation as a whole fails.
Each callback will be called exactly once for each time <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a> is called.</p>
<p>The return value of the function indicates whether the overall batch operation was successful, and doesn't indicate the status of any of the
operations it comprises. <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a> could return <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> even if all of its operations failed.</p>
<p><em class="parameter"><code>cancellable</code></em>
 can be used to cancel the entire batch operation any time before or during the network activity. If <em class="parameter"><code>cancellable</code></em>
 is cancelled
after network activity has finished, <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a> will continue and finish as normal.</p>
<div class="refsect3">
<a name="gdata-batch-operation-run.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>a <span class="type">GCancellable</span>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-run.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-run-async"></a><h3>gdata_batch_operation_run_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdata_batch_operation_run_async (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>,
                                 <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
                                 <em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
                                 <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>Run the <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> asynchronously. This will send all the operations in the batch operation to the server, and call their respective
callbacks asynchronously (i.e. in idle functions in the main thread, usually after <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run-async" title="gdata_batch_operation_run_async ()"><code class="function">gdata_batch_operation_run_async()</code></a> has returned) as the
server returns results for each operation. <em class="parameter"><code>self</code></em>
 is reffed when this function is called, so can safely be unreffed after this function returns.</p>
<p>For more details, see <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a>, which is the synchronous version of this function.</p>
<p>When the entire batch operation is finished, <em class="parameter"><code>callback</code></em>
 will be called. You can then call <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run-finish" title="gdata_batch_operation_run_finish ()"><code class="function">gdata_batch_operation_run_finish()</code></a> to get the results of
the batch operation.</p>
<div class="refsect3">
<a name="gdata-batch-operation-run-async.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>a <span class="type">GCancellable</span>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>a <span class="type">GAsyncReadyCallback</span> to call when the batch operation is finished, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>data to pass to the <em class="parameter"><code>callback</code></em>
function. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-run-finish"></a><h3>gdata_batch_operation_run_finish ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
gdata_batch_operation_run_finish (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>,
                                  <em class="parameter"><code><span class="type">GAsyncResult</span> *async_result</code></em>,
                                  <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>Finishes an asynchronous batch operation run with <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run-async" title="gdata_batch_operation_run_async ()"><code class="function">gdata_batch_operation_run_async()</code></a>.</p>
<p>Return values are as for <a class="link" href="GDataBatchOperation.html#gdata-batch-operation-run" title="gdata_batch_operation_run ()"><code class="function">gdata_batch_operation_run()</code></a>.</p>
<div class="refsect3">
<a name="gdata-batch-operation-run-finish.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>async_result</p></td>
<td class="parameter_description"><p>a <span class="type">GAsyncResult</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-run-finish.returns"></a><h4>Returns</h4>
<p> <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-get-service"></a><h3>gdata_batch_operation_get_service ()</h3>
<pre class="programlisting"><a class="link" href="GDataService.html" title="GDataService"><span class="returnvalue">GDataService</span></a> *
gdata_batch_operation_get_service (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>);</pre>
<p>Gets the <a class="link" href="GDataBatchOperation.html#GDataBatchOperation--service" title="The “service” property"><span class="type">“service”</span></a> property.</p>
<div class="refsect3">
<a name="gdata-batch-operation-get-service.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-get-service.returns"></a><h4>Returns</h4>
<p>the batch operation's attached service. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-get-authorization-domain"></a><h3>gdata_batch_operation_get_authorization_domain ()</h3>
<pre class="programlisting"><a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="returnvalue">GDataAuthorizationDomain</span></a> *
gdata_batch_operation_get_authorization_domain
                               (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>);</pre>
<p>Gets the <a class="link" href="GDataBatchOperation.html#GDataBatchOperation--authorization-domain" title="The “authorization-domain” property"><span class="type">“authorization-domain”</span></a> property.</p>
<div class="refsect3">
<a name="gdata-batch-operation-get-authorization-domain.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-get-authorization-domain.returns"></a><h4>Returns</h4>
<p>the <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> used to authorize the batch operation, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="gdata-batch-operation-get-feed-uri"></a><h3>gdata_batch_operation_get_feed_uri ()</h3>
<pre class="programlisting">const <a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
gdata_batch_operation_get_feed_uri (<em class="parameter"><code><a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> *self</code></em>);</pre>
<p>Gets the <a class="link" href="GDataBatchOperation.html#GDataBatchOperation--feed-uri" title="The “feed-uri” property"><span class="type">“feed-uri”</span></a> property.</p>
<div class="refsect3">
<a name="gdata-batch-operation-get-feed-uri.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdata-batch-operation-get-feed-uri.returns"></a><h4>Returns</h4>
<p> the batch operation's feed URI</p>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
</div>
<div class="refsect1">
<a name="GDataBatchOperation.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GDataBatchOperation-struct"></a><h3>GDataBatchOperation</h3>
<pre class="programlisting">typedef struct _GDataBatchOperation GDataBatchOperation;</pre>
<p>All the fields in the <a class="link" href="GDataBatchOperation.html" title="GDataBatchOperation"><span class="type">GDataBatchOperation</span></a> structure are private and should never be accessed directly.</p>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GDataBatchOperationClass"></a><h3>GDataBatchOperationClass</h3>
<pre class="programlisting">typedef struct {
} GDataBatchOperationClass;
</pre>
<p>All the fields in the <a class="link" href="GDataBatchOperation.html#GDataBatchOperationClass" title="GDataBatchOperationClass"><span class="type">GDataBatchOperationClass</span></a> structure are private and should never be accessed directly.</p>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GDataBatchOperationType"></a><h3>enum GDataBatchOperationType</h3>
<p>Indicates which type of batch operation caused the current <a class="link" href="GDataBatchOperation.html#GDataBatchOperationCallback" title="GDataBatchOperationCallback ()"><span class="type">GDataBatchOperationCallback</span></a> to be called.</p>
<div class="refsect3">
<a name="GDataBatchOperationType.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GDATA-BATCH-OPERATION-QUERY:CAPS"></a>GDATA_BATCH_OPERATION_QUERY</p></td>
<td class="enum_member_description">
<p>a query operation</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GDATA-BATCH-OPERATION-INSERTION:CAPS"></a>GDATA_BATCH_OPERATION_INSERTION</p></td>
<td class="enum_member_description">
<p>an insertion operation</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GDATA-BATCH-OPERATION-UPDATE:CAPS"></a>GDATA_BATCH_OPERATION_UPDATE</p></td>
<td class="enum_member_description">
<p>an update operation</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GDATA-BATCH-OPERATION-DELETION:CAPS"></a>GDATA_BATCH_OPERATION_DELETION</p></td>
<td class="enum_member_description">
<p>a deletion operation</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
</div>
<div class="refsect1">
<a name="GDataBatchOperation.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GDataBatchOperation--authorization-domain"></a><h3>The <code class="literal">“authorization-domain”</code> property</h3>
<pre class="programlisting">  “authorization-domain”     <a class="link" href="GDataAuthorizationDomain.html" title="GDataAuthorizationDomain"><span class="type">GDataAuthorizationDomain</span></a> *</pre>
<p>The authorization domain for the batch operation, against which the <a class="link" href="GDataService.html#GDataService--authorizer" title="The “authorizer” property"><span class="type">“authorizer”</span></a> for the <a class="link" href="GDataBatchOperation.html#GDataBatchOperation--service" title="The “service” property"><span class="type">“service”</span></a> should be
authorized. This may be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if authorization is not needed for any of the requests in the batch operation.</p>
<p>All requests in the batch operation must be authorizable under this single authorization domain. If requests need different authorization
domains, they must be performed in different batch operations.</p>
<p>Flags: Read / Write / Construct Only</p>
<p class="since">Since: <a class="link" href="ix11.html#api-index-0.9.0">0.9.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GDataBatchOperation--feed-uri"></a><h3>The <code class="literal">“feed-uri”</code> property</h3>
<pre class="programlisting">  “feed-uri”                 <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
<p>The feed URI that this batch operation will be sent to.</p>
<p>Flags: Read / Write / Construct Only</p>
<p>Default value: NULL</p>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GDataBatchOperation--service"></a><h3>The <code class="literal">“service”</code> property</h3>
<pre class="programlisting">  “service”                  <a class="link" href="GDataService.html" title="GDataService"><span class="type">GDataService</span></a> *</pre>
<p>The service this batch operation is attached to.</p>
<p>Flags: Read / Write / Construct Only</p>
<p class="since">Since: <a class="link" href="ix09.html#api-index-0.7.0">0.7.0</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.26.1</div>
</body>
</html>