-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
174 additions
and
1,419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
# Welcome to Cloud Functions for Firebase for Python! | ||
# To get started, simply uncomment the below code or create your own. | ||
# Deploy with `firebase deploy` | ||
|
||
from firebase_admin import initialize_app | ||
from v2.firestore_tests import * | ||
|
||
initialize_app() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,67 @@ | ||
from firebase_admin import firestore | ||
from firebase_functions import firestore_fn, logger | ||
from integration_tests.functions.region import REGION | ||
from region import REGION | ||
|
||
|
||
@firestore_fn.on_document_created(document='tests/{documentId}', region=REGION, timeout_sec=540) | ||
def firestoreOnDocumentCreatedTests(event: firestore_fn.Event[firestore_fn.DocumentSnapshot]): | ||
logger.debug(event=event) | ||
@firestore_fn.on_document_created(document='tests/{documentId}', | ||
region=REGION, | ||
timeout_sec=540) | ||
def firestoreOnDocumentCreatedTests( | ||
event: firestore_fn.Event[firestore_fn.DocumentSnapshot]): | ||
documentId = event.params['documentId'] | ||
|
||
firestore.client().collection('firestoreOnDocumentCreatedTests').document(documentId).set({ | ||
'time': event.time, | ||
'id': event.id, | ||
'type': event.type, | ||
'source': event.source, | ||
}) | ||
firestore.client().collection('firestoreOnDocumentCreatedTests').document( | ||
documentId).set({ | ||
'time': event.time, | ||
'id': event.id, | ||
'type': event.type, | ||
'source': event.source, | ||
}) | ||
|
||
|
||
@firestore_fn.on_document_deleted(document='tests/{documentId}', region=REGION, timeout_sec=540) | ||
def firestoreOnDocumentDeletedTests(event: firestore_fn.Event[firestore_fn.DocumentSnapshot]): | ||
logger.debug(event=event) | ||
@firestore_fn.on_document_deleted(document='tests/{documentId}', | ||
region=REGION, | ||
timeout_sec=540) | ||
def firestoreOnDocumentDeletedTests( | ||
event: firestore_fn.Event[firestore_fn.DocumentSnapshot]): | ||
documentId = event.params['documentId'] | ||
|
||
firestore.client().collection('firestoreOnDocumentDeletedTests').document(documentId).set({ | ||
'time': event.time, | ||
'id': event.id, | ||
'type': event.type, | ||
'source': event.source, | ||
}) | ||
firestore.client().collection('firestoreOnDocumentDeletedTests').document( | ||
documentId).set({ | ||
'time': event.time, | ||
'id': event.id, | ||
'type': event.type, | ||
'source': event.source, | ||
}) | ||
|
||
|
||
@firestore_fn.on_document_updated(document='tests/{documentId}', region=REGION, timeout_sec=540) | ||
def firestoreOnDocumentUpdatedTests(event: firestore_fn.Event[firestore_fn.DocumentSnapshot]): | ||
logger.debug(event=event) | ||
@firestore_fn.on_document_updated(document='tests/{documentId}', | ||
region=REGION, | ||
timeout_sec=540) | ||
def firestoreOnDocumentUpdatedTests( | ||
event: firestore_fn.Event[firestore_fn.DocumentSnapshot]): | ||
documentId = event.params['documentId'] | ||
|
||
firestore.client().collection('firestoreOnDocumentUpdatedTests').document(documentId).set({ | ||
'time': event.time, | ||
'id': event.id, | ||
'type': event.type, | ||
'source': event.source, | ||
}) | ||
firestore.client().collection('firestoreOnDocumentUpdatedTests').document( | ||
documentId).set({ | ||
'time': event.time, | ||
'id': event.id, | ||
'type': event.type, | ||
'source': event.source, | ||
}) | ||
|
||
|
||
@firestore_fn.on_document_written(document='tests/{documentId}', region=REGION, timeout_sec=540) | ||
def firestoreOnDocumentWrittenTests(event: firestore_fn.Event[firestore_fn.DocumentSnapshot]): | ||
logger.debug(event=event) | ||
@firestore_fn.on_document_written(document='tests/{documentId}', | ||
region=REGION, | ||
timeout_sec=540) | ||
def firestoreOnDocumentWrittenTests( | ||
event: firestore_fn.Event[firestore_fn.DocumentSnapshot]): | ||
documentId = event.params['documentId'] | ||
|
||
firestore.client().collection('firestoreOnDocumentWrittenTests').document(documentId).set({ | ||
'time': event.time, | ||
'id': event.id, | ||
'type': event.type, | ||
'source': event.source, | ||
}) | ||
firestore.client().collection('firestoreOnDocumentWrittenTests').document( | ||
documentId).set({ | ||
'time': event.time, | ||
'id': event.id, | ||
'type': event.type, | ||
'source': event.source, | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.