Home | History | Annotate | Download | only in epy
      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>&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">
     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 = &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 
    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 (a] 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>
    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>&nbsp;&nbsp;&nbsp;<a
    150         href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
    151 
    152   <!-- Tree link -->
    153       <th>&nbsp;&nbsp;&nbsp;<a
    154         href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
    155 
    156   <!-- Index link -->
    157       <th>&nbsp;&nbsp;&nbsp;<a
    158         href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
    159 
    160   <!-- Help link -->
    161       <th>&nbsp;&nbsp;&nbsp;<a
    162         href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</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">
    170     Generated by Epydoc 3.0.1 on Mon Jun  5 13:38:39 2017
    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>
    190