associateResourceSharePermission method
Associates a permission with a resource share.
May throw MalformedArnException. May throw UnknownResourceException. May throw InvalidParameterException. May throw InvalidClientTokenException. May throw ServerInternalException. May throw ServiceUnavailableException. May throw OperationNotPermittedException.
Parameter permissionArn
:
The ARN of the AWS RAM permission to associate with the resource share.
Parameter resourceShareArn
:
The Amazon Resource Name (ARN) of the resource share.
Parameter clientToken
:
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter replace
:
Indicates whether the permission should replace the permissions that are
currently associated with the resource share. Use true
to
replace the current permissions. Use false
to add the
permission to the current permission.
Implementation
Future<AssociateResourceSharePermissionResponse>
associateResourceSharePermission({
required String permissionArn,
required String resourceShareArn,
String? clientToken,
bool? replace,
}) async {
ArgumentError.checkNotNull(permissionArn, 'permissionArn');
ArgumentError.checkNotNull(resourceShareArn, 'resourceShareArn');
final $payload = <String, dynamic>{
'permissionArn': permissionArn,
'resourceShareArn': resourceShareArn,
if (clientToken != null) 'clientToken': clientToken,
if (replace != null) 'replace': replace,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/associateresourcesharepermission',
exceptionFnMap: _exceptionFns,
);
return AssociateResourceSharePermissionResponse.fromJson(response);
}