listThingsInThingGroup method
Lists the things in the specified group.
May throw InvalidRequestException. May throw InternalFailureException. May throw ResourceNotFoundException. May throw ThrottlingException.
Parameter thingGroupName
:
The thing group name.
Parameter maxResults
:
The maximum number of results to return at one time.
Parameter nextToken
:
To retrieve the next set of results, the nextToken
value from
a previous response; otherwise null to receive the first set of
results.
Parameter recursive
:
When true, list things in this thing group and in all child groups as
well.
Implementation
Future<ListThingsInThingGroupResponse> listThingsInThingGroup({
required String thingGroupName,
int? maxResults,
String? nextToken,
bool? recursive,
}) async {
ArgumentError.checkNotNull(thingGroupName, 'thingGroupName');
_s.validateStringLength(
'thingGroupName',
thingGroupName,
1,
128,
isRequired: true,
);
_s.validateNumRange(
'maxResults',
maxResults,
1,
250,
);
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
if (recursive != null) 'recursive': [recursive.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/thing-groups/${Uri.encodeComponent(thingGroupName)}/things',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListThingsInThingGroupResponse.fromJson(response);
}