blob: 4f2053fda5025aab974091d470ab789d910c8f29 [file] [log] [blame]
Joe Gregorio5dc0f5c2012-06-05 13:34:31 -04001<?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.schema</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>&nbsp;&nbsp;&nbsp;<a
20 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
21
22 <!-- Index link -->
23 <th>&nbsp;&nbsp;&nbsp;<a
24 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
25
26 <!-- Help link -->
27 <th>&nbsp;&nbsp;&nbsp;<a
28 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</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&nbsp;apiclient</a> ::
38 Module&nbsp;schema
39 </span>
40 </td>
41 <td>
42 <table cellpadding="0" cellspacing="0">
43 <!-- hide/show private -->
44 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
45 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
46 <tr><td align="right"><span class="options"
47 >[<a href="frames.html" target="_top">frames</a
48 >]&nbsp;|&nbsp;<a href="apiclient.schema-module.html"
49 target="_top">no&nbsp;frames</a>]</span></td></tr>
50 </table>
51 </td>
52 </tr>
53</table>
54<!-- ==================== MODULE DESCRIPTION ==================== -->
55<h1 class="epydoc">Module schema</h1><p class="nomargin-top"><span class="codelink"><a href="apiclient.schema-pysrc.html">source&nbsp;code</a></span></p>
56<pre class="literalblock">
57Schema processing for discovery based APIs
58
59Schemas holds an APIs discovery schemas. It can return those schema as
60deserialized JSON objects, or pretty print them as prototype objects that
61conform to the schema.
62
63For example, given the schema:
64
65 schema = &quot;&quot;&quot;{
66 &quot;Foo&quot;: {
67 &quot;type&quot;: &quot;object&quot;,
68 &quot;properties&quot;: {
69 &quot;etag&quot;: {
70 &quot;type&quot;: &quot;string&quot;,
71 &quot;description&quot;: &quot;ETag of the collection.&quot;
72 },
73 &quot;kind&quot;: {
74 &quot;type&quot;: &quot;string&quot;,
75 &quot;description&quot;: &quot;Type of the collection ('calendar#acl').&quot;,
76 &quot;default&quot;: &quot;calendar#acl&quot;
77 },
78 &quot;nextPageToken&quot;: {
79 &quot;type&quot;: &quot;string&quot;,
80 &quot;description&quot;: &quot;Token used to access the next
81 page of this result. Omitted if no further results are available.&quot;
82 }
83 }
84 }
85 }&quot;&quot;&quot;
86
87 s = Schemas(schema)
88 print s.prettyPrintByName('Foo')
89
90 Produces the following output:
91
92 {
93 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token used to access the
94 # next page of this result. Omitted if no further results are available.
95 &quot;kind&quot;: &quot;A String&quot;, # Type of the collection ('calendar#acl').
96 &quot;etag&quot;: &quot;A String&quot;, # ETag of the collection.
97 },
98
99The constructor takes a discovery document in which to look up named schema.
100
101</pre>
102
103<hr />
104<div class="fields"> <p><strong>Author:</strong>
105 jcgregorio@google.com (Joe Gregorio)
106 </p>
107</div><!-- ==================== CLASSES ==================== -->
108<a name="section-Classes"></a>
109<table class="summary" border="1" cellpadding="3"
110 cellspacing="0" width="100%" bgcolor="white">
111<tr bgcolor="#70b0f0" class="table-header">
112 <td colspan="2" class="table-header">
113 <table border="0" cellpadding="0" cellspacing="0" width="100%">
114 <tr valign="top">
115 <td align="left"><span class="table-header">Classes</span></td>
116 <td align="right" valign="top"
117 ><span class="options">[<a href="#section-Classes"
118 class="privatelink" onclick="toggle_private();"
119 >hide private</a>]</span></td>
120 </tr>
121 </table>
122 </td>
123</tr>
124<tr>
125 <td width="15%" align="right" valign="top" class="summary">
126 <span class="summary-type">&nbsp;</span>
127 </td><td class="summary">
128 <a href="apiclient.schema.Schemas-class.html" class="summary-name">Schemas</a><br />
129 Schemas for an API.
130 </td>
131 </tr>
132<tr class="private">
133 <td width="15%" align="right" valign="top" class="summary">
134 <span class="summary-type">&nbsp;</span>
135 </td><td class="summary">
136 <a href="apiclient.schema._SchemaToStruct-class.html" class="summary-name" onclick="show_private();">_SchemaToStruct</a><br />
137 Convert schema to a prototype object.
138 </td>
139 </tr>
140</table>
141<!-- ==================== VARIABLES ==================== -->
142<a name="section-Variables"></a>
143<table class="summary" border="1" cellpadding="3"
144 cellspacing="0" width="100%" bgcolor="white">
145<tr bgcolor="#70b0f0" class="table-header">
146 <td colspan="2" class="table-header">
147 <table border="0" cellpadding="0" cellspacing="0" width="100%">
148 <tr valign="top">
149 <td align="left"><span class="table-header">Variables</span></td>
150 <td align="right" valign="top"
151 ><span class="options">[<a href="#section-Variables"
152 class="privatelink" onclick="toggle_private();"
153 >hide private</a>]</span></td>
154 </tr>
155 </table>
156 </td>
157</tr>
158<tr>
159 <td width="15%" align="right" valign="top" class="summary">
160 <span class="summary-type">&nbsp;</span>
161 </td><td class="summary">
162 <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'apiclient'"><code class="variable-quote">'</code><code class="variable-string">apiclient</code><code class="variable-quote">'</code></code>
163 </td>
164 </tr>
165</table>
166<!-- ==================== NAVIGATION BAR ==================== -->
167<table class="navbar" border="0" width="100%" cellpadding="0"
168 bgcolor="#a0c0ff" cellspacing="0">
169 <tr valign="middle">
170
171 <!-- Tree link -->
172 <th>&nbsp;&nbsp;&nbsp;<a
173 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
174
175 <!-- Index link -->
176 <th>&nbsp;&nbsp;&nbsp;<a
177 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
178
179 <!-- Help link -->
180 <th>&nbsp;&nbsp;&nbsp;<a
181 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
182
183 <th class="navbar" width="100%"></th>
184 </tr>
185</table>
186<table border="0" cellpadding="0" cellspacing="0" width="100%%">
187 <tr>
188 <td align="left" class="footer">
Joe Gregorio0cd347a2012-08-30 08:22:27 -0400189 Generated by Epydoc 3.0.1 on Thu Aug 30 07:12:42 2012
Joe Gregorio5dc0f5c2012-06-05 13:34:31 -0400190 </td>
191 <td align="right" class="footer">
192 <a target="mainFrame" href="http://epydoc.sourceforge.net"
193 >http://epydoc.sourceforge.net</a>
194 </td>
195 </tr>
196</table>
197
198<script type="text/javascript">
199 <!--
200 // Private objects are initially displayed (because if
201 // javascript is turned off then we want them to be
202 // visible); but by default, we want to hide them. So hide
203 // them unless we have a cookie that says to show them.
204 checkCookie();
205 // -->
206</script>
207</body>
208</html>