describeSubscriptionFilters method

Future<DescribeSubscriptionFiltersResponse> describeSubscriptionFilters({
  1. required String logGroupName,
  2. String? filterNamePrefix,
  3. int? limit,
  4. String? nextToken,
})

Lists the subscription filters for the specified log group. You can list all the subscription filters or filter the results by prefix. The results are ASCII-sorted by filter name.

May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter logGroupName : The name of the log group.

Parameter filterNamePrefix : The prefix to match. If you don't specify a value, no prefix filter is applied.

Parameter limit : The maximum number of items returned. If you don't specify a value, the default is up to 50 items.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Implementation

Future<DescribeSubscriptionFiltersResponse> describeSubscriptionFilters({
  required String logGroupName,
  String? filterNamePrefix,
  int? limit,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(logGroupName, 'logGroupName');
  _s.validateStringLength(
    'logGroupName',
    logGroupName,
    1,
    512,
    isRequired: true,
  );
  _s.validateStringLength(
    'filterNamePrefix',
    filterNamePrefix,
    1,
    512,
  );
  _s.validateNumRange(
    'limit',
    limit,
    1,
    50,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.DescribeSubscriptionFilters'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'logGroupName': logGroupName,
      if (filterNamePrefix != null) 'filterNamePrefix': filterNamePrefix,
      if (limit != null) 'limit': limit,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return DescribeSubscriptionFiltersResponse.fromJson(jsonResponse.body);
}