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>googleapiclient.discovery.Resource</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 <!-- Home link --> 18 <th> <a 19 href="googleapiclient-module.html">Home</a> </th> 20 21 <!-- Tree link --> 22 <th> <a 23 href="module-tree.html">Trees</a> </th> 24 25 <!-- Index link --> 26 <th> <a 27 href="identifier-index.html">Indices</a> </th> 28 29 <!-- Help link --> 30 <th> <a 31 href="help.html">Help</a> </th> 32 33 <th class="navbar" width="100%"></th> 34 </tr> 35</table> 36<table width="100%" cellpadding="0" cellspacing="0"> 37 <tr valign="top"> 38 <td width="100%"> 39 <span class="breadcrumbs"> 40 <a href="googleapiclient-module.html">Package googleapiclient</a> :: 41 <a href="googleapiclient.discovery-module.html">Module discovery</a> :: 42 Class Resource 43 </span> 44 </td> 45 <td> 46 <table cellpadding="0" cellspacing="0"> 47 <!-- hide/show private --> 48 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" 49 onclick="toggle_private();">hide private</a>]</span></td></tr> 50 <tr><td align="right"><span class="options" 51 >[<a href="frames.html" target="_top">frames</a 52 >] | <a href="googleapiclient.discovery.Resource-class.html" 53 target="_top">no frames</a>]</span></td></tr> 54 </table> 55 </td> 56 </tr> 57</table> 58<!-- ==================== CLASS DESCRIPTION ==================== --> 59<h1 class="epydoc">Class Resource</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource">source code</a></span></p> 60<center> 61 62</center> 63<hr /> 64<pre class="literalblock"> 65A class for interacting with a resource. 66 67</pre> 68 69<!-- ==================== INSTANCE METHODS ==================== --> 70<a name="section-InstanceMethods"></a> 71<table class="summary" border="1" cellpadding="3" 72 cellspacing="0" width="100%" bgcolor="white"> 73<tr bgcolor="#70b0f0" class="table-header"> 74 <td colspan="2" class="table-header"> 75 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 76 <tr valign="top"> 77 <td align="left"><span class="table-header">Instance Methods</span></td> 78 <td align="right" valign="top" 79 ><span class="options">[<a href="#section-InstanceMethods" 80 class="privatelink" onclick="toggle_private();" 81 >hide private</a>]</span></td> 82 </tr> 83 </table> 84 </td> 85</tr> 86<tr> 87 <td width="15%" align="right" valign="top" class="summary"> 88 <span class="summary-type"> </span> 89 </td><td class="summary"> 90 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 91 <tr> 92 <td><span class="summary-sig"><a href="googleapiclient.discovery.Resource-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, 93 <span class="summary-sig-arg">http</span>, 94 <span class="summary-sig-arg">baseUrl</span>, 95 <span class="summary-sig-arg">model</span>, 96 <span class="summary-sig-arg">requestBuilder</span>, 97 <span class="summary-sig-arg">developerKey</span>, 98 <span class="summary-sig-arg">resourceDesc</span>, 99 <span class="summary-sig-arg">rootDesc</span>, 100 <span class="summary-sig-arg">schema</span>)</span><br /> 101 Build a Resource from the API description.</td> 102 <td align="right" valign="top"> 103 <span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource.__init__">source code</a></span> 104 105 </td> 106 </tr> 107 </table> 108 109 </td> 110 </tr> 111<tr class="private"> 112 <td width="15%" align="right" valign="top" class="summary"> 113 <span class="summary-type"> </span> 114 </td><td class="summary"> 115 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 116 <tr> 117 <td><span class="summary-sig"><a href="googleapiclient.discovery.Resource-class.html#_set_dynamic_attr" class="summary-sig-name" onclick="show_private();">_set_dynamic_attr</a>(<span class="summary-sig-arg">self</span>, 118 <span class="summary-sig-arg">attr_name</span>, 119 <span class="summary-sig-arg">value</span>)</span><br /> 120 Sets an instance attribute and tracks it in a list of dynamic attributes.</td> 121 <td align="right" valign="top"> 122 <span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource._set_dynamic_attr">source code</a></span> 123 124 </td> 125 </tr> 126 </table> 127 128 </td> 129 </tr> 130<tr> 131 <td width="15%" align="right" valign="top" class="summary"> 132 <span class="summary-type"> </span> 133 </td><td class="summary"> 134 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 135 <tr> 136 <td><span class="summary-sig"><a href="googleapiclient.discovery.Resource-class.html#__getstate__" class="summary-sig-name">__getstate__</a>(<span class="summary-sig-arg">self</span>)</span><br /> 137 Trim the state down to something that can be pickled.</td> 138 <td align="right" valign="top"> 139 <span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource.__getstate__">source code</a></span> 140 141 </td> 142 </tr> 143 </table> 144 145 </td> 146 </tr> 147<tr> 148 <td width="15%" align="right" valign="top" class="summary"> 149 <span class="summary-type"> </span> 150 </td><td class="summary"> 151 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 152 <tr> 153 <td><span class="summary-sig"><a href="googleapiclient.discovery.Resource-class.html#__setstate__" class="summary-sig-name">__setstate__</a>(<span class="summary-sig-arg">self</span>, 154 <span class="summary-sig-arg">state</span>)</span><br /> 155 Reconstitute the state of the object from being pickled.</td> 156 <td align="right" valign="top"> 157 <span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource.__setstate__">source code</a></span> 158 159 </td> 160 </tr> 161 </table> 162 163 </td> 164 </tr> 165<tr class="private"> 166 <td width="15%" align="right" valign="top" class="summary"> 167 <span class="summary-type"> </span> 168 </td><td class="summary"> 169 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 170 <tr> 171 <td><span class="summary-sig"><a name="_set_service_methods"></a><span class="summary-sig-name">_set_service_methods</span>(<span class="summary-sig-arg">self</span>)</span></td> 172 <td align="right" valign="top"> 173 <span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource._set_service_methods">source code</a></span> 174 175 </td> 176 </tr> 177 </table> 178 179 </td> 180 </tr> 181<tr class="private"> 182 <td width="15%" align="right" valign="top" class="summary"> 183 <span class="summary-type"> </span> 184 </td><td class="summary"> 185 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 186 <tr> 187 <td><span class="summary-sig"><a name="_add_basic_methods"></a><span class="summary-sig-name">_add_basic_methods</span>(<span class="summary-sig-arg">self</span>, 188 <span class="summary-sig-arg">resourceDesc</span>, 189 <span class="summary-sig-arg">rootDesc</span>, 190 <span class="summary-sig-arg">schema</span>)</span></td> 191 <td align="right" valign="top"> 192 <span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource._add_basic_methods">source code</a></span> 193 194 </td> 195 </tr> 196 </table> 197 198 </td> 199 </tr> 200<tr class="private"> 201 <td width="15%" align="right" valign="top" class="summary"> 202 <span class="summary-type"> </span> 203 </td><td class="summary"> 204 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 205 <tr> 206 <td><span class="summary-sig"><a name="_add_nested_resources"></a><span class="summary-sig-name">_add_nested_resources</span>(<span class="summary-sig-arg">self</span>, 207 <span class="summary-sig-arg">resourceDesc</span>, 208 <span class="summary-sig-arg">rootDesc</span>, 209 <span class="summary-sig-arg">schema</span>)</span></td> 210 <td align="right" valign="top"> 211 <span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource._add_nested_resources">source code</a></span> 212 213 </td> 214 </tr> 215 </table> 216 217 </td> 218 </tr> 219<tr class="private"> 220 <td width="15%" align="right" valign="top" class="summary"> 221 <span class="summary-type"> </span> 222 </td><td class="summary"> 223 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 224 <tr> 225 <td><span class="summary-sig"><a name="_add_next_methods"></a><span class="summary-sig-name">_add_next_methods</span>(<span class="summary-sig-arg">self</span>, 226 <span class="summary-sig-arg">resourceDesc</span>, 227 <span class="summary-sig-arg">schema</span>)</span></td> 228 <td align="right" valign="top"> 229 <span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource._add_next_methods">source code</a></span> 230 231 </td> 232 </tr> 233 </table> 234 235 </td> 236 </tr> 237 <tr> 238 <td colspan="2" class="summary"> 239 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 240 <code>__delattr__</code>, 241 <code>__format__</code>, 242 <code>__getattribute__</code>, 243 <code>__hash__</code>, 244 <code>__new__</code>, 245 <code>__reduce__</code>, 246 <code>__reduce_ex__</code>, 247 <code>__repr__</code>, 248 <code>__setattr__</code>, 249 <code>__sizeof__</code>, 250 <code>__str__</code>, 251 <code>__subclasshook__</code> 252 </p> 253 </td> 254 </tr> 255</table> 256<!-- ==================== PROPERTIES ==================== --> 257<a name="section-Properties"></a> 258<table class="summary" border="1" cellpadding="3" 259 cellspacing="0" width="100%" bgcolor="white"> 260<tr bgcolor="#70b0f0" class="table-header"> 261 <td colspan="2" class="table-header"> 262 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 263 <tr valign="top"> 264 <td align="left"><span class="table-header">Properties</span></td> 265 <td align="right" valign="top" 266 ><span class="options">[<a href="#section-Properties" 267 class="privatelink" onclick="toggle_private();" 268 >hide private</a>]</span></td> 269 </tr> 270 </table> 271 </td> 272</tr> 273 <tr> 274 <td colspan="2" class="summary"> 275 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 276 <code>__class__</code> 277 </p> 278 </td> 279 </tr> 280</table> 281<!-- ==================== METHOD DETAILS ==================== --> 282<a name="section-MethodDetails"></a> 283<table class="details" border="1" cellpadding="3" 284 cellspacing="0" width="100%" bgcolor="white"> 285<tr bgcolor="#70b0f0" class="table-header"> 286 <td colspan="2" class="table-header"> 287 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 288 <tr valign="top"> 289 <td align="left"><span class="table-header">Method Details</span></td> 290 <td align="right" valign="top" 291 ><span class="options">[<a href="#section-MethodDetails" 292 class="privatelink" onclick="toggle_private();" 293 >hide private</a>]</span></td> 294 </tr> 295 </table> 296 </td> 297</tr> 298</table> 299<a name="__init__"></a> 300<div> 301<table class="details" border="1" cellpadding="3" 302 cellspacing="0" width="100%" bgcolor="white"> 303<tr><td> 304 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 305 <tr valign="top"><td> 306 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, 307 <span class="sig-arg">http</span>, 308 <span class="sig-arg">baseUrl</span>, 309 <span class="sig-arg">model</span>, 310 <span class="sig-arg">requestBuilder</span>, 311 <span class="sig-arg">developerKey</span>, 312 <span class="sig-arg">resourceDesc</span>, 313 <span class="sig-arg">rootDesc</span>, 314 <span class="sig-arg">schema</span>)</span> 315 <br /><em class="fname">(Constructor)</em> 316 </h3> 317 </td><td align="right" valign="top" 318 ><span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource.__init__">source code</a></span> 319 </td> 320 </tr></table> 321 322 <pre class="literalblock"> 323Build a Resource from the API description. 324 325Args: 326 http: httplib2.Http, Object to make http requests with. 327 baseUrl: string, base URL for the API. All requests are relative to this 328 URI. 329 model: googleapiclient.Model, converts to and from the wire format. 330 requestBuilder: class or callable that instantiates an 331 googleapiclient.HttpRequest object. 332 developerKey: string, key obtained from 333 https://code.google.com/apis/console 334 resourceDesc: object, section of deserialized discovery document that 335 describes a resource. Note that the top level discovery document 336 is considered a resource. 337 rootDesc: object, the entire deserialized discovery document. 338 schema: object, mapping of schema names to schema descriptions. 339 340</pre> 341 <dl class="fields"> 342 <dt>Overrides: 343 object.__init__ 344 </dt> 345 </dl> 346</td></tr></table> 347</div> 348<a name="_set_dynamic_attr"></a> 349<div class="private"> 350<table class="details" border="1" cellpadding="3" 351 cellspacing="0" width="100%" bgcolor="white"> 352<tr><td> 353 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 354 <tr valign="top"><td> 355 <h3 class="epydoc"><span class="sig"><span class="sig-name">_set_dynamic_attr</span>(<span class="sig-arg">self</span>, 356 <span class="sig-arg">attr_name</span>, 357 <span class="sig-arg">value</span>)</span> 358 </h3> 359 </td><td align="right" valign="top" 360 ><span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource._set_dynamic_attr">source code</a></span> 361 </td> 362 </tr></table> 363 364 <pre class="literalblock"> 365Sets an instance attribute and tracks it in a list of dynamic attributes. 366 367Args: 368 attr_name: string; The name of the attribute to be set 369 value: The value being set on the object and tracked in the dynamic cache. 370 371</pre> 372 <dl class="fields"> 373 </dl> 374</td></tr></table> 375</div> 376<a name="__getstate__"></a> 377<div> 378<table class="details" border="1" cellpadding="3" 379 cellspacing="0" width="100%" bgcolor="white"> 380<tr><td> 381 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 382 <tr valign="top"><td> 383 <h3 class="epydoc"><span class="sig"><span class="sig-name">__getstate__</span>(<span class="sig-arg">self</span>)</span> 384 </h3> 385 </td><td align="right" valign="top" 386 ><span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource.__getstate__">source code</a></span> 387 </td> 388 </tr></table> 389 390 <pre class="literalblock"> 391Trim the state down to something that can be pickled. 392 393Uses the fact that the instance variable _dynamic_attrs holds attrs that 394will be wiped and restored on pickle serialization. 395 396</pre> 397 <dl class="fields"> 398 </dl> 399</td></tr></table> 400</div> 401<a name="__setstate__"></a> 402<div> 403<table class="details" border="1" cellpadding="3" 404 cellspacing="0" width="100%" bgcolor="white"> 405<tr><td> 406 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 407 <tr valign="top"><td> 408 <h3 class="epydoc"><span class="sig"><span class="sig-name">__setstate__</span>(<span class="sig-arg">self</span>, 409 <span class="sig-arg">state</span>)</span> 410 </h3> 411 </td><td align="right" valign="top" 412 ><span class="codelink"><a href="googleapiclient.discovery-pysrc.html#Resource.__setstate__">source code</a></span> 413 </td> 414 </tr></table> 415 416 <pre class="literalblock"> 417Reconstitute the state of the object from being pickled. 418 419Uses the fact that the instance variable _dynamic_attrs holds attrs that 420will be wiped and restored on pickle serialization. 421 422</pre> 423 <dl class="fields"> 424 </dl> 425</td></tr></table> 426</div> 427<br /> 428<!-- ==================== NAVIGATION BAR ==================== --> 429<table class="navbar" border="0" width="100%" cellpadding="0" 430 bgcolor="#a0c0ff" cellspacing="0"> 431 <tr valign="middle"> 432 <!-- Home link --> 433 <th> <a 434 href="googleapiclient-module.html">Home</a> </th> 435 436 <!-- Tree link --> 437 <th> <a 438 href="module-tree.html">Trees</a> </th> 439 440 <!-- Index link --> 441 <th> <a 442 href="identifier-index.html">Indices</a> </th> 443 444 <!-- Help link --> 445 <th> <a 446 href="help.html">Help</a> </th> 447 448 <th class="navbar" width="100%"></th> 449 </tr> 450</table> 451<table border="0" cellpadding="0" cellspacing="0" width="100%%"> 452 <tr> 453 <td align="left" class="footer"> 454 Generated by Epydoc 3.0.1 on Mon Jun 5 13:38:39 2017 455 </td> 456 <td align="right" class="footer"> 457 <a target="mainFrame" href="http://epydoc.sourceforge.net" 458 >http://epydoc.sourceforge.net</a> 459 </td> 460 </tr> 461</table> 462 463<script type="text/javascript"> 464 <!-- 465 // Private objects are initially displayed (because if 466 // javascript is turned off then we want them to be 467 // visible); but by default, we want to hide them. So hide 468 // them unless we have a cookie that says to show them. 469 checkCookie(); 470 // --> 471</script> 472</body> 473</html> 474