getPublicAccessBlock method

Future<GetPublicAccessBlockOutput> getPublicAccessBlock({
  1. required String accountId,
})

Retrieves the PublicAccessBlock configuration for an AWS account. For more information, see Using Amazon S3 block public access.

Related actions include:

May throw NoSuchPublicAccessBlockConfiguration.

Parameter accountId : The account ID for the AWS account whose PublicAccessBlock configuration you want to retrieve.

Implementation

Future<GetPublicAccessBlockOutput> getPublicAccessBlock({
  required String accountId,
}) async {
  ArgumentError.checkNotNull(accountId, 'accountId');
  _s.validateStringLength(
    'accountId',
    accountId,
    0,
    64,
    isRequired: true,
  );
  final headers = <String, String>{
    'x-amz-account-id': accountId.toString(),
  };
  final $result = await _protocol.sendRaw(
    method: 'GET',
    requestUri: '/v20180820/configuration/publicAccessBlock',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return GetPublicAccessBlockOutput(
    publicAccessBlockConfiguration:
        PublicAccessBlockConfiguration.fromXml($elem),
  );
}