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