deleteQueryDefinition method

Future<DeleteQueryDefinitionResponse> deleteQueryDefinition({
  1. required String queryDefinitionId,
})

Deletes a saved CloudWatch Logs Insights query definition. A query definition contains details about a saved CloudWatch Logs Insights query.

Each DeleteQueryDefinition operation can delete one query definition.

You must have the logs:DeleteQueryDefinition permission to be able to perform this operation.

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

Parameter queryDefinitionId : The ID of the query definition that you want to delete. You can use DescribeQueryDefinitions to retrieve the IDs of your saved query definitions.

Implementation

Future<DeleteQueryDefinitionResponse> deleteQueryDefinition({
  required String queryDefinitionId,
}) async {
  ArgumentError.checkNotNull(queryDefinitionId, 'queryDefinitionId');
  _s.validateStringLength(
    'queryDefinitionId',
    queryDefinitionId,
    0,
    256,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.DeleteQueryDefinition'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'queryDefinitionId': queryDefinitionId,
    },
  );

  return DeleteQueryDefinitionResponse.fromJson(jsonResponse.body);
}