getSystemTemplateRevisions method

Future<GetSystemTemplateRevisionsResponse> getSystemTemplateRevisions({
  1. required String id,
  2. int? maxResults,
  3. String? nextToken,
})

Gets revisions made to the specified system template. Only the previous 100 revisions are stored. If the system has been deprecated, this action will return the revisions that occurred before its deprecation. This action won't work with systems that have been deleted.

May throw InvalidRequestException. May throw ThrottlingException. May throw InternalFailureException. May throw ResourceNotFoundException.

Parameter id : The ID of the system template.

The ID should be in the following format.

urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME

Parameter maxResults : The maximum number of results to return in the response.

Parameter nextToken : The string that specifies the next page of results. Use this when you're paginating results.

Implementation

Future<GetSystemTemplateRevisionsResponse> getSystemTemplateRevisions({
  required String id,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  _s.validateStringLength(
    'id',
    id,
    0,
    160,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'IotThingsGraphFrontEndService.GetSystemTemplateRevisions'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'id': id,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return GetSystemTemplateRevisionsResponse.fromJson(jsonResponse.body);
}