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</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 Module 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 private</a>]</span></td></tr> 49 <tr><td align="right"><span class="options" 50 >[<a href="frames.html" target="_top">frames</a 51 >] | <a href="googleapiclient.schema-module.html" 52 target="_top">no 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 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 = """{ 69 "Foo": { 70 "type": "object", 71 "properties": { 72 "etag": { 73 "type": "string", 74 "description": "ETag of the collection." 75 }, 76 "kind": { 77 "type": "string", 78 "description": "Type of the collection ('calendar#acl').", 79 "default": "calendar#acl" 80 }, 81 "nextPageToken": { 82 "type": "string", 83 "description": "Token used to access the next 84 page of this result. Omitted if no further results are available." 85 } 86 } 87 } 88 }""" 89 90 s = Schemas(schema) 91 print s.prettyPrintByName('Foo') 92 93 Produces the following output: 94 95 { 96 "nextPageToken": "A String", # Token used to access the 97 # next page of this result. Omitted if no further results are available. 98 "kind": "A String", # Type of the collection ('calendar#acl'). 99 "etag": "A String", # 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 [email protected] (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"> </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"> </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> 144<!-- ==================== 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"> </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> 169<!-- ==================== 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> <a 175 href="googleapiclient-module.html">Home</a> </th> 176 177 <!-- Tree link --> 178 <th> <a 179 href="module-tree.html">Trees</a> </th> 180 181 <!-- Index link --> 182 <th> <a 183 href="identifier-index.html">Indices</a> </th> 184 185 <!-- Help link --> 186 <th> <a 187 href="help.html">Help</a> </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"> 195 Generated by Epydoc 3.0.1 on Fri Oct 2 20:46:22 2020 196 </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> 215