@@ -217,137 +217,52 @@ export type EventNotificationDeleteResponse = unknown;
217
217
218
218
export interface EventNotificationGetResponse {
219
219
/**
220
- * Unique identifier for this rule .
220
+ * Queue ID .
221
221
*/
222
- id : string ;
222
+ queueId ? : string ;
223
223
224
224
/**
225
- * Conditions that apply to all transitions of this rule .
225
+ * Name of the queue .
226
226
*/
227
- conditions : EventNotificationGetResponse . Conditions ;
227
+ queueName ?: string ;
228
228
229
- /**
230
- * Whether or not this rule is in effect.
231
- */
232
- enabled : boolean ;
233
-
234
- /**
235
- * Transition to abort ongoing multipart uploads.
236
- */
237
- abortMultipartUploadsTransition ?: EventNotificationGetResponse . AbortMultipartUploadsTransition ;
238
-
239
- /**
240
- * Transition to delete objects.
241
- */
242
- deleteObjectsTransition ?: EventNotificationGetResponse . DeleteObjectsTransition ;
243
-
244
- /**
245
- * Transitions to change the storage class of objects.
246
- */
247
- storageClassTransitions ?: Array < EventNotificationGetResponse . StorageClassTransition > ;
229
+ rules ?: Array < EventNotificationGetResponse . Rule > ;
248
230
}
249
231
250
232
export namespace EventNotificationGetResponse {
251
- /**
252
- * Conditions that apply to all transitions of this rule.
253
- */
254
- export interface Conditions {
255
- /**
256
- * Transitions will only apply to objects/uploads in the bucket that start with the
257
- * given prefix, an empty prefix can be provided to scope rule to all
258
- * objects/uploads.
259
- */
260
- prefix : string ;
261
- }
262
-
263
- /**
264
- * Transition to abort ongoing multipart uploads.
265
- */
266
- export interface AbortMultipartUploadsTransition {
267
- /**
268
- * Condition for lifecycle transitions to apply after an object reaches an age in
269
- * seconds.
270
- */
271
- condition ?: AbortMultipartUploadsTransition . Condition ;
272
- }
273
-
274
- export namespace AbortMultipartUploadsTransition {
275
- /**
276
- * Condition for lifecycle transitions to apply after an object reaches an age in
277
- * seconds.
278
- */
279
- export interface Condition {
280
- maxAge : number ;
281
-
282
- type : 'Age' ;
283
- }
284
- }
285
-
286
- /**
287
- * Transition to delete objects.
288
- */
289
- export interface DeleteObjectsTransition {
233
+ export interface Rule {
290
234
/**
291
- * Condition for lifecycle transitions to apply after an object reaches an age in
292
- * seconds.
235
+ * Array of R2 object actions that will trigger notifications.
293
236
*/
294
- condition ?:
295
- | DeleteObjectsTransition . R2LifecycleAgeCondition
296
- | DeleteObjectsTransition . R2LifecycleDateCondition ;
297
- }
237
+ actions : Array <
238
+ 'PutObject' | 'CopyObject' | 'DeleteObject' | 'CompleteMultipartUpload' | 'LifecycleDeletion'
239
+ > ;
298
240
299
- export namespace DeleteObjectsTransition {
300
241
/**
301
- * Condition for lifecycle transitions to apply after an object reaches an age in
302
- * seconds.
242
+ * Timestamp when the rule was created.
303
243
*/
304
- export interface R2LifecycleAgeCondition {
305
- maxAge : number ;
306
-
307
- type : 'Age' ;
308
- }
244
+ createdAt ?: string ;
309
245
310
246
/**
311
- * Condition for lifecycle transitions to apply on a specific date.
247
+ * A description that can be used to identify the event notification rule after
248
+ * creation.
312
249
*/
313
- export interface R2LifecycleDateCondition {
314
- date : string ;
315
-
316
- type : 'Date' ;
317
- }
318
- }
250
+ description ?: string ;
319
251
320
- export interface StorageClassTransition {
321
252
/**
322
- * Condition for lifecycle transitions to apply after an object reaches an age in
323
- * seconds.
253
+ * Notifications will be sent only for objects with this prefix.
324
254
*/
325
- condition :
326
- | StorageClassTransition . R2LifecycleAgeCondition
327
- | StorageClassTransition . R2LifecycleDateCondition ;
328
-
329
- storageClass : 'InfrequentAccess' ;
330
- }
255
+ prefix ?: string ;
331
256
332
- export namespace StorageClassTransition {
333
257
/**
334
- * Condition for lifecycle transitions to apply after an object reaches an age in
335
- * seconds.
258
+ * Rule ID.
336
259
*/
337
- export interface R2LifecycleAgeCondition {
338
- maxAge : number ;
339
-
340
- type : 'Age' ;
341
- }
260
+ ruleId ?: string ;
342
261
343
262
/**
344
- * Condition for lifecycle transitions to apply on a specific date .
263
+ * Notifications will be sent only for objects with this suffix .
345
264
*/
346
- export interface R2LifecycleDateCondition {
347
- date : string ;
348
-
349
- type : 'Date' ;
350
- }
265
+ suffix ?: string ;
351
266
}
352
267
}
353
268
0 commit comments