invokeAsync method

Future<InvokeAsyncResponse> invokeAsync({
  1. required String functionName,
  2. required Uint8List invokeArgs,
})
Invokes a function asynchronously.

May throw InvalidRequestContentException. May throw InvalidRuntimeException. May throw ResourceConflictException. May throw ResourceNotFoundException. May throw ServiceException.

Parameter functionName : The name or ARN of the Lambda function.

Name formats

  • Function namemy-function.
  • Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.
  • Partial ARN123456789012:function:my-function.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.

Parameter invokeArgs : The JSON that you want to provide to your Lambda function as input.

Implementation

Future<InvokeAsyncResponse> invokeAsync({
  required String functionName,
  required Uint8List invokeArgs,
}) async {
  final response = await _protocol.send(
    payload: invokeArgs,
    method: 'POST',
    requestUri:
        '/2014-11-13/functions/${Uri.encodeComponent(functionName)}/invoke-async',
    exceptionFnMap: _exceptionFns,
  );
  return InvokeAsyncResponse.fromJson(response);
}