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 a single Amazon Web Services account and a single Amazon Web Services Region. You can create upto 300 queries in a single Amazon Web Services account and a single Amazon Web Services Region.

PutStoredQuery is an idempotent API. Subsequent requests won’t create a duplicate resource if one was already created. If a following request has different tags values, Config will ignore these differences and treat it as an idempotent request of the previous. In this case, tags will not be updated, even if they are different.

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

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 {
  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);
}