putResourcePolicy method
Attaches a resource-based permission policy to the Amazon Web Services
Migration Hub Refactor Spaces environment. The policy must contain the
same actions and condition statements as the
arn:aws:ram::aws:permission/AWSRAMDefaultPermissionRefactorSpacesEnvironment
permission in Resource Access Manager. The policy must not contain new
lines or blank lines.
May throw AccessDeniedException.
May throw InternalServerException.
May throw InvalidResourcePolicyException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter policy :
A JSON-formatted string for an Amazon Web Services resource-based policy.
Parameter resourceArn :
The Amazon Resource Name (ARN) of the resource to which the policy is
being attached.
Implementation
Future<void> putResourcePolicy({
required String policy,
required String resourceArn,
}) async {
final $payload = <String, dynamic>{
'Policy': policy,
'ResourceArn': resourceArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/resourcepolicy',
exceptionFnMap: _exceptionFns,
);
}