updateTopicPermissions method

Future<UpdateTopicPermissionsResponse> updateTopicPermissions({
  1. required String awsAccountId,
  2. required String topicId,
  3. List<ResourcePermission>? grantPermissions,
  4. List<ResourcePermission>? revokePermissions,
})

Updates the permissions of a topic.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnsupportedUserEditionException.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the topic that you want to update the permissions for.

Parameter topicId : The ID of the topic that you want to modify. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.

Parameter grantPermissions : The resource permissions that you want to grant to the topic.

Parameter revokePermissions : The resource permissions that you want to revoke from the topic.

Implementation

Future<UpdateTopicPermissionsResponse> updateTopicPermissions({
  required String awsAccountId,
  required String topicId,
  List<ResourcePermission>? grantPermissions,
  List<ResourcePermission>? revokePermissions,
}) async {
  final $payload = <String, dynamic>{
    if (grantPermissions != null) 'GrantPermissions': grantPermissions,
    if (revokePermissions != null) 'RevokePermissions': revokePermissions,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/topics/${Uri.encodeComponent(topicId)}/permissions',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateTopicPermissionsResponse.fromJson(response);
}