listTargetsForPolicy method
List targets for the specified policy.
Requires permission to access the ListTargetsForPolicy action.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw UnauthorizedException.
Parameter policyName :
The policy name.
Parameter marker :
A marker used to get the next set of results.
Parameter pageSize :
The maximum number of results to return at one time.
Implementation
Future<ListTargetsForPolicyResponse> listTargetsForPolicy({
required String policyName,
String? marker,
int? pageSize,
}) async {
_s.validateNumRange(
'pageSize',
pageSize,
1,
250,
);
final $query = <String, List<String>>{
if (marker != null) 'marker': [marker],
if (pageSize != null) 'pageSize': [pageSize.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'POST',
requestUri: '/policy-targets/${Uri.encodeComponent(policyName)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListTargetsForPolicyResponse.fromJson(response);
}