putStoredQuery method

Future<PutStoredQueryResponse> putStoredQuery({
  1. required StoredQuery storedQuery,
  2. List<Tag>? tags,
})

Saves a new query or updates an existing saved query. The QueryName must be unique for an AWS account in an AWS Region. You can create upto 300 queries in an AWS account in an AWS Region.

May throw ValidationException. May throw TooManyTagsException. May throw ResourceConcurrentModificationException.

Parameter storedQuery : A list of StoredQuery objects. The mandatory fields are QueryName and Expression.

Parameter tags : A list of Tags object.

Implementation

Future<PutStoredQueryResponse> putStoredQuery({
  required StoredQuery storedQuery,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(storedQuery, 'storedQuery');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.PutStoredQuery'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'StoredQuery': storedQuery,
      if (tags != null) 'Tags': tags,
    },
  );

  return PutStoredQueryResponse.fromJson(jsonResponse.body);
}