createProvisioningTemplateVersion method
Creates a new version of a fleet provisioning template.
May throw VersionsLimitExceededException. May throw InternalFailureException. May throw InvalidRequestException. May throw ThrottlingException. May throw ResourceNotFoundException. May throw UnauthorizedException. May throw ConflictingResourceUpdateException.
Parameter templateBody
:
The JSON formatted contents of the fleet provisioning template.
Parameter templateName
:
The name of the fleet provisioning template.
Parameter setAsDefault
:
Sets a fleet provision template version as the default version.
Implementation
Future<CreateProvisioningTemplateVersionResponse>
createProvisioningTemplateVersion({
required String templateBody,
required String templateName,
bool? setAsDefault,
}) async {
ArgumentError.checkNotNull(templateBody, 'templateBody');
ArgumentError.checkNotNull(templateName, 'templateName');
_s.validateStringLength(
'templateName',
templateName,
1,
36,
isRequired: true,
);
final $query = <String, List<String>>{
if (setAsDefault != null) 'setAsDefault': [setAsDefault.toString()],
};
final $payload = <String, dynamic>{
'templateBody': templateBody,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/provisioning-templates/${Uri.encodeComponent(templateName)}/versions',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return CreateProvisioningTemplateVersionResponse.fromJson(response);
}