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