createExecution method

Future<Execution> createExecution({
  1. required String functionId,
  2. String? data,
  3. bool? xasync,
})

Create Execution

Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.

Implementation

Future<models.Execution> createExecution(
    {required String functionId, String? data, bool? xasync}) async {
  final String path = '/functions/{functionId}/executions'
      .replaceAll('{functionId}', functionId);

  final Map<String, dynamic> params = {
    'data': data,
    'async': xasync,
  };

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.post,
      path: path, params: params, headers: headers);

  return models.Execution.fromMap(res.data);
}