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.schema._SchemaToStruct</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.schema-module.html">Module schema</a> :: 42 Class _SchemaToStruct 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.schema._SchemaToStruct-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 _SchemaToStruct</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct">source code</a></span></p> 60<center> 61 62</center> 63<hr /> 64<pre class="literalblock"> 65Convert schema to a prototype object. 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.schema._SchemaToStruct-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, 93 <span class="summary-sig-arg">schema</span>, 94 <span class="summary-sig-arg">seen</span>, 95 <span class="summary-sig-arg">dent</span>=<span class="summary-sig-default">0</span>)</span><br /> 96 Constructor.</td> 97 <td align="right" valign="top"> 98 <span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.__init__">source code</a></span> 99 100 </td> 101 </tr> 102 </table> 103 104 </td> 105 </tr> 106<tr> 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="googleapiclient.schema._SchemaToStruct-class.html#emit" class="summary-sig-name">emit</a>(<span class="summary-sig-arg">self</span>, 113 <span class="summary-sig-arg">text</span>)</span><br /> 114 Add text as a line to the output.</td> 115 <td align="right" valign="top"> 116 <span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.emit">source code</a></span> 117 118 </td> 119 </tr> 120 </table> 121 122 </td> 123 </tr> 124<tr> 125 <td width="15%" align="right" valign="top" class="summary"> 126 <span class="summary-type"> </span> 127 </td><td class="summary"> 128 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 129 <tr> 130 <td><span class="summary-sig"><a href="googleapiclient.schema._SchemaToStruct-class.html#emitBegin" class="summary-sig-name">emitBegin</a>(<span class="summary-sig-arg">self</span>, 131 <span class="summary-sig-arg">text</span>)</span><br /> 132 Add text to the output, but with no line terminator.</td> 133 <td align="right" valign="top"> 134 <span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.emitBegin">source code</a></span> 135 136 </td> 137 </tr> 138 </table> 139 140 </td> 141 </tr> 142<tr> 143 <td width="15%" align="right" valign="top" class="summary"> 144 <span class="summary-type"> </span> 145 </td><td class="summary"> 146 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 147 <tr> 148 <td><span class="summary-sig"><a href="googleapiclient.schema._SchemaToStruct-class.html#emitEnd" class="summary-sig-name">emitEnd</a>(<span class="summary-sig-arg">self</span>, 149 <span class="summary-sig-arg">text</span>, 150 <span class="summary-sig-arg">comment</span>)</span><br /> 151 Add text and comment to the output with line terminator.</td> 152 <td align="right" valign="top"> 153 <span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.emitEnd">source code</a></span> 154 155 </td> 156 </tr> 157 </table> 158 159 </td> 160 </tr> 161<tr> 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 name="indent"></a><span class="summary-sig-name">indent</span>(<span class="summary-sig-arg">self</span>)</span><br /> 168 Increase indentation level.</td> 169 <td align="right" valign="top"> 170 <span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.indent">source code</a></span> 171 172 </td> 173 </tr> 174 </table> 175 176 </td> 177 </tr> 178<tr> 179 <td width="15%" align="right" valign="top" class="summary"> 180 <span class="summary-type"> </span> 181 </td><td class="summary"> 182 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 183 <tr> 184 <td><span class="summary-sig"><a name="undent"></a><span class="summary-sig-name">undent</span>(<span class="summary-sig-arg">self</span>)</span><br /> 185 Decrease indentation level.</td> 186 <td align="right" valign="top"> 187 <span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.undent">source code</a></span> 188 189 </td> 190 </tr> 191 </table> 192 193 </td> 194 </tr> 195<tr class="private"> 196 <td width="15%" align="right" valign="top" class="summary"> 197 <span class="summary-type"> </span> 198 </td><td class="summary"> 199 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 200 <tr> 201 <td><span class="summary-sig"><a href="googleapiclient.schema._SchemaToStruct-class.html#_to_str_impl" class="summary-sig-name" onclick="show_private();">_to_str_impl</a>(<span class="summary-sig-arg">self</span>, 202 <span class="summary-sig-arg">schema</span>)</span><br /> 203 Prototype object based on the schema, in Python code with comments.</td> 204 <td align="right" valign="top"> 205 <span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct._to_str_impl">source code</a></span> 206 207 </td> 208 </tr> 209 </table> 210 211 </td> 212 </tr> 213<tr> 214 <td width="15%" align="right" valign="top" class="summary"> 215 <span class="summary-type"> </span> 216 </td><td class="summary"> 217 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 218 <tr> 219 <td><span class="summary-sig"><a href="googleapiclient.schema._SchemaToStruct-class.html#to_str" class="summary-sig-name">to_str</a>(<span class="summary-sig-arg">self</span>, 220 <span class="summary-sig-arg">from_cache</span>)</span><br /> 221 Prototype object based on the schema, in Python code with comments.</td> 222 <td align="right" valign="top"> 223 <span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.to_str">source code</a></span> 224 225 </td> 226 </tr> 227 </table> 228 229 </td> 230 </tr> 231 <tr> 232 <td colspan="2" class="summary"> 233 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 234 <code>__delattr__</code>, 235 <code>__format__</code>, 236 <code>__getattribute__</code>, 237 <code>__hash__</code>, 238 <code>__new__</code>, 239 <code>__reduce__</code>, 240 <code>__reduce_ex__</code>, 241 <code>__repr__</code>, 242 <code>__setattr__</code>, 243 <code>__sizeof__</code>, 244 <code>__str__</code>, 245 <code>__subclasshook__</code> 246 </p> 247 </td> 248 </tr> 249</table> 250<!-- ==================== PROPERTIES ==================== --> 251<a name="section-Properties"></a> 252<table class="summary" border="1" cellpadding="3" 253 cellspacing="0" width="100%" bgcolor="white"> 254<tr bgcolor="#70b0f0" class="table-header"> 255 <td colspan="2" class="table-header"> 256 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 257 <tr valign="top"> 258 <td align="left"><span class="table-header">Properties</span></td> 259 <td align="right" valign="top" 260 ><span class="options">[<a href="#section-Properties" 261 class="privatelink" onclick="toggle_private();" 262 >hide private</a>]</span></td> 263 </tr> 264 </table> 265 </td> 266</tr> 267 <tr> 268 <td colspan="2" class="summary"> 269 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 270 <code>__class__</code> 271 </p> 272 </td> 273 </tr> 274</table> 275<!-- ==================== METHOD DETAILS ==================== --> 276<a name="section-MethodDetails"></a> 277<table class="details" border="1" cellpadding="3" 278 cellspacing="0" width="100%" bgcolor="white"> 279<tr bgcolor="#70b0f0" class="table-header"> 280 <td colspan="2" class="table-header"> 281 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 282 <tr valign="top"> 283 <td align="left"><span class="table-header">Method Details</span></td> 284 <td align="right" valign="top" 285 ><span class="options">[<a href="#section-MethodDetails" 286 class="privatelink" onclick="toggle_private();" 287 >hide private</a>]</span></td> 288 </tr> 289 </table> 290 </td> 291</tr> 292</table> 293<a name="__init__"></a> 294<div> 295<table class="details" border="1" cellpadding="3" 296 cellspacing="0" width="100%" bgcolor="white"> 297<tr><td> 298 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 299 <tr valign="top"><td> 300 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, 301 <span class="sig-arg">schema</span>, 302 <span class="sig-arg">seen</span>, 303 <span class="sig-arg">dent</span>=<span class="sig-default">0</span>)</span> 304 <br /><em class="fname">(Constructor)</em> 305 </h3> 306 </td><td align="right" valign="top" 307 ><span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.__init__">source code</a></span> 308 </td> 309 </tr></table> 310 311 <pre class="literalblock"> 312Constructor. 313 314Args: 315 schema: object, Parsed JSON schema. 316 seen: list, List of names of schema already seen while parsing. Used to 317 handle recursive definitions. 318 dent: int, Initial indentation depth. 319 320</pre> 321 <dl class="fields"> 322 <dt>Decorators:</dt> 323 <dd><ul class="nomargin-top"> 324 <li><code>@util.positional(3)</code></li> 325 </ul></dd> 326 <dt>Overrides: 327 object.__init__ 328 </dt> 329 </dl> 330</td></tr></table> 331</div> 332<a name="emit"></a> 333<div> 334<table class="details" border="1" cellpadding="3" 335 cellspacing="0" width="100%" bgcolor="white"> 336<tr><td> 337 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 338 <tr valign="top"><td> 339 <h3 class="epydoc"><span class="sig"><span class="sig-name">emit</span>(<span class="sig-arg">self</span>, 340 <span class="sig-arg">text</span>)</span> 341 </h3> 342 </td><td align="right" valign="top" 343 ><span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.emit">source code</a></span> 344 </td> 345 </tr></table> 346 347 <pre class="literalblock"> 348Add text as a line to the output. 349 350Args: 351 text: string, Text to output. 352 353</pre> 354 <dl class="fields"> 355 </dl> 356</td></tr></table> 357</div> 358<a name="emitBegin"></a> 359<div> 360<table class="details" border="1" cellpadding="3" 361 cellspacing="0" width="100%" bgcolor="white"> 362<tr><td> 363 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 364 <tr valign="top"><td> 365 <h3 class="epydoc"><span class="sig"><span class="sig-name">emitBegin</span>(<span class="sig-arg">self</span>, 366 <span class="sig-arg">text</span>)</span> 367 </h3> 368 </td><td align="right" valign="top" 369 ><span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.emitBegin">source code</a></span> 370 </td> 371 </tr></table> 372 373 <pre class="literalblock"> 374Add text to the output, but with no line terminator. 375 376Args: 377 text: string, Text to output. 378 379 380</pre> 381 <dl class="fields"> 382 </dl> 383</td></tr></table> 384</div> 385<a name="emitEnd"></a> 386<div> 387<table class="details" border="1" cellpadding="3" 388 cellspacing="0" width="100%" bgcolor="white"> 389<tr><td> 390 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 391 <tr valign="top"><td> 392 <h3 class="epydoc"><span class="sig"><span class="sig-name">emitEnd</span>(<span class="sig-arg">self</span>, 393 <span class="sig-arg">text</span>, 394 <span class="sig-arg">comment</span>)</span> 395 </h3> 396 </td><td align="right" valign="top" 397 ><span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.emitEnd">source code</a></span> 398 </td> 399 </tr></table> 400 401 <pre class="literalblock"> 402Add text and comment to the output with line terminator. 403 404Args: 405 text: string, Text to output. 406 comment: string, Python comment. 407 408</pre> 409 <dl class="fields"> 410 </dl> 411</td></tr></table> 412</div> 413<a name="_to_str_impl"></a> 414<div class="private"> 415<table class="details" border="1" cellpadding="3" 416 cellspacing="0" width="100%" bgcolor="white"> 417<tr><td> 418 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 419 <tr valign="top"><td> 420 <h3 class="epydoc"><span class="sig"><span class="sig-name">_to_str_impl</span>(<span class="sig-arg">self</span>, 421 <span class="sig-arg">schema</span>)</span> 422 </h3> 423 </td><td align="right" valign="top" 424 ><span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct._to_str_impl">source code</a></span> 425 </td> 426 </tr></table> 427 428 <pre class="literalblock"> 429Prototype object based on the schema, in Python code with comments. 430 431Args: 432 schema: object, Parsed JSON schema file. 433 434Returns: 435 Prototype object based on the schema, in Python code with comments. 436 437</pre> 438 <dl class="fields"> 439 </dl> 440</td></tr></table> 441</div> 442<a name="to_str"></a> 443<div> 444<table class="details" border="1" cellpadding="3" 445 cellspacing="0" width="100%" bgcolor="white"> 446<tr><td> 447 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 448 <tr valign="top"><td> 449 <h3 class="epydoc"><span class="sig"><span class="sig-name">to_str</span>(<span class="sig-arg">self</span>, 450 <span class="sig-arg">from_cache</span>)</span> 451 </h3> 452 </td><td align="right" valign="top" 453 ><span class="codelink"><a href="googleapiclient.schema-pysrc.html#_SchemaToStruct.to_str">source code</a></span> 454 </td> 455 </tr></table> 456 457 <pre class="literalblock"> 458Prototype object based on the schema, in Python code with comments. 459 460Args: 461 from_cache: callable(name, seen), Callable that retrieves an object 462 prototype for a schema with the given name. Seen is a list of schema 463 names already seen as we recursively descend the schema definition. 464 465Returns: 466 Prototype object based on the schema, in Python code with comments. 467 The lines of the code will all be properly indented. 468 469</pre> 470 <dl class="fields"> 471 </dl> 472</td></tr></table> 473</div> 474<br /> 475<!-- ==================== NAVIGATION BAR ==================== --> 476<table class="navbar" border="0" width="100%" cellpadding="0" 477 bgcolor="#a0c0ff" cellspacing="0"> 478 <tr valign="middle"> 479 <!-- Home link --> 480 <th> <a 481 href="googleapiclient-module.html">Home</a> </th> 482 483 <!-- Tree link --> 484 <th> <a 485 href="module-tree.html">Trees</a> </th> 486 487 <!-- Index link --> 488 <th> <a 489 href="identifier-index.html">Indices</a> </th> 490 491 <!-- Help link --> 492 <th> <a 493 href="help.html">Help</a> </th> 494 495 <th class="navbar" width="100%"></th> 496 </tr> 497</table> 498<table border="0" cellpadding="0" cellspacing="0" width="100%%"> 499 <tr> 500 <td align="left" class="footer"> 501 Generated by Epydoc 3.0.1 on Mon Jun 5 13:38:40 2017 502 </td> 503 <td align="right" class="footer"> 504 <a target="mainFrame" href="http://epydoc.sourceforge.net" 505 >http://epydoc.sourceforge.net</a> 506 </td> 507 </tr> 508</table> 509 510<script type="text/javascript"> 511 <!-- 512 // Private objects are initially displayed (because if 513 // javascript is turned off then we want them to be 514 // visible); but by default, we want to hide them. So hide 515 // them unless we have a cookie that says to show them. 516 checkCookie(); 517 // --> 518</script> 519</body> 520</html> 521