describeQuery method

Future<DescribeQueryResponse> describeQuery({
  1. String? eventDataStore,
  2. String? eventDataStoreOwnerAccountId,
  3. String? queryAlias,
  4. String? queryId,
  5. String? refreshId,
})

Returns metadata about a query, including query run time in milliseconds, number of events scanned and matched, and query status. If the query results were delivered to an S3 bucket, the response also provides the S3 URI and the delivery status.

You must specify either QueryId or QueryAlias. Specifying the QueryAlias parameter returns information about the last query run for the alias. You can provide RefreshId along with QueryAlias to view the query results of a dashboard query for the specified RefreshId.

May throw EventDataStoreARNInvalidException. May throw EventDataStoreNotFoundException. May throw InactiveEventDataStoreException. May throw InvalidParameterException. May throw NoManagementAccountSLRExistsException. May throw OperationNotPermittedException. May throw QueryIdNotFoundException. May throw UnsupportedOperationException.

Parameter eventDataStore : The ARN (or the ID suffix of the ARN) of an event data store on which the specified query was run.

Parameter eventDataStoreOwnerAccountId : The account ID of the event data store owner.

Parameter queryAlias : The alias that identifies a query template.

Parameter queryId : The query ID.

Parameter refreshId : The ID of the dashboard refresh.

Implementation

Future<DescribeQueryResponse> describeQuery({
  String? eventDataStore,
  String? eventDataStoreOwnerAccountId,
  String? queryAlias,
  String? queryId,
  String? refreshId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CloudTrail_20131101.DescribeQuery'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (eventDataStore != null) 'EventDataStore': eventDataStore,
      if (eventDataStoreOwnerAccountId != null)
        'EventDataStoreOwnerAccountId': eventDataStoreOwnerAccountId,
      if (queryAlias != null) 'QueryAlias': queryAlias,
      if (queryId != null) 'QueryId': queryId,
      if (refreshId != null) 'RefreshId': refreshId,
    },
  );

  return DescribeQueryResponse.fromJson(jsonResponse.body);
}