putResourcePolicy method
Creates or updates a resource policy.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter policyDocument :
The JSON resource policy document.
Parameter resourceArn :
The ARN of the resource policy.
Implementation
Future<void> putResourcePolicy({
required Object policyDocument,
required String resourceArn,
}) async {
final $payload = <String, dynamic>{
'PolicyDocument': jsonEncode(policyDocument),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/resource-policy/${Uri.encodeComponent(resourceArn)}',
exceptionFnMap: _exceptionFns,
);
}