getFlowTemplate method

Future<GetFlowTemplateResponse> getFlowTemplate({
  1. required String id,
  2. int? revisionNumber,
})

Gets the latest version of the DefinitionDocument and FlowTemplateSummary for the specified workflow.

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 revisionNumber : The number of the workflow revision to retrieve.

Implementation

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

  return GetFlowTemplateResponse.fromJson(jsonResponse.body);
}