@@ -88,7 +88,7 @@ class Event(_core.CloudEvent[_core.T]):
88
88
_C2 = _typing .Callable [[_E2 ], None ]
89
89
90
90
AuthType = _typing .Literal ["service_account" , "api_key" , "system" ,
91
- "unauthenticated" , "unknown" ]
91
+ "unauthenticated" , "unknown" ]
92
92
93
93
94
94
@_dataclass .dataclass (frozen = True )
@@ -106,10 +106,10 @@ class EventWithAuthContext(Event[_core.T]):
106
106
107
107
108
108
def _firestore_endpoint_handler (
109
- func : _C1 | _C2 | _C3 | _C4 ,
110
- event_type : str ,
111
- document_pattern : _path_pattern .PathPattern ,
112
- raw : _ce .CloudEvent ,
109
+ func : _C1 | _C2 | _C3 | _C4 ,
110
+ event_type : str ,
111
+ document_pattern : _path_pattern .PathPattern ,
112
+ raw : _ce .CloudEvent ,
113
113
) -> None :
114
114
event_attributes = raw ._get_attributes ()
115
115
event_data : _typing .Any = raw .get_data ()
@@ -190,22 +190,22 @@ def _firestore_endpoint_handler(
190
190
}
191
191
192
192
common_event_kwargs = {
193
- ' project' : event_project ,
194
- ' namespace' : event_namespace ,
195
- ' database' : event_database ,
196
- ' location' : event_location ,
197
- ' document' : event_document ,
198
- ' specversion' : event_attributes ["specversion" ],
199
- 'id' : event_attributes ["id" ],
200
- ' source' : event_attributes ["source" ],
201
- ' type' : event_attributes ["type" ],
202
- ' time' : event_time ,
203
- ' data' : firestore_event_data ,
204
- ' subject' : event_attributes ["subject" ],
205
- ' params' : params ,
193
+ " project" : event_project ,
194
+ " namespace" : event_namespace ,
195
+ " database" : event_database ,
196
+ " location" : event_location ,
197
+ " document" : event_document ,
198
+ " specversion" : event_attributes ["specversion" ],
199
+ "id" : event_attributes ["id" ],
200
+ " source" : event_attributes ["source" ],
201
+ " type" : event_attributes ["type" ],
202
+ " time" : event_time ,
203
+ " data" : firestore_event_data ,
204
+ " subject" : event_attributes ["subject" ],
205
+ " params" : params ,
206
206
}
207
207
208
- if event_type .endswith (' .withAuthContext' ):
208
+ if event_type .endswith (" .withAuthContext" ):
209
209
database_event_with_auth_context = EventWithAuthContext (
210
210
** common_event_kwargs ,
211
211
auth_type = event_auth_type ,
@@ -267,10 +267,11 @@ def on_document_written_wrapped(raw: _ce.CloudEvent):
267
267
268
268
@_util .copy_func_kwargs (FirestoreOptions )
269
269
def on_document_written_with_auth_context (** kwargs
270
- ) -> _typing .Callable [[_C1 ], _C1 ]:
270
+ ) -> _typing .Callable [[_C1 ], _C1 ]:
271
271
"""
272
272
Event handler that triggers when a document is created, updated, or deleted in Firestore.
273
- This trigger will also provide the authentication context of the principal who triggered the event.
273
+ This trigger will also provide the authentication context of the principal who triggered
274
+ the event.
274
275
275
276
Example:
276
277
@@ -365,10 +366,11 @@ def on_document_updated_wrapped(raw: _ce.CloudEvent):
365
366
366
367
@_util .copy_func_kwargs (FirestoreOptions )
367
368
def on_document_updated_with_auth_context (** kwargs
368
- ) -> _typing .Callable [[_C1 ], _C1 ]:
369
+ ) -> _typing .Callable [[_C1 ], _C1 ]:
369
370
"""
370
371
Event handler that triggers when a document is updated in Firestore.
371
- This trigger will also provide the authentication context of the principal who triggered the event.
372
+ This trigger will also provide the authentication context of the principal who triggered
373
+ the event.
372
374
373
375
Example:
374
376
@@ -463,10 +465,11 @@ def on_document_created_wrapped(raw: _ce.CloudEvent):
463
465
464
466
@_util .copy_func_kwargs (FirestoreOptions )
465
467
def on_document_created_with_auth_context (** kwargs
466
- ) -> _typing .Callable [[_C2 ], _C2 ]:
468
+ ) -> _typing .Callable [[_C2 ], _C2 ]:
467
469
"""
468
470
Event handler that triggers when a document is created in Firestore.
469
- This trigger will also provide the authentication context of the principal who triggered the event.
471
+ This trigger will also provide the authentication context of the principal who triggered
472
+ the event.
470
473
471
474
Example:
472
475
@@ -561,10 +564,11 @@ def on_document_deleted_wrapped(raw: _ce.CloudEvent):
561
564
562
565
@_util .copy_func_kwargs (FirestoreOptions )
563
566
def on_document_deleted_with_auth_context (** kwargs
564
- ) -> _typing .Callable [[_C2 ], _C2 ]:
567
+ ) -> _typing .Callable [[_C2 ], _C2 ]:
565
568
"""
566
569
Event handler that triggers when a document is deleted in Firestore.
567
- This trigger will also provide the authentication context of the principal who triggered the event.
570
+ This trigger will also provide the authentication context of the principal who triggered
571
+ the event.
568
572
569
573
Example:
570
574
0 commit comments