invokeAsync method

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

May throw EC2AccessDeniedException. May throw EC2ThrottledException. May throw EC2UnexpectedException. May throw EFSIOException. May throw EFSMountConnectivityException. May throw EFSMountFailureException. May throw EFSMountTimeoutException. May throw ENILimitReachedException. May throw InvalidRequestContentException. May throw InvalidRuntimeException. May throw InvalidSecurityGroupIDException. May throw InvalidSubnetIDException. May throw KMSAccessDeniedException. May throw KMSDisabledException. May throw KMSInvalidStateException. May throw KMSNotFoundException. May throw ModeNotSupportedException. May throw ResourceConflictException. May throw ResourceNotFoundException. May throw S3FilesMountConnectivityException. May throw S3FilesMountFailureException. May throw S3FilesMountTimeoutException. May throw ServiceException. May throw ServiceQuotaExceededException. May throw SnapStartException. May throw SnapStartNotReadyException. May throw SnapStartRegenerationFailureException. May throw SnapStartTimeoutException. May throw SubnetIPAddressLimitReachedException.

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

Name formats

  • Function name – my-function.
  • Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function.
  • Partial ARN – 123456789012: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);
}