describeQueryDefinitions method

Future<DescribeQueryDefinitionsResponse> describeQueryDefinitions({
  1. int? maxResults,
  2. String? nextToken,
  3. String? queryDefinitionNamePrefix,
})

This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions.

You can use the queryDefinitionNamePrefix parameter to limit the results to only the query definitions that have names that start with a certain string.

May throw InvalidParameterException. May throw ServiceUnavailableException.

Parameter maxResults : Limits the number of returned query definitions to the specified number.

Parameter queryDefinitionNamePrefix : Use this parameter to filter your results to only the query definitions that have names that start with the prefix you specify.

Implementation

Future<DescribeQueryDefinitionsResponse> describeQueryDefinitions({
  int? maxResults,
  String? nextToken,
  String? queryDefinitionNamePrefix,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'queryDefinitionNamePrefix',
    queryDefinitionNamePrefix,
    1,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.DescribeQueryDefinitions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (queryDefinitionNamePrefix != null)
        'queryDefinitionNamePrefix': queryDefinitionNamePrefix,
    },
  );

  return DescribeQueryDefinitionsResponse.fromJson(jsonResponse.body);
}