putResourcePolicy method

Future<PutResourcePolicyResult> putResourcePolicy({
  1. required String policy,
  2. required String resourceArn,
})

Updates the resource policy for a specified resource.

May throw ConflictPolicyUpdateFault. May throw InvalidPolicyFault. May throw ResourceNotFoundFault. May throw UnsupportedOperationFault.

Parameter policy : The content of the resource policy being updated.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource of which its resource policy is updated.

Implementation

Future<PutResourcePolicyResult> putResourcePolicy({
  required String policy,
  required String resourceArn,
}) async {
  final $request = <String, String>{
    'Policy': policy,
    'ResourceArn': resourceArn,
  };
  final $result = await _protocol.send(
    $request,
    action: 'PutResourcePolicy',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'PutResourcePolicyResult',
  );
  return PutResourcePolicyResult.fromXml($result);
}