listManagedThingAccountAssociations method

Future<ListManagedThingAccountAssociationsResponse> listManagedThingAccountAssociations({
  1. String? accountAssociationId,
  2. String? managedThingId,
  3. int? maxResults,
  4. String? nextToken,
})

Lists all account associations for a specific managed thing.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter accountAssociationId : The identifier of the account association to filter results by. When specified, only associations with this account association ID will be returned.

Parameter managedThingId : The identifier of the managed thing to list account associations for.

Parameter maxResults : The maximum number of account associations to return in a single response.

Parameter nextToken : A token used for pagination of results.

Implementation

Future<ListManagedThingAccountAssociationsResponse>
    listManagedThingAccountAssociations({
  String? accountAssociationId,
  String? managedThingId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (accountAssociationId != null)
      'AccountAssociationId': [accountAssociationId],
    if (managedThingId != null) 'ManagedThingId': [managedThingId],
    if (maxResults != null) 'MaxResults': [maxResults.toString()],
    if (nextToken != null) 'NextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/managed-thing-associations',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListManagedThingAccountAssociationsResponse.fromJson(response);
}