listTargetsForPolicy method

Future<ListTargetsForPolicyResponse> listTargetsForPolicy({
  1. required String policyName,
  2. String? marker,
  3. int? pageSize,
})

List targets for the specified policy.

May throw ResourceNotFoundException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException. May throw LimitExceededException.

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 {
  ArgumentError.checkNotNull(policyName, 'policyName');
  _s.validateStringLength(
    'policyName',
    policyName,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'marker',
    marker,
    0,
    1024,
  );
  _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);
}