Function Inputs
Overview of function inputs
In different scenarios, your functions might receive different inputs from CodeMash. Here are all the available scenarios when a certain input is passed to your function.
General form
In general, all of your functions will receive two parameters - event and context parameter. The event parameter is some kind of data depending on how a function was called. The context parameter is just some information about the function itself. Your function handler (entry function) might look like the following.
Where event is of the following form:
Function event input
As stated above, the event input parameter varies depending on how the function was invoked. The following shows all the different input forms.
Calling through API
When calling a function through an API call your event will have the following form.
Collection triggers
When the function is invoked from the collection trigger your event will have the following form.
User triggers
When the function is invoked from the user trigger your event input will have the following form.
The form of former and new users is as follows.
File triggers
When the function is invoked from the file trigger your event input will have the following form.
The form of a former and new file are as follows.
Last updated