Refresh docs
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index d5d693e..c2429d9 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -245,7 +245,7 @@
if model is None:
features = service.get('features', [])
model = JsonModel('dataWrapper' in features)
- resource = createResource(http, base, model, requestBuilder, developerKey,
+ resource = _createResource(http, base, model, requestBuilder, developerKey,
service, service, schema)
return resource
@@ -311,7 +311,7 @@
return int(maxSize)
-def createResource(http, baseUrl, model, requestBuilder,
+def _createResource(http, baseUrl, model, requestBuilder,
developerKey, resourceDesc, rootDesc, schema):
"""Build a Resource from the API description.
@@ -707,7 +707,7 @@
methodName = fix_method_name(methodName)
def methodResource(self):
- return createResource(self._http, self._baseUrl, self._model,
+ return _createResource(self._http, self._baseUrl, self._model,
self._requestBuilder, self._developerKey,
methodDesc, rootDesc, schema)
diff --git a/apiclient/http.py b/apiclient/http.py
index d8b7688..83f9c51 100644
--- a/apiclient/http.py
+++ b/apiclient/http.py
@@ -801,7 +801,27 @@
class BatchHttpRequest(object):
- """Batches multiple HttpRequest objects into a single HTTP request."""
+ """Batches multiple HttpRequest objects into a single HTTP request.
+
+ Example:
+ from apiclient.http import BatchHttpRequest
+
+ def list_animals(request_id, response):
+ \"\"\"Do something with the animals list response.\"\"\"
+ pass
+
+ def list_farmers(request_id, response):
+ \"\"\"Do something with the farmers list response.\"\"\"
+ pass
+
+ service = build('farm', 'v2')
+
+ batch = BatchHttpRequest()
+
+ batch.add(service.animals().list(), list_animals)
+ batch.add(service.farmers().list(), list_farmers)
+ batch.execute(http)
+ """
def __init__(self, callback=None, batch_uri=None):
"""Constructor for a BatchHttpRequest.
@@ -1019,13 +1039,13 @@
None
Raises:
- BatchError if a resumable request is added to a batch.
+ BatchError if a media request is added to a batch.
KeyError is the request_id is not unique.
"""
if request_id is None:
request_id = self._new_id()
if request.resumable is not None:
- raise BatchError("Resumable requests cannot be used in a batch request.")
+ raise BatchError("Media requests cannot be used in a batch request.")
if request_id in self._requests:
raise KeyError("A request with this ID already exists: %s" % request_id)
self._requests[request_id] = request