listResourcePolicies method
Returns a list of policies for a resource.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter resourceArn :
Amazon Resource Name (ARN) for the resource.
Parameter maxResults :
The maximum number of items to return in the response. If more results
exist than the specified MaxResults value, a token is
included in the response so that you can retrieve the remaining results.
Parameter nextToken :
If present, indicates that more output is available than is included in
the current response. Use this value in the NextToken request
parameter in a next call to the operation to get more output. You can
repeat this until the NextToken response element returns
null.
Implementation
Future<ListResourcePoliciesResponse> listResourcePolicies({
required String resourceArn,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
20,
);
final $query = <String, List<String>>{
if (maxResults != null) 'MaxResults': [maxResults.toString()],
if (nextToken != null) 'NextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'POST',
requestUri:
'/resource-policies/${Uri.encodeComponent(resourceArn)}/?List',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListResourcePoliciesResponse.fromJson(response);
}