-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add a new_batch_http_request() method to services #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# If this is the root Resource, add a new_batch_http_request() method. | ||
if resourceDesc == rootDesc: | ||
def new_batch_http_request(callback=None): | ||
batchPath = 'batch' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Spelling errors on both the first and last lines of your commit message, right? Plus an erroneous second space after a period in the middle paragraph (http://www.slate.com/articles/technology/technology/2011/01/space_invaders.html). |
def new_batch_http_request(callback=None): | ||
batchPath = 'batch' | ||
if 'batchPath' in rootDesc: | ||
batchPath = rootDesc['batchPath'] |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Given the dynamism here I'll want @craigcitro to be looking at this as well as myself. |
@@ -950,6 +951,14 @@ def _set_service_methods(self): | |||
self._add_next_methods(self._resourceDesc, self._schema) | |||
|
|||
def _add_basic_methods(self, resourceDesc, rootDesc, schema): | |||
# If this is the root Resource, add a new_batch_http_request() method. | |||
batch_uri = '%s%s' % ( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This method can be used to get a BatchHttpRequest object with the batch_uri calculated from the rootUrl and batchPath fields from the discovery doc. Without this change, users have to know what the batch url for newer api endpoints is. For example: batch = BatchHttpRequest(batch_uri=http://zoo.googleapis.com/batch) With this change, the syntax is easier: zoo = build('zoo', 'v1', http=http) batch = zoo.new_batch_http_request()
Took me a little while to figure out git rebase, but this now looks like a single commit like we wanted, right? |
LGTM. Any urgent need for this to be merged right away? |
LGTM |
Add a new_batch_http_request(callback=None) method to services.
This method can be used to get a BatchHttpRequest object with the
batch_uri calculated from the rootUrl and batchPath fields from the
discovery doc.
Without this change, users have to know what the batch url for newer api
endpoints is. For example:
batch = BatchHttpRequest(batch_uri=http://zoo.googleapis.com/batch)
With this change, the syntax is easier:
zoo = build('zoo', 'v1', http=http)
batch = zoo.new_batch_http_request()