getFlowTemplateRevisions method

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

Gets revisions of the specified workflow. Only the last 100 revisions are stored. If the workflow has been deprecated, this action will return revisions that occurred before the deprecation. This action won't work for workflows that have been deleted.

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

Parameter id : The ID of the workflow.

The ID should be in the following format.

urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME

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<GetFlowTemplateRevisionsResponse> getFlowTemplateRevisions({
  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.GetFlowTemplateRevisions'
  };
  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 GetFlowTemplateRevisionsResponse.fromJson(jsonResponse.body);
}