Context API

When a Cloud Function is called, it takes an instance of the FunctionContext class as its first function argument, see the example below.

from ixoncdkingress.function.context import FunctionContext

@FunctionContext.expose
def hello_world(context: FunctionContext, **kwargs: dict[str, str]):
    return {
        'message': 'Hello World'
    }

The context instance can provide a Cloud Function with data and application-wide functionality through a number of different properties and methods.