107 lines
6.5 KiB
HTML
107 lines
6.5 KiB
HTML
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html><head><title>Python: module apiclient.model</title>
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
<tr bgcolor="#7799ee">
|
|
<td valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.model</strong></big></big></font></td
|
|
><td align=right valign=bottom
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiary/apiclient/model.py">/usr/local/google/home/jcgregorio/projects/apiary/apiclient/model.py</a></font></td></tr></table>
|
|
<p><tt>Model objects for requests and responses<br>
|
|
<br>
|
|
Each API may support one or more serializations, such<br>
|
|
as JSON, Atom, etc. The model classes are responsible<br>
|
|
for converting between the wire format and the Python<br>
|
|
<a href="__builtin__.html#object">object</a> representation.</tt></p>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#aa55cc">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="logging.html">logging</a><br>
|
|
</td><td width="25%" valign=top><a href="simplejson.html">simplejson</a><br>
|
|
</td><td width="25%" valign=top><a href="urllib.html">urllib</a><br>
|
|
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ee77aa">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
|
<td width="100%"><dl>
|
|
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
|
|
</font></dt><dd>
|
|
<dl>
|
|
<dt><font face="helvetica, arial"><a href="apiclient.model.html#JsonModel">JsonModel</a>
|
|
</font></dt></dl>
|
|
</dd>
|
|
</dl>
|
|
<p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#ffc8d8">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#000000" face="helvetica, arial"><a name="JsonModel">class <strong>JsonModel</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
<td colspan=2><tt>Model class for JSON.<br>
|
|
<br>
|
|
Serializes and de-serializes between JSON and the Python<br>
|
|
<a href="__builtin__.html#object">object</a> representation of HTTP request and response bodies.<br> </tt></td></tr>
|
|
<tr><td> </td>
|
|
<td width="100%">Methods defined here:<br>
|
|
<dl><dt><a name="JsonModel-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates outgoing requests with JSON bodies.<br>
|
|
<br>
|
|
Args:<br>
|
|
headers: dict, request headers<br>
|
|
path_params: dict, parameters that appear in the request path<br>
|
|
query_params: dict, parameters that appear in the query<br>
|
|
body_value: <a href="__builtin__.html#object">object</a>, the request body as a Python <a href="__builtin__.html#object">object</a>, which must be<br>
|
|
serializable by simplejson.<br>
|
|
Returns:<br>
|
|
A tuple of (headers, path_params, query, body)<br>
|
|
<br>
|
|
headers: dict, request headers<br>
|
|
path_params: dict, parameters that appear in the request path<br>
|
|
query: string, query part of the request URI<br>
|
|
body: string, the body serialized as JSON</tt></dd></dl>
|
|
|
|
<dl><dt><a name="JsonModel-response"><strong>response</strong></a>(self, resp, content)</dt><dd><tt>Convert the response wire format into a Python <a href="__builtin__.html#object">object</a>.<br>
|
|
<br>
|
|
Args:<br>
|
|
resp: httplib2.Response, the HTTP response headers and status<br>
|
|
content: string, the body of the HTTP response<br>
|
|
<br>
|
|
Returns:<br>
|
|
The body de-serialized as a Python <a href="__builtin__.html#object">object</a>.<br>
|
|
<br>
|
|
Raises:<br>
|
|
apiclient.errors.HttpError if a non 2xx response is received.</tt></dd></dl>
|
|
|
|
<hr>
|
|
Data descriptors defined here:<br>
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
</dl>
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
</dl>
|
|
</td></tr></table></td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#55aa55">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
|
<td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p>
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
<tr bgcolor="#7799ee">
|
|
<td colspan=3 valign=bottom> <br>
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
|
|
|
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
|
<td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table>
|
|
</body></html> |