putResourcePolicy method
Creates or updates a resource-based policy for a resource with the specified resourceArn.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter policy :
The resource policy to create or update.
Parameter resourceArn :
The Amazon Resource Name (ARN) of the resource for which to create or
update the resource policy.
Implementation
Future<PutResourcePolicyResponse> putResourcePolicy({
required String policy,
required String resourceArn,
}) async {
final $payload = <String, dynamic>{
'policy': policy,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/resourcepolicy/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
return PutResourcePolicyResponse.fromJson(response);
}