updateProvisioningTemplate method
Updates a fleet provisioning template.
May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw UnauthorizedException. May throw ConflictingResourceUpdateException.
Parameter templateName
:
The name of the fleet provisioning template.
Parameter defaultVersionId
:
The ID of the default provisioning template version.
Parameter description
:
The description of the fleet provisioning template.
Parameter enabled
:
True to enable the fleet provisioning template, otherwise false.
Parameter preProvisioningHook
:
Updates the pre-provisioning hook template.
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 {
ArgumentError.checkNotNull(templateName, 'templateName');
_s.validateStringLength(
'templateName',
templateName,
1,
36,
isRequired: true,
);
_s.validateStringLength(
'description',
description,
0,
500,
);
_s.validateStringLength(
'provisioningRoleArn',
provisioningRoleArn,
20,
2048,
);
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,
);
}