listEventBuses method

Future<ListEventBusesResponse> listEventBuses({
  1. int? limit,
  2. String? namePrefix,
  3. String? nextToken,
})

Lists all the event buses in your account, including the default event bus, custom event buses, and partner event buses.

May throw InternalException.

Parameter limit : Specifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.

Parameter namePrefix : Specifying this limits the results to only those event buses with names that start with the specified prefix.

Parameter nextToken : The token returned by a previous call to retrieve the next set of results.

Implementation

Future<ListEventBusesResponse> listEventBuses({
  int? limit,
  String? namePrefix,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    100,
  );
  _s.validateStringLength(
    'namePrefix',
    namePrefix,
    1,
    256,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSEvents.ListEventBuses'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (limit != null) 'Limit': limit,
      if (namePrefix != null) 'NamePrefix': namePrefix,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListEventBusesResponse.fromJson(jsonResponse.body);
}