updateThingGroup method
Update a thing group.
Requires permission to access the UpdateThingGroup action.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw VersionConflictException.
Parameter thingGroupName :
The thing group to update.
Parameter thingGroupProperties :
The thing group properties.
Parameter expectedVersion :
The expected version of the thing group. If this does not match the
version of the thing group being updated, the update will fail.
Implementation
Future<UpdateThingGroupResponse> updateThingGroup({
required String thingGroupName,
required ThingGroupProperties thingGroupProperties,
int? expectedVersion,
}) async {
final $payload = <String, dynamic>{
'thingGroupProperties': thingGroupProperties,
if (expectedVersion != null) 'expectedVersion': expectedVersion,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri: '/thing-groups/${Uri.encodeComponent(thingGroupName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateThingGroupResponse.fromJson(response);
}