1+ // Copyright 2021 Google Inc.
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ // [START storage_print_pubsub_bucket_notification]
16+
17+
18+ using System ;
19+ using Google . Cloud . Storage . V1 ;
20+ using Google . Apis . Storage . v1 . Data ;
21+
22+ public class GetPubSubNotificationSample
23+ {
24+ public Notification GetPubSubNotification (
25+ string bucketName = "your-unique-bucket-name" ,
26+ string notificationId = "notification-Id" )
27+ {
28+ var storage = StorageClient . Create ( ) ;
29+ var notification = storage . GetNotification ( bucketName , notificationId ) ;
30+
31+ Console . WriteLine ( "ID: " + notification . Id ) ;
32+ Console . WriteLine ( "Topic: " + notification . Topic ) ;
33+ Console . WriteLine ( "EventTypes: " + notification . EventTypes ) ;
34+ Console . WriteLine ( "CustomAttributes: " + notification . CustomAttributes ) ;
35+ Console . WriteLine ( "PayloadFormat: " + notification . PayloadFormat ) ;
36+ Console . WriteLine ( "ObjectNamePrefix: " + notification . ObjectNamePrefix ) ;
37+ Console . WriteLine ( "ETag: " + notification . ETag ) ;
38+ Console . WriteLine ( "SelfLink: " + notification . SelfLink ) ;
39+ Console . WriteLine ( "Kind: " + notification . Kind ) ;
40+
41+ return notification ;
42+ }
43+ }
44+
45+
46+ // [END storage_print_pubsub_bucket_notification]
0 commit comments