I'm trying grant publish rights to a topic using SetIamPolicy as has been described here: [Google Cloud Pub/Sub API - Push E-mail but no success yet - not sure what the exact call should look like.
For now I've made a json file containing this:
POST "https://pubsub.googleapis.com/v1beta2/{resource=projects/myproject/topics/mytopic}:setIamPolicy"
Content-type: application/json
{
"policy": {
"bindings": [{
"role": "roles/pubsub.publisher",
"members": ["serviceAccount:gmail-api-push@system.gserviceaccount.com"],
}],
}
}
as described here: http://developers.google.com/gmail/api/guides/push and call it like this: topics.SetIamPolicy('pubsub_policy.json');
- but setiampolicy is an undefined function. Any ideas? Googling has yielded absolutely nothing in terms of examples in node.js