updateSystemTemplate method

Future<UpdateSystemTemplateResponse> updateSystemTemplate({
  1. required DefinitionDocument definition,
  2. required String id,
  3. int? compatibleNamespaceVersion,
})

Updates the specified system. You don't need to run this action after updating a workflow. Any deployment that uses the system will see the changes in the system when it is redeployed.

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

Parameter definition : The DefinitionDocument that contains the updated system definition.

Parameter id : The ID of the system to be updated.

The ID should be in the following format.

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

Parameter compatibleNamespaceVersion : The version of the user's namespace. Defaults to the latest version of the user's namespace.

If no value is specified, the latest version is used by default.

Implementation

Future<UpdateSystemTemplateResponse> updateSystemTemplate({
  required DefinitionDocument definition,
  required String id,
  int? compatibleNamespaceVersion,
}) async {
  ArgumentError.checkNotNull(definition, 'definition');
  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.UpdateSystemTemplate'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'definition': definition,
      'id': id,
      if (compatibleNamespaceVersion != null)
        'compatibleNamespaceVersion': compatibleNamespaceVersion,
    },
  );

  return UpdateSystemTemplateResponse.fromJson(jsonResponse.body);
}