addPermission method
Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions.
May throw InvalidParameterException. May throw InternalErrorException. May throw AuthorizationErrorException. May throw NotFoundException.
Parameter awsAccountId
:
The AWS account IDs of the users (principals) who will be given access to
the specified actions. The users must have AWS accounts, but do not need
to be signed up for this service.
Parameter actionName
:
The action you want to allow for the specified principal(s).
Valid values: Any Amazon SNS action name, for example
Publish
.
Parameter label
:
A unique identifier for the new policy statement.
Parameter topicArn
:
The ARN of the topic whose access control policy you wish to modify.
Implementation
Future<void> addPermission({
required List<String> awsAccountId,
required List<String> actionName,
required String label,
required String topicArn,
}) async {
ArgumentError.checkNotNull(awsAccountId, 'awsAccountId');
ArgumentError.checkNotNull(actionName, 'actionName');
ArgumentError.checkNotNull(label, 'label');
ArgumentError.checkNotNull(topicArn, 'topicArn');
final $request = <String, dynamic>{};
$request['AWSAccountId'] = awsAccountId;
$request['ActionName'] = actionName;
$request['Label'] = label;
$request['TopicArn'] = topicArn;
await _protocol.send(
$request,
action: 'AddPermission',
version: '2010-03-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['AddPermissionInput'],
shapes: shapes,
);
}