listEventSources method

Future<ListEventSourcesResponse> listEventSources({
  1. String? eventSourceArn,
  2. String? functionName,
  3. String? marker,
  4. int? maxItems,
})

Returns a list of event source mappings you created using the AddEventSource (see AddEventSource), where you identify a stream as event source. This list does not include Amazon S3 event sources.

For each mapping, the API returns configuration information. You can optionally specify filters to retrieve specific event source mappings.

This operation requires permission for the lambda:ListEventSources action.

May throw ServiceException. May throw ResourceNotFoundException. May throw InvalidParameterValueException.

Parameter eventSourceArn : The Amazon Resource Name (ARN) of the Amazon Kinesis stream.

Parameter functionName : The name of the AWS Lambda function.

Parameter marker : Optional string. An opaque pagination token returned from a previous ListEventSources operation. If present, specifies to continue the list from where the returning call left off.

Parameter maxItems : Optional integer. Specifies the maximum number of event sources to return in response. This value must be greater than 0.

Implementation

Future<ListEventSourcesResponse> listEventSources({
  String? eventSourceArn,
  String? functionName,
  String? marker,
  int? maxItems,
}) async {
  _s.validateStringLength(
    'functionName',
    functionName,
    1,
    64,
  );
  _s.validateNumRange(
    'maxItems',
    maxItems,
    1,
    10000,
  );
  final $query = <String, List<String>>{
    if (eventSourceArn != null) 'EventSource': [eventSourceArn],
    if (functionName != null) 'FunctionName': [functionName],
    if (marker != null) 'Marker': [marker],
    if (maxItems != null) 'MaxItems': [maxItems.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/2014-11-13/event-source-mappings/',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListEventSourcesResponse.fromJson(response);
}