-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Adding PubSub Notification Samples #1317
Conversation
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
Warning: This pull request is touching the following templated files:
|
125c5a1
to
6d92957
Compare
samples/snippets/src/main/java/com/example/storage/bucket/DeleteBucketPubSubNotification.java
Outdated
Show resolved
Hide resolved
samples/snippets/src/main/java/com/example/storage/bucket/ListPubSubNotifications.java
Show resolved
Hide resolved
samples/snippets/src/main/java/com/example/storage/bucket/CreateBucketPubSubNotification.java
Outdated
Show resolved
Hide resolved
044a3fd
to
ddc4c5c
Compare
5ff03b3
to
584abff
Compare
4c3fd41
to
f790f1d
Compare
5ed7f2b
to
9022a7c
Compare
e8acf42
to
ab6979b
Compare
5943cc4
to
ddbc554
Compare
Storage storage = StorageOptions.newBuilder().build().getService(); | ||
NotificationInfo notificationInfo = | ||
NotificationInfo.newBuilder(topicName) | ||
.setEtag(etag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
etag should be set by the service and shouldn't be set by a user directly unless performing an update request.
I would most likely leave this value out.
NotificationInfo.newBuilder(topicName) | ||
.setEtag(etag) | ||
.setCustomAttributes(customAttributes) | ||
.setSelfLink(selfLink) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
selfLink() should be set by the service; this field setter shouldn't need to be public.
ec70866
to
acb0115
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @sydney-munro!
Fixes internal issues:
storage_print_pubsub_bucket_notification b/219957979
storage_delete_bucket_notification b/219958287
storage_list_bucket_notifications b/219958499
storage_create_bucket_notifications b/219958206
If you write sample code, please follow the samples format.