I'm starting with the Google APIs Client Library for Python. I'm developing with the Drive API. I'm migrating my web application from the deprecated Document List API v3 to Drive API V2.
When I add some permissions on a document via BatchHttpRequest, only one of these permissions is effectively added to the document. The others are ignored.
Below a sample code:
def callback(request_id, response, exception):
if exception is not None:
logger.debug(exception)
else:
logger.debug(response)
batch = BatchHttpRequest(callback) # from apiclient.http
batch.add(drive_client.permissions().insert(body=permission_1))
batch.add(drive_client.permissions().insert(body=permission_2))
...
batch.add(drive_client.permissions().insert(body=permission_n))
batch.execute()
Only user permissions are added. The default entry ("anyone") is ignored. Response is always logged, so everything seems to run fine.
If I execute each call separately, all the permissions are added.