putMultiRegionAccessPointPolicy method

Future<PutMultiRegionAccessPointPolicyResult> putMultiRegionAccessPointPolicy({
  1. required String accountId,
  2. required PutMultiRegionAccessPointPolicyInput details,
  3. String? clientToken,
})
Associates an access control policy with the specified Multi-Region Access Point. Each Multi-Region Access Point can have only one policy, so a request made to this action replaces any existing policy that is associated with the specified Multi-Region Access Point.

This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the Amazon S3 User Guide.

The following actions are related to PutMultiRegionAccessPointPolicy:

Parameter accountId : The Amazon Web Services account ID for the owner of the Multi-Region Access Point.

Parameter details : A container element containing the details of the policy for the Multi-Region Access Point.

Parameter clientToken : An idempotency token used to identify the request and guarantee that requests are unique.

Implementation

Future<PutMultiRegionAccessPointPolicyResult>
    putMultiRegionAccessPointPolicy({
  required String accountId,
  required PutMultiRegionAccessPointPolicyInput details,
  String? clientToken,
}) async {
  clientToken ??= _s.generateIdempotencyToken();
  final headers = <String, String>{
    'x-amz-account-id': accountId.toString(),
  };
  final $result = await _protocol.send(
    method: 'POST',
    requestUri: '/v20180820/async-requests/mrap/put-policy',
    headers: headers,
    payload: PutMultiRegionAccessPointPolicyRequest(
            accountId: accountId, details: details, clientToken: clientToken)
        .toXml('PutMultiRegionAccessPointPolicyRequest'),
    exceptionFnMap: _exceptionFns,
  );
  return PutMultiRegionAccessPointPolicyResult.fromXml($result.body);
}