prepareQuery method

Future<PrepareQueryResponse> prepareQuery({
  1. required String queryString,
  2. bool? validateOnly,
})

A synchronous operation that allows you to submit a query with parameters to be stored by Timestream for later running. Timestream only supports using this operation with ValidateOnly set to true.

May throw AccessDeniedException. May throw InternalServerException. May throw InvalidEndpointException. May throw ThrottlingException. May throw ValidationException.

Parameter queryString : The Timestream query string that you want to use as a prepared statement. Parameter names can be specified in the query string @ character followed by an identifier.

Parameter validateOnly : By setting this value to true, Timestream will only validate that the query string is a valid Timestream query, and not store the prepared query for later use.

Implementation

Future<PrepareQueryResponse> prepareQuery({
  required String queryString,
  bool? validateOnly,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'Timestream_20181101.PrepareQuery'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'QueryString': queryString,
      if (validateOnly != null) 'ValidateOnly': validateOnly,
    },
  );

  return PrepareQueryResponse.fromJson(jsonResponse.body);
}