Skip to content

Commit 608c959

Browse files
leftybournesbackportbot[bot]
authored andcommitted
feat: emit an event when an S3 bucket is created
Signed-off-by: Kent Delante <[email protected]> [skip ci]
1 parent 7c478db commit 608c959

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

lib/composer/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@
396396
'OCP\\Files\\Notify\\IChange' => $baseDir . '/lib/public/Files/Notify/IChange.php',
397397
'OCP\\Files\\Notify\\INotifyHandler' => $baseDir . '/lib/public/Files/Notify/INotifyHandler.php',
398398
'OCP\\Files\\Notify\\IRenameChange' => $baseDir . '/lib/public/Files/Notify/IRenameChange.php',
399+
'OCP\\Files\\ObjectStore\\Events\\BucketCreatedEvent' => $baseDir . '/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php',
399400
'OCP\\Files\\ObjectStore\\IObjectStore' => $baseDir . '/lib/public/Files/ObjectStore/IObjectStore.php',
400401
'OCP\\Files\\ObjectStore\\IObjectStoreMultiPartUpload' => $baseDir . '/lib/public/Files/ObjectStore/IObjectStoreMultiPartUpload.php',
401402
'OCP\\Files\\ReservedWordException' => $baseDir . '/lib/public/Files/ReservedWordException.php',

lib/composer/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
429429
'OCP\\Files\\Notify\\IChange' => __DIR__ . '/../../..' . '/lib/public/Files/Notify/IChange.php',
430430
'OCP\\Files\\Notify\\INotifyHandler' => __DIR__ . '/../../..' . '/lib/public/Files/Notify/INotifyHandler.php',
431431
'OCP\\Files\\Notify\\IRenameChange' => __DIR__ . '/../../..' . '/lib/public/Files/Notify/IRenameChange.php',
432+
'OCP\\Files\\ObjectStore\\Events\\BucketCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php',
432433
'OCP\\Files\\ObjectStore\\IObjectStore' => __DIR__ . '/../../..' . '/lib/public/Files/ObjectStore/IObjectStore.php',
433434
'OCP\\Files\\ObjectStore\\IObjectStoreMultiPartUpload' => __DIR__ . '/../../..' . '/lib/public/Files/ObjectStore/IObjectStoreMultiPartUpload.php',
434435
'OCP\\Files\\ReservedWordException' => __DIR__ . '/../../..' . '/lib/public/Files/ReservedWordException.php',

lib/private/Files/ObjectStore/S3ConnectionTrait.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
use Aws\S3\S3Client;
4141
use GuzzleHttp\Promise;
4242
use GuzzleHttp\Promise\RejectedPromise;
43+
use OCP\EventDispatcher\IEventDispatcher;
44+
use OCP\Files\ObjectStore\Events\BucketCreatedEvent;
4345
use OCP\Files\StorageNotAvailableException;
4446
use OCP\ICertificateManager;
4547
use OCP\Server;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-only
8+
*/
9+
namespace OCP\Files\ObjectStore\Events;
10+
11+
use OCP\AppFramework\Attribute\Consumable;
12+
use OCP\EventDispatcher\Event;
13+
14+
/**
15+
* @since 33.0.0
16+
*/
17+
#[Consumable(since: '33.0.0')]
18+
class BucketCreatedEvent extends Event {
19+
20+
public function __construct(
21+
private readonly string $bucket,
22+
private readonly string $endpoint,
23+
private readonly string $region,
24+
private readonly string $version = 'latest',
25+
) {
26+
parent::__construct();
27+
}
28+
29+
public function getBucket(): string {
30+
return $this->bucket;
31+
}
32+
33+
public function getEndpoint(): string {
34+
return $this->endpoint;
35+
}
36+
37+
public function getRegion(): string {
38+
return $this->region;
39+
}
40+
41+
public function getVersion(): string {
42+
return $this->version;
43+
}
44+
}

0 commit comments

Comments
 (0)