2626function listSubscriptions ( ) {
2727 // [START pubsub_list_subscriptions]
2828 // Imports the Google Cloud client library
29- const PubSub = require ( ` @google-cloud/pubsub` ) ;
29+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
3030
3131 // Creates a client
3232 const pubsub = new PubSub ( ) ;
@@ -49,7 +49,7 @@ function listSubscriptions() {
4949function listTopicSubscriptions ( topicName ) {
5050 // [START pubsub_list_topic_subscriptions]
5151 // Imports the Google Cloud client library
52- const PubSub = require ( ` @google-cloud/pubsub` ) ;
52+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
5353
5454 // Creates a client
5555 const pubsub = new PubSub ( ) ;
@@ -78,7 +78,7 @@ function listTopicSubscriptions(topicName) {
7878function createSubscription ( topicName , subscriptionName ) {
7979 // [START pubsub_create_pull_subscription]
8080 // Imports the Google Cloud client library
81- const PubSub = require ( ` @google-cloud/pubsub` ) ;
81+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
8282
8383 // Creates a client
8484 const pubsub = new PubSub ( ) ;
@@ -111,7 +111,7 @@ function createFlowControlledSubscription(
111111) {
112112 // [START pubsub_subscriber_flow_settings]
113113 // Imports the Google Cloud client library
114- const PubSub = require ( ` @google-cloud/pubsub` ) ;
114+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
115115
116116 // Creates a client
117117 const pubsub = new PubSub ( ) ;
@@ -159,7 +159,7 @@ function createFlowControlledSubscription(
159159function createPushSubscription ( topicName , subscriptionName ) {
160160 // [START pubsub_create_push_subscription]
161161 // Imports the Google Cloud client library
162- const PubSub = require ( ` @google-cloud/pubsub` ) ;
162+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
163163
164164 // Creates a client
165165 const pubsub = new PubSub ( ) ;
@@ -195,7 +195,7 @@ function createPushSubscription(topicName, subscriptionName) {
195195function modifyPushConfig ( topicName , subscriptionName ) {
196196 // [START pubsub_update_push_configuration]
197197 // Imports the Google Cloud client library
198- const PubSub = require ( ` @google-cloud/pubsub` ) ;
198+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
199199
200200 // Creates a client
201201 const pubsub = new PubSub ( ) ;
@@ -228,7 +228,7 @@ function modifyPushConfig(topicName, subscriptionName) {
228228function deleteSubscription ( subscriptionName ) {
229229 // [START pubsub_delete_subscription]
230230 // Imports the Google Cloud client library
231- const PubSub = require ( ` @google-cloud/pubsub` ) ;
231+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
232232
233233 // Creates a client
234234 const pubsub = new PubSub ( ) ;
@@ -253,7 +253,7 @@ function deleteSubscription(subscriptionName) {
253253
254254function getSubscription ( subscriptionName ) {
255255 // Imports the Google Cloud client library
256- const PubSub = require ( ` @google-cloud/pubsub` ) ;
256+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
257257
258258 // Creates a client
259259 const pubsub = new PubSub ( ) ;
@@ -284,7 +284,7 @@ function listenForMessages(subscriptionName, timeout) {
284284 // [START pubsub_subscriber_async_pull]
285285 // [START pubsub_quickstart_subscriber]
286286 // Imports the Google Cloud client library
287- const PubSub = require ( ` @google-cloud/pubsub` ) ;
287+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
288288
289289 // Creates a client
290290 const pubsub = new PubSub ( ) ;
@@ -441,7 +441,7 @@ const outstandingMessages = {};
441441
442442function listenForOrderedMessages ( subscriptionName , timeout ) {
443443 // Imports the Google Cloud client library
444- const PubSub = require ( ` @google-cloud/pubsub` ) ;
444+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
445445
446446 // Creates a client
447447 const pubsub = new PubSub ( ) ;
@@ -504,7 +504,7 @@ function listenForOrderedMessages(subscriptionName, timeout) {
504504function listenForErrors ( subscriptionName , timeout ) {
505505 // [START pubsub_subscriber_error_listener]
506506 // Imports the Google Cloud client library
507- const PubSub = require ( ` @google-cloud/pubsub` ) ;
507+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
508508
509509 // Creates a client
510510 const pubsub = new PubSub ( ) ;
@@ -547,7 +547,7 @@ function listenForErrors(subscriptionName, timeout) {
547547function getSubscriptionPolicy ( subscriptionName ) {
548548 // [START pubsub_get_subscription_policy]
549549 // Imports the Google Cloud client library
550- const PubSub = require ( ` @google-cloud/pubsub` ) ;
550+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
551551
552552 // Creates a client
553553 const pubsub = new PubSub ( ) ;
@@ -574,7 +574,7 @@ function getSubscriptionPolicy(subscriptionName) {
574574function setSubscriptionPolicy ( subscriptionName ) {
575575 // [START pubsub_set_subscription_policy]
576576 // Imports the Google Cloud client library
577- const PubSub = require ( ` @google-cloud/pubsub` ) ;
577+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
578578
579579 // Creates a client
580580 const pubsub = new PubSub ( ) ;
@@ -620,7 +620,7 @@ function setSubscriptionPolicy(subscriptionName) {
620620function testSubscriptionPermissions ( subscriptionName ) {
621621 // [START pubsub_test_subscription_permissions]
622622 // Imports the Google Cloud client library
623- const PubSub = require ( ` @google-cloud/pubsub` ) ;
623+ const { PubSub} = require ( ' @google-cloud/pubsub' ) ;
624624
625625 // Creates a client
626626 const pubsub = new PubSub ( ) ;
0 commit comments