updateProvisioningTemplate method
Updates a provisioning template.
Requires permission to access the UpdateProvisioningTemplate action.
May throw ConflictingResourceUpdateException.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw UnauthorizedException.
Parameter templateName :
The name of the provisioning template.
Parameter defaultVersionId :
The ID of the default provisioning template version.
Parameter description :
The description of the provisioning template.
Parameter enabled :
True to enable the provisioning template, otherwise false.
Parameter preProvisioningHook :
Updates the pre-provisioning hook template. Only supports template of type
FLEET_PROVISIONING. For more information about provisioning
template types, see type.
Parameter provisioningRoleArn :
The ARN of the role associated with the provisioning template. This IoT
role grants permission to provision a device.
Parameter removePreProvisioningHook :
Removes pre-provisioning hook template.
Implementation
Future<void> updateProvisioningTemplate({
required String templateName,
int? defaultVersionId,
String? description,
bool? enabled,
ProvisioningHook? preProvisioningHook,
String? provisioningRoleArn,
bool? removePreProvisioningHook,
}) async {
final $payload = <String, dynamic>{
if (defaultVersionId != null) 'defaultVersionId': defaultVersionId,
if (description != null) 'description': description,
if (enabled != null) 'enabled': enabled,
if (preProvisioningHook != null)
'preProvisioningHook': preProvisioningHook,
if (provisioningRoleArn != null)
'provisioningRoleArn': provisioningRoleArn,
if (removePreProvisioningHook != null)
'removePreProvisioningHook': removePreProvisioningHook,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/provisioning-templates/${Uri.encodeComponent(templateName)}',
exceptionFnMap: _exceptionFns,
);
}