Skip to content

Commit d65f464

Browse files
committed
refactor: update storage sample
1 parent d8c3db7 commit d65f464

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

samples/basic_storage/functions/main.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
1-
"""Basic Storage triggers example."""
1+
"""
2+
Example Firebase Functions for Storage triggers.
3+
"""
24

35
from firebase_functions import storage
46
from firebase_functions.storage import StorageObjectData, CloudEvent
57
from firebase_admin import initialize_app
68

79
initialize_app()
8-
BUCKET = "python-functions-testing.appspot.com"
910

1011

11-
@storage.on_object_finalized(bucket=BUCKET)
12+
@storage.on_object_finalized()
1213
def on_object_finalized_example(event: CloudEvent[StorageObjectData]):
1314
"""
1415
This function will be triggered when a new object is created in the bucket.
1516
"""
1617
print(event)
1718

1819

19-
@storage.on_object_archived(bucket=BUCKET)
20+
@storage.on_object_archived()
2021
def on_object_archived_example(event: CloudEvent[StorageObjectData]):
2122
"""
2223
This function will be triggered when an object is archived in the bucket.
2324
"""
2425
print(event)
2526

2627

27-
@storage.on_object_deleted(bucket=BUCKET)
28+
@storage.on_object_deleted()
2829
def on_object_deleted_example(event: CloudEvent[StorageObjectData]):
2930
"""
3031
This function will be triggered when an object is deleted in the bucket.
3132
"""
3233
print(event)
3334

3435

35-
@storage.on_object_metadata_updated(bucket=BUCKET)
36+
@storage.on_object_metadata_updated()
3637
def on_object_metadata_updated_example(event: CloudEvent[StorageObjectData]):
3738
"""
3839
This function will be triggered when an object's metadata is updated in the bucket.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# firebase-functions-python
2-
3-
# Relative path during development
1+
# Not published yet,
2+
# firebase-functions-python >= 0.0.1
3+
# so we use a relative path during development:
44
./../../../
5-
# Switching to git upon deployment
5+
# Or switch to git ref for deployment testing:
66
# git+https://github.com/firebase/firebase-functions-python.git@main#egg=firebase-functions
77

8-
firebase-admin >= 6.0.1
8+
firebase-admin >= 6.0.1

0 commit comments

Comments
 (0)