def check_bucket_subscription()

in src/api/app.py [0:0]


def check_bucket_subscription(data):
    buckets = set()

    for line in data:
        bucket_name = line.split(",")[0]
        buckets.add(bucket_name)

    for bucket in buckets:
        bucket_notifications_configuration = {
            "QueueConfigurations": [{
                "Events": ["s3:ObjectRestore:Completed"],
                "Id": "Notifications",
                "QueueArn": SQS_QUEUE
            }]
        }

        s3_client.put_bucket_notification_configuration(
            Bucket=bucket,
            NotificationConfiguration=bucket_notifications_configuration
        )