listTargetsForSecurityProfile method

Future<ListTargetsForSecurityProfileResponse> listTargetsForSecurityProfile({
  1. required String securityProfileName,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the targets (thing groups) associated with a given Device Defender security profile.

May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw InternalFailureException.

Parameter securityProfileName : The security profile.

Parameter maxResults : The maximum number of results to return at one time.

Parameter nextToken : The token for the next set of results.

Implementation

Future<ListTargetsForSecurityProfileResponse> listTargetsForSecurityProfile({
  required String securityProfileName,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(securityProfileName, 'securityProfileName');
  _s.validateStringLength(
    'securityProfileName',
    securityProfileName,
    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],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/security-profiles/${Uri.encodeComponent(securityProfileName)}/targets',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListTargetsForSecurityProfileResponse.fromJson(response);
}