John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 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"> |
| 60 | Schema processing for discovery based APIs |
| 61 | |
| 62 | Schemas holds an APIs discovery schemas. It can return those schema as |
| 63 | deserialized JSON objects, or pretty print them as prototype objects that |
| 64 | conform to the schema. |
| 65 | |
| 66 | For 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 | |
| 102 | The 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"> </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 | <!-- ==================== NAVIGATION BAR ==================== --> |
| 145 | <table class="navbar" border="0" width="100%" cellpadding="0" |
| 146 | bgcolor="#a0c0ff" cellspacing="0"> |
| 147 | <tr valign="middle"> |
| 148 | <!-- Home link --> |
| 149 | <th> <a |
| 150 | href="googleapiclient-module.html">Home</a> </th> |
| 151 | |
| 152 | <!-- Tree link --> |
| 153 | <th> <a |
| 154 | href="module-tree.html">Trees</a> </th> |
| 155 | |
| 156 | <!-- Index link --> |
| 157 | <th> <a |
| 158 | href="identifier-index.html">Indices</a> </th> |
| 159 | |
| 160 | <!-- Help link --> |
| 161 | <th> <a |
| 162 | href="help.html">Help</a> </th> |
| 163 | |
| 164 | <th class="navbar" width="100%"></th> |
| 165 | </tr> |
| 166 | </table> |
| 167 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
| 168 | <tr> |
| 169 | <td align="left" class="footer"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame^] | 170 | Generated by Epydoc 3.0.1 on Fri Mar 24 17:07:55 2017 |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 171 | </td> |
| 172 | <td align="right" class="footer"> |
| 173 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
| 174 | >http://epydoc.sourceforge.net</a> |
| 175 | </td> |
| 176 | </tr> |
| 177 | </table> |
| 178 | |
| 179 | <script type="text/javascript"> |
| 180 | <!-- |
| 181 | // Private objects are initially displayed (because if |
| 182 | // javascript is turned off then we want them to be |
| 183 | // visible); but by default, we want to hide them. So hide |
| 184 | // them unless we have a cookie that says to show them. |
| 185 | checkCookie(); |
| 186 | // --> |
| 187 | </script> |
| 188 | </body> |
| 189 | </html> |