listPartnerEventSources method

Future<ListPartnerEventSourcesResponse> listPartnerEventSources({
  1. required String namePrefix,
  2. int? limit,
  3. String? nextToken,
})

An SaaS partner can use this operation to list all the partner event source names that they have created. This operation is not used by AWS customers.

May throw InternalException. May throw OperationDisabledException.

Parameter namePrefix : If you specify this, the results are limited to only those partner event sources that start with the string you specify.

Parameter limit : pecifying 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 nextToken : The token returned by a previous call to this operation. Specifying this retrieves the next set of results.

Implementation

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

  return ListPartnerEventSourcesResponse.fromJson(jsonResponse.body);
}