finalizeDeviceClaim method
Given a device ID, finalizes the claim request for the associated device.
Claiming a device consists of initiating a claim, then publishing a device event, and finalizing the claim. For a device of type button, a device event can be published by simply clicking the device.
May throw ResourceNotFoundException. May throw InvalidRequestException. May throw InternalFailureException. May throw PreconditionFailedException. May throw ResourceConflictException.
Parameter deviceId
:
The unique identifier of the device.
Parameter tags
:
A collection of key/value pairs defining the resource tags. For example, {
"tags": {"key1": "value1", "key2": "value2"} }. For more information, see
AWS
Tagging Strategies.
Implementation
Future<FinalizeDeviceClaimResponse> finalizeDeviceClaim({
required String deviceId,
Map<String, String>? tags,
}) async {
ArgumentError.checkNotNull(deviceId, 'deviceId');
final $payload = <String, dynamic>{
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/devices/${Uri.encodeComponent(deviceId)}/finalize-claim',
exceptionFnMap: _exceptionFns,
);
return FinalizeDeviceClaimResponse.fromJson(response);
}