File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
samples/basic_storage/functions Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 1
- """Basic Storage triggers example."""
1
+ """
2
+ Example Firebase Functions for Storage triggers.
3
+ """
2
4
3
5
from firebase_functions import storage
4
6
from firebase_functions .storage import StorageObjectData , CloudEvent
5
7
from firebase_admin import initialize_app
6
8
7
9
initialize_app ()
8
- BUCKET = "python-functions-testing.appspot.com"
9
10
10
11
11
- @storage .on_object_finalized (bucket = BUCKET )
12
+ @storage .on_object_finalized ()
12
13
def on_object_finalized_example (event : CloudEvent [StorageObjectData ]):
13
14
"""
14
15
This function will be triggered when a new object is created in the bucket.
15
16
"""
16
17
print (event )
17
18
18
19
19
- @storage .on_object_archived (bucket = BUCKET )
20
+ @storage .on_object_archived ()
20
21
def on_object_archived_example (event : CloudEvent [StorageObjectData ]):
21
22
"""
22
23
This function will be triggered when an object is archived in the bucket.
23
24
"""
24
25
print (event )
25
26
26
27
27
- @storage .on_object_deleted (bucket = BUCKET )
28
+ @storage .on_object_deleted ()
28
29
def on_object_deleted_example (event : CloudEvent [StorageObjectData ]):
29
30
"""
30
31
This function will be triggered when an object is deleted in the bucket.
31
32
"""
32
33
print (event )
33
34
34
35
35
- @storage .on_object_metadata_updated (bucket = BUCKET )
36
+ @storage .on_object_metadata_updated ()
36
37
def on_object_metadata_updated_example (event : CloudEvent [StorageObjectData ]):
37
38
"""
38
39
This function will be triggered when an object's metadata is updated in the bucket.
Original file line number Diff line number Diff line change 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:
4
4
./../../../
5
- # Switching to git upon deployment
5
+ # Or switch to git ref for deployment testing:
6
6
# git+https://github.com/firebase/firebase-functions-python.git@main#egg=firebase-functions
7
7
8
- firebase-admin >= 6.0.1
8
+ firebase-admin >= 6.0.1
You can’t perform that action at this time.
0 commit comments