listPrincipalPolicies method
Lists the policies attached to the specified principal. If you use an Cognito identity, the ID must be in AmazonCognito Identity format.
Note: This API is deprecated. Please use ListAttachedPolicies instead.
May throw ResourceNotFoundException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.
Parameter principal
:
The principal. Valid principals are CertificateArn
(arn:aws:iot:region:accountId:cert/certificateId),
thingGroupArn
(arn:aws:iot:region:accountId:thinggroup/groupName)
and CognitoId (region:id).
Parameter ascendingOrder
:
Specifies the order for results. If true, 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<ListPrincipalPoliciesResponse> listPrincipalPolicies({
required String principal,
bool? ascendingOrder,
String? marker,
int? pageSize,
}) async {
ArgumentError.checkNotNull(principal, 'principal');
_s.validateStringLength(
'marker',
marker,
0,
1024,
);
_s.validateNumRange(
'pageSize',
pageSize,
1,
250,
);
final headers = <String, String>{
'x-amzn-iot-principal': principal.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: '/principal-policies',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return ListPrincipalPoliciesResponse.fromJson(response);
}