Version 1.0 beta 2
diff --git a/docs/apiclient.model.html b/docs/apiclient.model.html
index eb102e7..9b26d10 100644
--- a/docs/apiclient.model.html
+++ b/docs/apiclient.model.html
@@ -8,7 +8,7 @@
<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:/home/jcgregorio/projects/apiclient-release/apiclient/model.py">/home/jcgregorio/projects/apiclient-release/apiclient/model.py</a></font></td></tr></table>
+><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/google-api-python-client/apiclient/model.py">/home/jcgregorio/projects/google-api-python-client/apiclient/model.py</a></font></td></tr></table>
<p><tt><a href="#Model">Model</a> objects for requests and responses.<br>
<br>
Each API may support one or more serializations, such<br>
@@ -40,10 +40,11 @@
<dt><font face="helvetica, arial"><a href="apiclient.model.html#Model">Model</a>
</font></dt><dd>
<dl>
-<dt><font face="helvetica, arial"><a href="apiclient.model.html#JsonModel">JsonModel</a>
+<dt><font face="helvetica, arial"><a href="apiclient.model.html#BaseModel">BaseModel</a>
</font></dt><dd>
<dl>
-<dt><font face="helvetica, arial"><a href="apiclient.model.html#LoggingJsonModel">LoggingJsonModel</a>
+<dt><font face="helvetica, arial"><a href="apiclient.model.html#JsonModel">JsonModel</a>
+</font></dt><dt><font face="helvetica, arial"><a href="apiclient.model.html#ProtocolBufferModel">ProtocolBufferModel</a>
</font></dt></dl>
</dd>
</dl>
@@ -55,7 +56,95 @@
<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="apiclient.model.html#Model">Model</a>)</font></td></tr>
+<font color="#000000" face="helvetica, arial"><a name="BaseModel">class <strong>BaseModel</strong></a>(<a href="apiclient.model.html#Model">Model</a>)</font></td></tr>
+
+<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
+<td colspan=2><tt>Base model class.<br>
+ <br>
+Subclasses should provide implementations for the "serialize" and<br>
+"deserialize" methods, as well as values for the following class attributes.<br>
+ <br>
+Attributes:<br>
+ accept: The value to use for the HTTP Accept header.<br>
+ content_type: The value to use for the HTTP Content-type header.<br>
+ no_content_response: The value to return when deserializing a 204 "No<br>
+ Content" response.<br>
+ alt_param: The value to supply as the "alt" query parameter for requests.<br> </tt></td></tr>
+<tr><td> </td>
+<td width="100%"><dl><dt>Method resolution order:</dt>
+<dd><a href="apiclient.model.html#BaseModel">BaseModel</a></dd>
+<dd><a href="apiclient.model.html#Model">Model</a></dd>
+<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
+</dl>
+<hr>
+Methods defined here:<br>
+<dl><dt><a name="BaseModel-deserialize"><strong>deserialize</strong></a>(self, content)</dt><dd><tt>Perform the actual deserialization from response string to Python <a href="__builtin__.html#object">object</a>.<br>
+ <br>
+Args:<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>.</tt></dd></dl>
+
+<dl><dt><a name="BaseModel-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates outgoing requests with a serialized body.<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="BaseModel-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>
+
+<dl><dt><a name="BaseModel-serialize"><strong>serialize</strong></a>(self, body_value)</dt><dd><tt>Perform the actual Python <a href="__builtin__.html#object">object</a> serialization.<br>
+ <br>
+Args:<br>
+ body_value: <a href="__builtin__.html#object">object</a>, the request body as a Python <a href="__builtin__.html#object">object</a>.<br>
+ <br>
+Returns:<br>
+ string, the body in serialized form.</tt></dd></dl>
+
+<hr>
+Data and other attributes defined here:<br>
+<dl><dt><strong>accept</strong> = None</dl>
+
+<dl><dt><strong>alt_param</strong> = None</dl>
+
+<dl><dt><strong>content_type</strong> = None</dl>
+
+<dl><dt><strong>no_content_response</strong> = None</dl>
+
+<hr>
+Data descriptors inherited from <a href="apiclient.model.html#Model">Model</a>:<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> <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="apiclient.model.html#BaseModel">BaseModel</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt><a href="#Model">Model</a> class for JSON.<br>
@@ -65,17 +154,36 @@
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="apiclient.model.html#JsonModel">JsonModel</a></dd>
+<dd><a href="apiclient.model.html#BaseModel">BaseModel</a></dd>
<dd><a href="apiclient.model.html#Model">Model</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
-<dl><dt><a name="JsonModel-__init__"><strong>__init__</strong></a>(self, data_wrapper<font color="#909090">=False</font>)</dt><dd><tt>Construct a <a href="#JsonModel">JsonModel</a><br>
+<dl><dt><a name="JsonModel-__init__"><strong>__init__</strong></a>(self, data_wrapper<font color="#909090">=False</font>)</dt><dd><tt>Construct a <a href="#JsonModel">JsonModel</a>.<br>
<br>
Args:<br>
data_wrapper: boolean, wrap requests and responses in a data wrapper</tt></dd></dl>
-<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>
+<dl><dt><a name="JsonModel-deserialize"><strong>deserialize</strong></a>(self, content)</dt></dl>
+
+<dl><dt><a name="JsonModel-serialize"><strong>serialize</strong></a>(self, body_value)</dt></dl>
+
+<hr>
+Data descriptors defined here:<br>
+<dl><dt><strong>no_content_response</strong></dt>
+</dl>
+<hr>
+Data and other attributes defined here:<br>
+<dl><dt><strong>accept</strong> = 'application/json'</dl>
+
+<dl><dt><strong>alt_param</strong> = 'json'</dl>
+
+<dl><dt><strong>content_type</strong> = 'application/json'</dl>
+
+<hr>
+Methods inherited from <a href="apiclient.model.html#BaseModel">BaseModel</a>:<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 a serialized body.<br>
<br>
Args:<br>
headers: dict, request headers<br>
@@ -115,63 +223,6 @@
<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="LoggingJsonModel">class <strong>LoggingJsonModel</strong></a>(<a href="apiclient.model.html#JsonModel">JsonModel</a>)</font></td></tr>
-
-<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
-<td colspan=2><tt>A printable <a href="#JsonModel">JsonModel</a> class that supports logging response info.<br> </tt></td></tr>
-<tr><td> </td>
-<td width="100%"><dl><dt>Method resolution order:</dt>
-<dd><a href="apiclient.model.html#LoggingJsonModel">LoggingJsonModel</a></dd>
-<dd><a href="apiclient.model.html#JsonModel">JsonModel</a></dd>
-<dd><a href="apiclient.model.html#Model">Model</a></dd>
-<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
-</dl>
-<hr>
-Methods defined here:<br>
-<dl><dt><a name="LoggingJsonModel-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>An overloaded request method that will output debug info if requested.<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="LoggingJsonModel-response"><strong>response</strong></a>(self, resp, content)</dt><dd><tt>An overloaded response method that will output debug info if requested.<br>
- <br>
-Args:<br>
- resp: An httplib2.Response <a href="__builtin__.html#object">object</a>.<br>
- content: A string representing the response body.<br>
- <br>
-Returns:<br>
- The body de-serialized as a Python <a href="__builtin__.html#object">object</a>.</tt></dd></dl>
-
-<hr>
-Methods inherited from <a href="apiclient.model.html#JsonModel">JsonModel</a>:<br>
-<dl><dt><a name="LoggingJsonModel-__init__"><strong>__init__</strong></a>(self, data_wrapper<font color="#909090">=False</font>)</dt><dd><tt>Construct a <a href="#JsonModel">JsonModel</a><br>
- <br>
-Args:<br>
- data_wrapper: boolean, wrap requests and responses in a data wrapper</tt></dd></dl>
-
-<hr>
-Data descriptors inherited from <a href="apiclient.model.html#Model">Model</a>:<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> <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="Model">class <strong>Model</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
@@ -182,7 +233,7 @@
format such as JSON and a Python <a href="__builtin__.html#object">object</a> representation.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
-<dl><dt><a name="Model-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates outgoing requests with a deserialized body.<br>
+<dl><dt><a name="Model-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates outgoing requests with a serialized body.<br>
<br>
Args:<br>
headers: dict, request headers<br>
@@ -218,6 +269,89 @@
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
+</td></tr></table> <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="ProtocolBufferModel">class <strong>ProtocolBufferModel</strong></a>(<a href="apiclient.model.html#BaseModel">BaseModel</a>)</font></td></tr>
+
+<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
+<td colspan=2><tt><a href="#Model">Model</a> class for protocol buffers.<br>
+ <br>
+Serializes and de-serializes the binary protocol buffer sent in the HTTP<br>
+request and response bodies.<br> </tt></td></tr>
+<tr><td> </td>
+<td width="100%"><dl><dt>Method resolution order:</dt>
+<dd><a href="apiclient.model.html#ProtocolBufferModel">ProtocolBufferModel</a></dd>
+<dd><a href="apiclient.model.html#BaseModel">BaseModel</a></dd>
+<dd><a href="apiclient.model.html#Model">Model</a></dd>
+<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
+</dl>
+<hr>
+Methods defined here:<br>
+<dl><dt><a name="ProtocolBufferModel-__init__"><strong>__init__</strong></a>(self, protocol_buffer)</dt><dd><tt>Constructs a <a href="#ProtocolBufferModel">ProtocolBufferModel</a>.<br>
+ <br>
+The serialzed protocol buffer returned in an HTTP response will be<br>
+de-serialized using the given protocol buffer class.<br>
+ <br>
+Args:<br>
+ protocol_buffer: The protocol buffer class used to de-serialize a response<br>
+ from the API.</tt></dd></dl>
+
+<dl><dt><a name="ProtocolBufferModel-deserialize"><strong>deserialize</strong></a>(self, content)</dt></dl>
+
+<dl><dt><a name="ProtocolBufferModel-serialize"><strong>serialize</strong></a>(self, body_value)</dt></dl>
+
+<hr>
+Data descriptors defined here:<br>
+<dl><dt><strong>no_content_response</strong></dt>
+</dl>
+<hr>
+Data and other attributes defined here:<br>
+<dl><dt><strong>accept</strong> = 'application/x-protobuf'</dl>
+
+<dl><dt><strong>alt_param</strong> = 'proto'</dl>
+
+<dl><dt><strong>content_type</strong> = 'application/x-protobuf'</dl>
+
+<hr>
+Methods inherited from <a href="apiclient.model.html#BaseModel">BaseModel</a>:<br>
+<dl><dt><a name="ProtocolBufferModel-request"><strong>request</strong></a>(self, headers, path_params, query_params, body_value)</dt><dd><tt>Updates outgoing requests with a serialized body.<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="ProtocolBufferModel-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 inherited from <a href="apiclient.model.html#Model">Model</a>:<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">