updateDynamicThingGroup method
Updates a dynamic thing group.
May throw InvalidRequestException. May throw VersionConflictException. May throw ThrottlingException. May throw InternalFailureException. May throw ResourceNotFoundException. May throw InvalidQueryException.
Parameter thingGroupName
:
The name of the dynamic thing group to update.
Parameter thingGroupProperties
:
The dynamic thing group properties to update.
Parameter expectedVersion
:
The expected version of the dynamic thing group to update.
Parameter indexName
:
The dynamic thing group index to update.
Parameter queryString
:
The dynamic thing group search query string to update.
Parameter queryVersion
:
The dynamic thing group query version to update.
Implementation
Future<UpdateDynamicThingGroupResponse> updateDynamicThingGroup({
required String thingGroupName,
required ThingGroupProperties thingGroupProperties,
int? expectedVersion,
String? indexName,
String? queryString,
String? queryVersion,
}) async {
ArgumentError.checkNotNull(thingGroupName, 'thingGroupName');
_s.validateStringLength(
'thingGroupName',
thingGroupName,
1,
128,
isRequired: true,
);
ArgumentError.checkNotNull(thingGroupProperties, 'thingGroupProperties');
_s.validateStringLength(
'indexName',
indexName,
1,
128,
);
_s.validateStringLength(
'queryString',
queryString,
1,
1152921504606846976,
);
final $payload = <String, dynamic>{
'thingGroupProperties': thingGroupProperties,
if (expectedVersion != null) 'expectedVersion': expectedVersion,
if (indexName != null) 'indexName': indexName,
if (queryString != null) 'queryString': queryString,
if (queryVersion != null) 'queryVersion': queryVersion,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/dynamic-thing-groups/${Uri.encodeComponent(thingGroupName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateDynamicThingGroupResponse.fromJson(response);
}