listAccessGrantsInstances method

Future<ListAccessGrantsInstancesResult> listAccessGrantsInstances({
  1. required String accountId,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of S3 Access Grants instances. An S3 Access Grants instance serves as a logical grouping for your individual access grants. You can only have one S3 Access Grants instance per Region per account.

Permissions
You must have the s3:ListAccessGrantsInstances permission to use this operation.

Parameter accountId : The Amazon Web Services account ID of the S3 Access Grants instance.

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 Instances request in order to retrieve the next page of results.

Implementation

Future<ListAccessGrantsInstancesResult> listAccessGrantsInstances({
  required String accountId,
  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 (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final $result = await _protocol.send(
    method: 'GET',
    requestUri: '/v20180820/accessgrantsinstances',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return ListAccessGrantsInstancesResult.fromXml($result.body);
}