listPolicyPrincipals method

  1. @Deprecated('Deprecated')
Future<ListPolicyPrincipalsResponse> listPolicyPrincipals({
  1. required String policyName,
  2. bool? ascendingOrder,
  3. String? marker,
  4. int? pageSize,
})

Lists the principals associated with the specified policy.

Note: This API is deprecated. Please use ListTargetsForPolicy instead.

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

Parameter policyName : The policy name.

Parameter ascendingOrder : Specifies the order for results. If true, the results are returned in ascending creation order.

Parameter marker : The marker for the next set of results.

Parameter pageSize : The result page size.

Implementation

@Deprecated('Deprecated')
Future<ListPolicyPrincipalsResponse> listPolicyPrincipals({
  required String policyName,
  bool? ascendingOrder,
  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 headers = <String, String>{
    'x-amzn-iot-policy': policyName.toString(),
  };
  final $query = <String, List<String>>{
    if (ascendingOrder != null)
      'isAscendingOrder': [ascendingOrder.toString()],
    if (marker != null) 'marker': [marker],
    if (pageSize != null) 'pageSize': [pageSize.toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/policy-principals',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return ListPolicyPrincipalsResponse.fromJson(response);
}