Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 1 | <?xml version="1.0" encoding="ascii"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
| 3 | "DTD/xhtml1-transitional.dtd"> |
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 5 | <head> |
| 6 | <title>apiclient.http.BatchHttpRequest</title> |
| 7 | <link rel="stylesheet" href="epydoc.css" type="text/css" /> |
| 8 | <script type="text/javascript" src="epydoc.js"></script> |
| 9 | </head> |
| 10 | |
| 11 | <body bgcolor="white" text="black" link="blue" vlink="#204080" |
| 12 | alink="#204080"> |
| 13 | <!-- ==================== NAVIGATION BAR ==================== --> |
| 14 | <table class="navbar" border="0" width="100%" cellpadding="0" |
| 15 | bgcolor="#a0c0ff" cellspacing="0"> |
| 16 | <tr valign="middle"> |
| 17 | |
| 18 | <!-- Tree link --> |
| 19 | <th> <a |
| 20 | href="module-tree.html">Trees</a> </th> |
| 21 | |
| 22 | <!-- Index link --> |
| 23 | <th> <a |
| 24 | href="identifier-index.html">Indices</a> </th> |
| 25 | |
| 26 | <!-- Help link --> |
| 27 | <th> <a |
| 28 | href="help.html">Help</a> </th> |
| 29 | |
| 30 | <th class="navbar" width="100%"></th> |
| 31 | </tr> |
| 32 | </table> |
| 33 | <table width="100%" cellpadding="0" cellspacing="0"> |
| 34 | <tr valign="top"> |
| 35 | <td width="100%"> |
| 36 | <span class="breadcrumbs"> |
| 37 | <a href="apiclient-module.html">Package apiclient</a> :: |
| 38 | <a href="apiclient.http-module.html">Module http</a> :: |
| 39 | Class BatchHttpRequest |
| 40 | </span> |
| 41 | </td> |
| 42 | <td> |
| 43 | <table cellpadding="0" cellspacing="0"> |
| 44 | <!-- hide/show private --> |
| 45 | <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" |
| 46 | onclick="toggle_private();">hide private</a>]</span></td></tr> |
| 47 | <tr><td align="right"><span class="options" |
| 48 | >[<a href="frames.html" target="_top">frames</a |
| 49 | >] | <a href="apiclient.http.BatchHttpRequest-class.html" |
| 50 | target="_top">no frames</a>]</span></td></tr> |
| 51 | </table> |
| 52 | </td> |
| 53 | </tr> |
| 54 | </table> |
| 55 | <!-- ==================== CLASS DESCRIPTION ==================== --> |
| 56 | <h1 class="epydoc">Class BatchHttpRequest</h1><p class="nomargin-top"><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest">source code</a></span></p> |
| 57 | <center> |
Joe Gregorio | 746096f | 2012-06-15 10:53:36 -0400 | [diff] [blame^] | 58 | <center> <map id="class_hierarchy_for_batchhttpr" name="class_hierarchy_for_batchhttpr"> |
| 59 | <area shape="rect" href="apiclient.http.BatchHttpRequest-class.html" title="BatchHttpRequest" alt="" coords="5,5,133,32"/> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 60 | </map> |
Joe Gregorio | 746096f | 2012-06-15 10:53:36 -0400 | [diff] [blame^] | 61 | <img src="class_hierarchy_for_batchhttpr.gif" alt='' usemap="#class_hierarchy_for_batchhttpr" ismap="ismap" class="graph-without-title" /> |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 62 | </center> |
| 63 | </center> |
| 64 | <hr /> |
| 65 | <pre class="literalblock"> |
| 66 | Batches multiple HttpRequest objects into a single HTTP request. |
| 67 | |
| 68 | </pre> |
| 69 | |
| 70 | <!-- ==================== INSTANCE METHODS ==================== --> |
| 71 | <a name="section-InstanceMethods"></a> |
| 72 | <table class="summary" border="1" cellpadding="3" |
| 73 | cellspacing="0" width="100%" bgcolor="white"> |
| 74 | <tr bgcolor="#70b0f0" class="table-header"> |
| 75 | <td colspan="2" class="table-header"> |
| 76 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 77 | <tr valign="top"> |
| 78 | <td align="left"><span class="table-header">Instance Methods</span></td> |
| 79 | <td align="right" valign="top" |
| 80 | ><span class="options">[<a href="#section-InstanceMethods" |
| 81 | class="privatelink" onclick="toggle_private();" |
| 82 | >hide private</a>]</span></td> |
| 83 | </tr> |
| 84 | </table> |
| 85 | </td> |
| 86 | </tr> |
| 87 | <tr> |
| 88 | <td width="15%" align="right" valign="top" class="summary"> |
| 89 | <span class="summary-type"> </span> |
| 90 | </td><td class="summary"> |
| 91 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 92 | <tr> |
| 93 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, |
| 94 | <span class="summary-sig-arg">callback</span>=<span class="summary-sig-default">None</span>, |
| 95 | <span class="summary-sig-arg">batch_uri</span>=<span class="summary-sig-default">None</span>)</span><br /> |
| 96 | Constructor for a BatchHttpRequest.</td> |
| 97 | <td align="right" valign="top"> |
| 98 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest.__init__">source code</a></span> |
| 99 | |
| 100 | </td> |
| 101 | </tr> |
| 102 | </table> |
| 103 | |
| 104 | </td> |
| 105 | </tr> |
| 106 | <tr class="private"> |
| 107 | <td width="15%" align="right" valign="top" class="summary"> |
| 108 | <span class="summary-type"> </span> |
| 109 | </td><td class="summary"> |
| 110 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 111 | <tr> |
| 112 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#_refresh_and_apply_credentials" class="summary-sig-name" onclick="show_private();">_refresh_and_apply_credentials</a>(<span class="summary-sig-arg">self</span>, |
| 113 | <span class="summary-sig-arg">request</span>, |
| 114 | <span class="summary-sig-arg">http</span>)</span><br /> |
| 115 | Refresh the credentials and apply to the request.</td> |
| 116 | <td align="right" valign="top"> |
| 117 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._refresh_and_apply_credentials">source code</a></span> |
| 118 | |
| 119 | </td> |
| 120 | </tr> |
| 121 | </table> |
| 122 | |
| 123 | </td> |
| 124 | </tr> |
| 125 | <tr class="private"> |
| 126 | <td width="15%" align="right" valign="top" class="summary"> |
| 127 | <span class="summary-type"> </span> |
| 128 | </td><td class="summary"> |
| 129 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 130 | <tr> |
| 131 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#_id_to_header" class="summary-sig-name" onclick="show_private();">_id_to_header</a>(<span class="summary-sig-arg">self</span>, |
| 132 | <span class="summary-sig-arg">id_</span>)</span><br /> |
| 133 | Convert an id to a Content-ID header value.</td> |
| 134 | <td align="right" valign="top"> |
| 135 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._id_to_header">source code</a></span> |
| 136 | |
| 137 | </td> |
| 138 | </tr> |
| 139 | </table> |
| 140 | |
| 141 | </td> |
| 142 | </tr> |
| 143 | <tr class="private"> |
| 144 | <td width="15%" align="right" valign="top" class="summary"> |
| 145 | <span class="summary-type"> </span> |
| 146 | </td><td class="summary"> |
| 147 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 148 | <tr> |
| 149 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#_header_to_id" class="summary-sig-name" onclick="show_private();">_header_to_id</a>(<span class="summary-sig-arg">self</span>, |
| 150 | <span class="summary-sig-arg">header</span>)</span><br /> |
| 151 | Convert a Content-ID header value to an id.</td> |
| 152 | <td align="right" valign="top"> |
| 153 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._header_to_id">source code</a></span> |
| 154 | |
| 155 | </td> |
| 156 | </tr> |
| 157 | </table> |
| 158 | |
| 159 | </td> |
| 160 | </tr> |
| 161 | <tr class="private"> |
| 162 | <td width="15%" align="right" valign="top" class="summary"> |
| 163 | <span class="summary-type"> </span> |
| 164 | </td><td class="summary"> |
| 165 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 166 | <tr> |
| 167 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#_serialize_request" class="summary-sig-name" onclick="show_private();">_serialize_request</a>(<span class="summary-sig-arg">self</span>, |
| 168 | <span class="summary-sig-arg">request</span>)</span><br /> |
| 169 | Convert an HttpRequest object into a string.</td> |
| 170 | <td align="right" valign="top"> |
| 171 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._serialize_request">source code</a></span> |
| 172 | |
| 173 | </td> |
| 174 | </tr> |
| 175 | </table> |
| 176 | |
| 177 | </td> |
| 178 | </tr> |
| 179 | <tr class="private"> |
| 180 | <td width="15%" align="right" valign="top" class="summary"> |
| 181 | <span class="summary-type"> </span> |
| 182 | </td><td class="summary"> |
| 183 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 184 | <tr> |
| 185 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#_deserialize_response" class="summary-sig-name" onclick="show_private();">_deserialize_response</a>(<span class="summary-sig-arg">self</span>, |
| 186 | <span class="summary-sig-arg">payload</span>)</span><br /> |
| 187 | Convert string into httplib2 response and content.</td> |
| 188 | <td align="right" valign="top"> |
| 189 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._deserialize_response">source code</a></span> |
| 190 | |
| 191 | </td> |
| 192 | </tr> |
| 193 | </table> |
| 194 | |
| 195 | </td> |
| 196 | </tr> |
| 197 | <tr class="private"> |
| 198 | <td width="15%" align="right" valign="top" class="summary"> |
| 199 | <span class="summary-type"> </span> |
| 200 | </td><td class="summary"> |
| 201 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 202 | <tr> |
| 203 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#_new_id" class="summary-sig-name" onclick="show_private();">_new_id</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
| 204 | Create a new id.</td> |
| 205 | <td align="right" valign="top"> |
| 206 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._new_id">source code</a></span> |
| 207 | |
| 208 | </td> |
| 209 | </tr> |
| 210 | </table> |
| 211 | |
| 212 | </td> |
| 213 | </tr> |
| 214 | <tr> |
| 215 | <td width="15%" align="right" valign="top" class="summary"> |
| 216 | <span class="summary-type"> </span> |
| 217 | </td><td class="summary"> |
| 218 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 219 | <tr> |
| 220 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#add" class="summary-sig-name">add</a>(<span class="summary-sig-arg">self</span>, |
| 221 | <span class="summary-sig-arg">request</span>, |
| 222 | <span class="summary-sig-arg">callback</span>=<span class="summary-sig-default">None</span>, |
| 223 | <span class="summary-sig-arg">request_id</span>=<span class="summary-sig-default">None</span>)</span><br /> |
| 224 | Add a new request.</td> |
| 225 | <td align="right" valign="top"> |
| 226 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest.add">source code</a></span> |
| 227 | |
| 228 | </td> |
| 229 | </tr> |
| 230 | </table> |
| 231 | |
| 232 | </td> |
| 233 | </tr> |
| 234 | <tr class="private"> |
| 235 | <td width="15%" align="right" valign="top" class="summary"> |
| 236 | <span class="summary-type"> </span> |
| 237 | </td><td class="summary"> |
| 238 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 239 | <tr> |
| 240 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#_execute" class="summary-sig-name" onclick="show_private();">_execute</a>(<span class="summary-sig-arg">self</span>, |
| 241 | <span class="summary-sig-arg">http</span>, |
| 242 | <span class="summary-sig-arg">order</span>, |
| 243 | <span class="summary-sig-arg">requests</span>)</span><br /> |
| 244 | Serialize batch request, send to server, process response.</td> |
| 245 | <td align="right" valign="top"> |
| 246 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._execute">source code</a></span> |
| 247 | |
| 248 | </td> |
| 249 | </tr> |
| 250 | </table> |
| 251 | |
| 252 | </td> |
| 253 | </tr> |
| 254 | <tr> |
| 255 | <td width="15%" align="right" valign="top" class="summary"> |
| 256 | <span class="summary-type"> </span> |
| 257 | </td><td class="summary"> |
| 258 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 259 | <tr> |
| 260 | <td><span class="summary-sig"><a href="apiclient.http.BatchHttpRequest-class.html#execute" class="summary-sig-name">execute</a>(<span class="summary-sig-arg">self</span>, |
| 261 | <span class="summary-sig-arg">http</span>=<span class="summary-sig-default">None</span>)</span><br /> |
| 262 | Execute all the requests as a single batched HTTP request.</td> |
| 263 | <td align="right" valign="top"> |
| 264 | <span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest.execute">source code</a></span> |
| 265 | |
| 266 | </td> |
| 267 | </tr> |
| 268 | </table> |
| 269 | |
| 270 | </td> |
| 271 | </tr> |
| 272 | <tr> |
| 273 | <td colspan="2" class="summary"> |
| 274 | <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
| 275 | <code>__delattr__</code>, |
| 276 | <code>__format__</code>, |
| 277 | <code>__getattribute__</code>, |
| 278 | <code>__hash__</code>, |
| 279 | <code>__new__</code>, |
| 280 | <code>__reduce__</code>, |
| 281 | <code>__reduce_ex__</code>, |
| 282 | <code>__repr__</code>, |
| 283 | <code>__setattr__</code>, |
| 284 | <code>__sizeof__</code>, |
| 285 | <code>__str__</code>, |
| 286 | <code>__subclasshook__</code> |
| 287 | </p> |
| 288 | </td> |
| 289 | </tr> |
| 290 | </table> |
| 291 | <!-- ==================== PROPERTIES ==================== --> |
| 292 | <a name="section-Properties"></a> |
| 293 | <table class="summary" border="1" cellpadding="3" |
| 294 | cellspacing="0" width="100%" bgcolor="white"> |
| 295 | <tr bgcolor="#70b0f0" class="table-header"> |
| 296 | <td colspan="2" class="table-header"> |
| 297 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 298 | <tr valign="top"> |
| 299 | <td align="left"><span class="table-header">Properties</span></td> |
| 300 | <td align="right" valign="top" |
| 301 | ><span class="options">[<a href="#section-Properties" |
| 302 | class="privatelink" onclick="toggle_private();" |
| 303 | >hide private</a>]</span></td> |
| 304 | </tr> |
| 305 | </table> |
| 306 | </td> |
| 307 | </tr> |
| 308 | <tr> |
| 309 | <td colspan="2" class="summary"> |
| 310 | <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
| 311 | <code>__class__</code> |
| 312 | </p> |
| 313 | </td> |
| 314 | </tr> |
| 315 | </table> |
| 316 | <!-- ==================== METHOD DETAILS ==================== --> |
| 317 | <a name="section-MethodDetails"></a> |
| 318 | <table class="details" border="1" cellpadding="3" |
| 319 | cellspacing="0" width="100%" bgcolor="white"> |
| 320 | <tr bgcolor="#70b0f0" class="table-header"> |
| 321 | <td colspan="2" class="table-header"> |
| 322 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 323 | <tr valign="top"> |
| 324 | <td align="left"><span class="table-header">Method Details</span></td> |
| 325 | <td align="right" valign="top" |
| 326 | ><span class="options">[<a href="#section-MethodDetails" |
| 327 | class="privatelink" onclick="toggle_private();" |
| 328 | >hide private</a>]</span></td> |
| 329 | </tr> |
| 330 | </table> |
| 331 | </td> |
| 332 | </tr> |
| 333 | </table> |
| 334 | <a name="__init__"></a> |
| 335 | <div> |
| 336 | <table class="details" border="1" cellpadding="3" |
| 337 | cellspacing="0" width="100%" bgcolor="white"> |
| 338 | <tr><td> |
| 339 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 340 | <tr valign="top"><td> |
| 341 | <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, |
| 342 | <span class="sig-arg">callback</span>=<span class="sig-default">None</span>, |
| 343 | <span class="sig-arg">batch_uri</span>=<span class="sig-default">None</span>)</span> |
| 344 | <br /><em class="fname">(Constructor)</em> |
| 345 | </h3> |
| 346 | </td><td align="right" valign="top" |
| 347 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest.__init__">source code</a></span> |
| 348 | </td> |
| 349 | </tr></table> |
| 350 | |
| 351 | <pre class="literalblock"> |
| 352 | Constructor for a BatchHttpRequest. |
| 353 | |
| 354 | Args: |
| 355 | callback: callable, A callback to be called for each response, of the |
| 356 | form callback(id, response). The first parameter is the request id, and |
| 357 | the second is the deserialized response object. |
| 358 | batch_uri: string, URI to send batch requests to. |
| 359 | |
| 360 | </pre> |
| 361 | <dl class="fields"> |
| 362 | <dt>Overrides: |
| 363 | object.__init__ |
| 364 | </dt> |
| 365 | </dl> |
| 366 | </td></tr></table> |
| 367 | </div> |
| 368 | <a name="_refresh_and_apply_credentials"></a> |
| 369 | <div class="private"> |
| 370 | <table class="details" border="1" cellpadding="3" |
| 371 | cellspacing="0" width="100%" bgcolor="white"> |
| 372 | <tr><td> |
| 373 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 374 | <tr valign="top"><td> |
| 375 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_refresh_and_apply_credentials</span>(<span class="sig-arg">self</span>, |
| 376 | <span class="sig-arg">request</span>, |
| 377 | <span class="sig-arg">http</span>)</span> |
| 378 | </h3> |
| 379 | </td><td align="right" valign="top" |
| 380 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._refresh_and_apply_credentials">source code</a></span> |
| 381 | </td> |
| 382 | </tr></table> |
| 383 | |
| 384 | <pre class="literalblock"> |
| 385 | Refresh the credentials and apply to the request. |
| 386 | |
| 387 | Args: |
| 388 | request: HttpRequest, the request. |
| 389 | http: httplib2.Http, the global http object for the batch. |
| 390 | |
| 391 | </pre> |
| 392 | <dl class="fields"> |
| 393 | </dl> |
| 394 | </td></tr></table> |
| 395 | </div> |
| 396 | <a name="_id_to_header"></a> |
| 397 | <div class="private"> |
| 398 | <table class="details" border="1" cellpadding="3" |
| 399 | cellspacing="0" width="100%" bgcolor="white"> |
| 400 | <tr><td> |
| 401 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 402 | <tr valign="top"><td> |
| 403 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_id_to_header</span>(<span class="sig-arg">self</span>, |
| 404 | <span class="sig-arg">id_</span>)</span> |
| 405 | </h3> |
| 406 | </td><td align="right" valign="top" |
| 407 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._id_to_header">source code</a></span> |
| 408 | </td> |
| 409 | </tr></table> |
| 410 | |
| 411 | <pre class="literalblock"> |
| 412 | Convert an id to a Content-ID header value. |
| 413 | |
| 414 | Args: |
| 415 | id_: string, identifier of individual request. |
| 416 | |
| 417 | Returns: |
| 418 | A Content-ID header with the id_ encoded into it. A UUID is prepended to |
| 419 | the value because Content-ID headers are supposed to be universally |
| 420 | unique. |
| 421 | |
| 422 | </pre> |
| 423 | <dl class="fields"> |
| 424 | </dl> |
| 425 | </td></tr></table> |
| 426 | </div> |
| 427 | <a name="_header_to_id"></a> |
| 428 | <div class="private"> |
| 429 | <table class="details" border="1" cellpadding="3" |
| 430 | cellspacing="0" width="100%" bgcolor="white"> |
| 431 | <tr><td> |
| 432 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 433 | <tr valign="top"><td> |
| 434 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_header_to_id</span>(<span class="sig-arg">self</span>, |
| 435 | <span class="sig-arg">header</span>)</span> |
| 436 | </h3> |
| 437 | </td><td align="right" valign="top" |
| 438 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._header_to_id">source code</a></span> |
| 439 | </td> |
| 440 | </tr></table> |
| 441 | |
| 442 | <pre class="literalblock"> |
| 443 | Convert a Content-ID header value to an id. |
| 444 | |
| 445 | Presumes the Content-ID header conforms to the format that _id_to_header() |
| 446 | returns. |
| 447 | |
| 448 | Args: |
| 449 | header: string, Content-ID header value. |
| 450 | |
| 451 | Returns: |
| 452 | The extracted id value. |
| 453 | |
| 454 | Raises: |
| 455 | BatchError if the header is not in the expected format. |
| 456 | |
| 457 | </pre> |
| 458 | <dl class="fields"> |
| 459 | </dl> |
| 460 | </td></tr></table> |
| 461 | </div> |
| 462 | <a name="_serialize_request"></a> |
| 463 | <div class="private"> |
| 464 | <table class="details" border="1" cellpadding="3" |
| 465 | cellspacing="0" width="100%" bgcolor="white"> |
| 466 | <tr><td> |
| 467 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 468 | <tr valign="top"><td> |
| 469 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_serialize_request</span>(<span class="sig-arg">self</span>, |
| 470 | <span class="sig-arg">request</span>)</span> |
| 471 | </h3> |
| 472 | </td><td align="right" valign="top" |
| 473 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._serialize_request">source code</a></span> |
| 474 | </td> |
| 475 | </tr></table> |
| 476 | |
| 477 | <pre class="literalblock"> |
| 478 | Convert an HttpRequest object into a string. |
| 479 | |
| 480 | Args: |
| 481 | request: HttpRequest, the request to serialize. |
| 482 | |
| 483 | Returns: |
| 484 | The request as a string in application/http format. |
| 485 | |
| 486 | </pre> |
| 487 | <dl class="fields"> |
| 488 | </dl> |
| 489 | </td></tr></table> |
| 490 | </div> |
| 491 | <a name="_deserialize_response"></a> |
| 492 | <div class="private"> |
| 493 | <table class="details" border="1" cellpadding="3" |
| 494 | cellspacing="0" width="100%" bgcolor="white"> |
| 495 | <tr><td> |
| 496 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 497 | <tr valign="top"><td> |
| 498 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_deserialize_response</span>(<span class="sig-arg">self</span>, |
| 499 | <span class="sig-arg">payload</span>)</span> |
| 500 | </h3> |
| 501 | </td><td align="right" valign="top" |
| 502 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._deserialize_response">source code</a></span> |
| 503 | </td> |
| 504 | </tr></table> |
| 505 | |
| 506 | <pre class="literalblock"> |
| 507 | Convert string into httplib2 response and content. |
| 508 | |
| 509 | Args: |
| 510 | payload: string, headers and body as a string. |
| 511 | |
| 512 | Returns: |
| 513 | A pair (resp, content) like would be returned from httplib2.request. |
| 514 | |
| 515 | </pre> |
| 516 | <dl class="fields"> |
| 517 | </dl> |
| 518 | </td></tr></table> |
| 519 | </div> |
| 520 | <a name="_new_id"></a> |
| 521 | <div class="private"> |
| 522 | <table class="details" border="1" cellpadding="3" |
| 523 | cellspacing="0" width="100%" bgcolor="white"> |
| 524 | <tr><td> |
| 525 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 526 | <tr valign="top"><td> |
| 527 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_new_id</span>(<span class="sig-arg">self</span>)</span> |
| 528 | </h3> |
| 529 | </td><td align="right" valign="top" |
| 530 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._new_id">source code</a></span> |
| 531 | </td> |
| 532 | </tr></table> |
| 533 | |
| 534 | <pre class="literalblock"> |
| 535 | Create a new id. |
| 536 | |
| 537 | Auto incrementing number that avoids conflicts with ids already used. |
| 538 | |
| 539 | Returns: |
| 540 | string, a new unique id. |
| 541 | |
| 542 | </pre> |
| 543 | <dl class="fields"> |
| 544 | </dl> |
| 545 | </td></tr></table> |
| 546 | </div> |
| 547 | <a name="add"></a> |
| 548 | <div> |
| 549 | <table class="details" border="1" cellpadding="3" |
| 550 | cellspacing="0" width="100%" bgcolor="white"> |
| 551 | <tr><td> |
| 552 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 553 | <tr valign="top"><td> |
| 554 | <h3 class="epydoc"><span class="sig"><span class="sig-name">add</span>(<span class="sig-arg">self</span>, |
| 555 | <span class="sig-arg">request</span>, |
| 556 | <span class="sig-arg">callback</span>=<span class="sig-default">None</span>, |
| 557 | <span class="sig-arg">request_id</span>=<span class="sig-default">None</span>)</span> |
| 558 | </h3> |
| 559 | </td><td align="right" valign="top" |
| 560 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest.add">source code</a></span> |
| 561 | </td> |
| 562 | </tr></table> |
| 563 | |
| 564 | <pre class="literalblock"> |
| 565 | Add a new request. |
| 566 | |
| 567 | Every callback added will be paired with a unique id, the request_id. That |
| 568 | unique id will be passed back to the callback when the response comes back |
| 569 | from the server. The default behavior is to have the library generate it's |
| 570 | own unique id. If the caller passes in a request_id then they must ensure |
| 571 | uniqueness for each request_id, and if they are not an exception is |
| 572 | raised. Callers should either supply all request_ids or nevery supply a |
| 573 | request id, to avoid such an error. |
| 574 | |
| 575 | Args: |
| 576 | request: HttpRequest, Request to add to the batch. |
| 577 | callback: callable, A callback to be called for this response, of the |
| 578 | form callback(id, response). The first parameter is the request id, and |
| 579 | the second is the deserialized response object. |
| 580 | request_id: string, A unique id for the request. The id will be passed to |
| 581 | the callback with the response. |
| 582 | |
| 583 | Returns: |
| 584 | None |
| 585 | |
| 586 | Raises: |
| 587 | BatchError if a resumable request is added to a batch. |
| 588 | KeyError is the request_id is not unique. |
| 589 | |
| 590 | </pre> |
| 591 | <dl class="fields"> |
| 592 | </dl> |
| 593 | </td></tr></table> |
| 594 | </div> |
| 595 | <a name="_execute"></a> |
| 596 | <div class="private"> |
| 597 | <table class="details" border="1" cellpadding="3" |
| 598 | cellspacing="0" width="100%" bgcolor="white"> |
| 599 | <tr><td> |
| 600 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 601 | <tr valign="top"><td> |
| 602 | <h3 class="epydoc"><span class="sig"><span class="sig-name">_execute</span>(<span class="sig-arg">self</span>, |
| 603 | <span class="sig-arg">http</span>, |
| 604 | <span class="sig-arg">order</span>, |
| 605 | <span class="sig-arg">requests</span>)</span> |
| 606 | </h3> |
| 607 | </td><td align="right" valign="top" |
| 608 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest._execute">source code</a></span> |
| 609 | </td> |
| 610 | </tr></table> |
| 611 | |
| 612 | <pre class="literalblock"> |
| 613 | Serialize batch request, send to server, process response. |
| 614 | |
| 615 | Args: |
| 616 | http: httplib2.Http, an http object to be used to make the request with. |
| 617 | order: list, list of request ids in the order they were added to the |
| 618 | batch. |
| 619 | request: list, list of request objects to send. |
| 620 | |
| 621 | Raises: |
| 622 | httplib2.Error if a transport error has occured. |
| 623 | apiclient.errors.BatchError if the response is the wrong format. |
| 624 | |
| 625 | </pre> |
| 626 | <dl class="fields"> |
| 627 | </dl> |
| 628 | </td></tr></table> |
| 629 | </div> |
| 630 | <a name="execute"></a> |
| 631 | <div> |
| 632 | <table class="details" border="1" cellpadding="3" |
| 633 | cellspacing="0" width="100%" bgcolor="white"> |
| 634 | <tr><td> |
| 635 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 636 | <tr valign="top"><td> |
| 637 | <h3 class="epydoc"><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">self</span>, |
| 638 | <span class="sig-arg">http</span>=<span class="sig-default">None</span>)</span> |
| 639 | </h3> |
| 640 | </td><td align="right" valign="top" |
| 641 | ><span class="codelink"><a href="apiclient.http-pysrc.html#BatchHttpRequest.execute">source code</a></span> |
| 642 | </td> |
| 643 | </tr></table> |
| 644 | |
| 645 | <pre class="literalblock"> |
| 646 | Execute all the requests as a single batched HTTP request. |
| 647 | |
| 648 | Args: |
| 649 | http: httplib2.Http, an http object to be used in place of the one the |
| 650 | HttpRequest request object was constructed with. If one isn't supplied |
| 651 | then use a http object from the requests in this batch. |
| 652 | |
| 653 | Returns: |
| 654 | None |
| 655 | |
| 656 | Raises: |
| 657 | httplib2.Error if a transport error has occured. |
| 658 | apiclient.errors.BatchError if the response is the wrong format. |
| 659 | |
| 660 | </pre> |
| 661 | <dl class="fields"> |
| 662 | </dl> |
| 663 | </td></tr></table> |
| 664 | </div> |
| 665 | <br /> |
| 666 | <!-- ==================== NAVIGATION BAR ==================== --> |
| 667 | <table class="navbar" border="0" width="100%" cellpadding="0" |
| 668 | bgcolor="#a0c0ff" cellspacing="0"> |
| 669 | <tr valign="middle"> |
| 670 | |
| 671 | <!-- Tree link --> |
| 672 | <th> <a |
| 673 | href="module-tree.html">Trees</a> </th> |
| 674 | |
| 675 | <!-- Index link --> |
| 676 | <th> <a |
| 677 | href="identifier-index.html">Indices</a> </th> |
| 678 | |
| 679 | <!-- Help link --> |
| 680 | <th> <a |
| 681 | href="help.html">Help</a> </th> |
| 682 | |
| 683 | <th class="navbar" width="100%"></th> |
| 684 | </tr> |
| 685 | </table> |
| 686 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
| 687 | <tr> |
| 688 | <td align="left" class="footer"> |
Joe Gregorio | 746096f | 2012-06-15 10:53:36 -0400 | [diff] [blame^] | 689 | Generated by Epydoc 3.0.1 on Fri Jun 15 09:51:50 2012 |
Joe Gregorio | 5dc0f5c | 2012-06-05 13:34:31 -0400 | [diff] [blame] | 690 | </td> |
| 691 | <td align="right" class="footer"> |
| 692 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
| 693 | >http://epydoc.sourceforge.net</a> |
| 694 | </td> |
| 695 | </tr> |
| 696 | </table> |
| 697 | |
| 698 | <script type="text/javascript"> |
| 699 | <!-- |
| 700 | // Private objects are initially displayed (because if |
| 701 | // javascript is turned off then we want them to be |
| 702 | // visible); but by default, we want to hide them. So hide |
| 703 | // them unless we have a cookie that says to show them. |
| 704 | checkCookie(); |
| 705 | // --> |
| 706 | </script> |
| 707 | </body> |
| 708 | </html> |