putResourcePolicy method

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

Attaches a resource-based permission policy to a service or service network. The policy must contain the same actions and condition statements as the Amazon Web Services Resource Access Manager permission for sharing services and service networks.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter policy : An IAM policy. The policy string in JSON must not contain newlines or blank lines.

Parameter resourceArn : The ID or ARN of the service network or service for which the policy is created.

Implementation

Future<void> 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,
  );
}