File tree Expand file tree Collapse file tree
google-cloud-examples/src/main/java/com/google/cloud/examples/pubsub/snippets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ public Policy getSubscriptionPolicy(String subscriptionId) throws Exception {
151151
152152 /** Example of replacing a subscription policy. */
153153 public Policy replaceSubscriptionPolicy (String subscriptionId ) throws Exception {
154- // [START pubsub_update_subscription_policy ]
154+ // [START pubsub_set_subscription_policy ]
155155 try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient .create ()) {
156156 SubscriptionName subscriptionName = SubscriptionName .create (projectId , subscriptionId );
157157 Policy policy = subscriptionAdminClient .getIamPolicy (subscriptionName .toString ());
@@ -167,7 +167,7 @@ public Policy replaceSubscriptionPolicy(String subscriptionId) throws Exception
167167 updatedPolicy = subscriptionAdminClient .setIamPolicy (subscriptionName .toString (), updatedPolicy );
168168 return updatedPolicy ;
169169 }
170- // [END pubsub_update_subscription_policy ]
170+ // [END pubsub_set_subscription_policy ]
171171 }
172172
173173 /** Example of testing whether the caller has the provided permissions on a subscription. */
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ public Policy getTopicPolicy(String topicId) throws Exception {
125125
126126 /** Example of replacing a topic policy. */
127127 public Policy replaceTopicPolicy (String topicId ) throws Exception {
128- // [START pubsub_update_topic_policy ]
128+ // [START pubsub_set_topic_policy ]
129129 try (TopicAdminClient topicAdminClient = TopicAdminClient .create ()) {
130130 String topicName = TopicName .create (projectId , topicId ).toString ();
131131 Policy policy = topicAdminClient .getIamPolicy (topicName );
@@ -140,7 +140,7 @@ public Policy replaceTopicPolicy(String topicId) throws Exception {
140140 updatedPolicy = topicAdminClient .setIamPolicy (topicName , updatedPolicy );
141141 return updatedPolicy ;
142142 }
143- // [END pubsub_update_topic_policy ]
143+ // [END pubsub_set_topic_policy ]
144144 }
145145
146146 /** Example of testing whether the caller has the provided permissions on a topic.
You can’t perform that action at this time.
0 commit comments