Functions to handle events from Google Cloud Storage.
Classes
CustomerEncryptionclass firebase_functions.storage_fn.CustomerEncryption(encryption_algorithm: str, key_sha256: str) |
---|
Bases: Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
|
StorageObjectDataclass firebase_functions.storage_fn.StorageObjectData(bucket: str, cache_control: str | None, component_count: int | None, content_disposition: str | None, content_encoding: str | None, content_language: str | None, content_type: str | None, crc32c: str | None, customer_encryption: CustomerEncryption | None, etag: str | None, generation: int, id: str, kind: str | None, md5_hash: str | None, media_link: str | None, metadata: dict[str, str] | None, metageneration: int, name: str, self_link: str | None, size: int, storage_class: str, time_created: str | None, time_deleted: str | None, time_storage_class_updated: str | None, updated: str | None) |
---|
Bases: An object within Google Cloud Storage.
|
Functions
on_object_archivedfirebase_functions.storage_fn.on_object_archived(**kwargs) Callable[[Callable[[CloudEvent[StorageObjectData]], None]], Callable[[CloudEvent[StorageObjectData]], None]] |
---|
Event handler sent only when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name. Example: @on_object_archived()
def example(event: CloudEvent[StorageObjectData]) -> None:
pass
|
on_object_deletedfirebase_functions.storage_fn.on_object_deleted(**kwargs) Callable[[Callable[[CloudEvent[StorageObjectData]], None]], Callable[[CloudEvent[StorageObjectData]], None]] |
---|
Event handler which fires every time a Google Cloud Storage deletion occurs. Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived, even if archival occurs via the storage.objects.delete method. Example: @on_object_deleted()
def example(event: CloudEvent[StorageObjectData]) -> None:
pass
|
on_object_finalizedfirebase_functions.storage_fn.on_object_finalized(**kwargs) Callable[[Callable[[CloudEvent[StorageObjectData]], None]], Callable[[CloudEvent[StorageObjectData]], None]] |
---|
Event handler which fires every time a Google Cloud Storage object creation occurs. Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event. Example: @on_object_finalized()
def example(event: CloudEvent[StorageObjectData]) -> None:
pass
|
on_object_metadata_updatedfirebase_functions.storage_fn.on_object_metadata_updated(**kwargs) Callable[[Callable[[CloudEvent[StorageObjectData]], None]], Callable[[CloudEvent[StorageObjectData]], None]] |
---|
Event handler which fires every time the metadata of an existing object changes. Example: @on_object_metadata_updated()
def example(event: CloudEvent[StorageObjectData]) -> None:
pass
|