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