firebase_functions.remote_config_fn module

Cloud functions to handle Remote Config events.

Classes

ConfigUpdateData

classfirebase_functions.remote_config_fn.ConfigUpdateData(version_number:int, update_time:datetime, update_user:ConfigUser, description:str, update_origin:ConfigUpdateOrigin, update_type:ConfigUpdateType, rollback_source:int|None=None)

Bases: object

The data within Firebase Remote Config update events.

description:str

The user-provided description of the corresponding Remote Config template.

rollback_source:int|None=None

Only present if this version is the result of a rollback, and is the version number of the Remote Config template that was rolled back to.

update_origin:ConfigUpdateOrigin

Where the update action originated.

update_time:datetime

When the Remote Config template was written to the Remote Config server.

update_type:ConfigUpdateType

What type of update was made.

update_user:ConfigUser

Aggregation of all metadata fields about the account that performed the update.

version_number:int

The version number of the version's corresponding Remote Config template.

ConfigUpdateOrigin

classfirebase_functions.remote_config_fn.ConfigUpdateOrigin(value)

Bases: str, Enum

Where the Remote Config update action originated.

ADMIN_SDK_NODE='ADMIN_SDK_NODE'

The update came from the Firebase Admin Node SDK.

CONSOLE='CONSOLE'

The update came from the Firebase UI.

REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED='REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED'

Catch-all for unrecognized values.

REST_API='REST_API'

The update came from the Remote Config REST API.

ConfigUpdateType

classfirebase_functions.remote_config_fn.ConfigUpdateType(value)

Bases: str, Enum

What type of update was associated with the Remote Config template version.

FORCED_UPDATE='FORCED_UPDATE'

A forced update. The ETag was specified as "*" in an UpdateRemoteConfigRequest request or the "Force Update" button was pressed on the console.

INCREMENTAL_UPDATE='INCREMENTAL_UPDATE'

A regular incremental update.

REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED='REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED'

Catch-all for unrecognized enum values.

ROLLBACK='ROLLBACK'

A rollback to a previous Remote Config template.

ConfigUser

classfirebase_functions.remote_config_fn.ConfigUser(name:str, email:str, image_url:str)

Bases: object

All the fields associated with the person/service account that wrote a Remote Config template.

email:str

Email address.

image_url:str

Image URL.

name:str

Display name.

Functions

on_config_updated

firebase_functions.remote_config_fn.on_config_updated(**kwargs)Callable[[Callable[[CloudEvent[ConfigUpdateData]],None]],Callable[[CloudEvent[ConfigUpdateData]],None]]

Event handler which triggers when data is updated in a Remote Config.

Example:

@on_config_updated()defexample(event:CloudEvent[ConfigUpdateData])->None:pass
Parameters:

**kwargs (as firebase_functions.options.EventHandlerOptions) -- Pub/Sub options.

Return type:

typing.Callable [ [ firebase_functions.core.CloudEvent [ firebase_functions.remote_config_fn.ConfigUpdateData [ typing.Any ] ] ], None ] A function that takes a CloudEvent and returns None.