listAccessGrantsLocations method
Returns a list of the locations registered in your S3 Access Grants instance.
- Permissions
-
You must have the
s3:ListAccessGrantsLocationspermission to use this operation.
Parameter accountId :
The Amazon Web Services account ID of the S3 Access Grants instance.
Parameter locationScope :
The S3 path to the location that you are registering. The location scope
can be the default S3 location s3://, the S3 path to a bucket
s3://, or the S3 path to a bucket and prefix
s3://. A prefix in S3 is a string of
characters at the beginning of an object key name used to organize the
objects that you store in your S3 buckets. For example, object key names
that start with the engineering/ prefix or object key names
that start with the marketing/campaigns/ prefix.
Parameter maxResults :
The maximum number of access grants that you would like returned in the
List Access Grants response. If the results include the
pagination token NextToken, make another call using the
NextToken to determine if there are more results.
Parameter nextToken :
A pagination token to request the next page of results. Pass this value
into a subsequent List Access Grants Locations request in
order to retrieve the next page of results.
Implementation
Future<ListAccessGrantsLocationsResult> listAccessGrantsLocations({
required String accountId,
String? locationScope,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
0,
1000,
);
final headers = <String, String>{
'x-amz-account-id': accountId.toString(),
};
final $query = <String, List<String>>{
if (locationScope != null) 'locationscope': [locationScope],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final $result = await _protocol.send(
method: 'GET',
requestUri: '/v20180820/accessgrantsinstance/locations',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return ListAccessGrantsLocationsResult.fromXml($result.body);
}