We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0dd8f5d commit ba7f87cCopy full SHA for ba7f87c
1 file changed
docs/pubsub-usage.rst
@@ -66,7 +66,7 @@ Delete a topic:
66
>>> topic = client.topic('topic_name')
67
>>> topic.delete() # API request
68
69
-Update the IAM policy for a topic:
+Fetch the IAM policy for a topic:
70
71
.. doctest::
72
@@ -82,6 +82,15 @@ Update the IAM policy for a topic:
82
['systemAccount:abc-1234@systemaccounts.example.com']
83
>>> policy.readers
84
['domain:example.com']
85
+
86
+Update the IAM policy for a topic:
87
88
+.. doctest::
89
90
+ >>> from gcloud import pubsub
91
+ >>> client = pubsub.Client()
92
+ >>> topic = client.topic('topic_name')
93
+ >>> policy = topic.get_iam_policy() # API request
94
>>> policy.writers.add(policy.group('editors-list@example.com'))
95
>>> topic.set_iam_policy(policy) # API request
96
0 commit comments