@@ -217,137 +217,52 @@ export type EventNotificationDeleteResponse = unknown;
217217
218218export interface EventNotificationGetResponse {
219219 /**
220- * Unique identifier for this rule .
220+ * Queue ID .
221221 */
222- id : string ;
222+ queueId ? : string ;
223223
224224 /**
225- * Conditions that apply to all transitions of this rule .
225+ * Name of the queue .
226226 */
227- conditions : EventNotificationGetResponse . Conditions ;
227+ queueName ?: string ;
228228
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 > ;
248230}
249231
250232export 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 {
290234 /**
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.
293236 */
294- condition ?:
295- | DeleteObjectsTransition . R2LifecycleAgeCondition
296- | DeleteObjectsTransition . R2LifecycleDateCondition ;
297- }
237+ actions : Array <
238+ 'PutObject' | 'CopyObject' | 'DeleteObject' | 'CompleteMultipartUpload' | 'LifecycleDeletion'
239+ > ;
298240
299- export namespace DeleteObjectsTransition {
300241 /**
301- * Condition for lifecycle transitions to apply after an object reaches an age in
302- * seconds.
242+ * Timestamp when the rule was created.
303243 */
304- export interface R2LifecycleAgeCondition {
305- maxAge : number ;
306-
307- type : 'Age' ;
308- }
244+ createdAt ?: string ;
309245
310246 /**
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.
312249 */
313- export interface R2LifecycleDateCondition {
314- date : string ;
315-
316- type : 'Date' ;
317- }
318- }
250+ description ?: string ;
319251
320- export interface StorageClassTransition {
321252 /**
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.
324254 */
325- condition :
326- | StorageClassTransition . R2LifecycleAgeCondition
327- | StorageClassTransition . R2LifecycleDateCondition ;
328-
329- storageClass : 'InfrequentAccess' ;
330- }
255+ prefix ?: string ;
331256
332- export namespace StorageClassTransition {
333257 /**
334- * Condition for lifecycle transitions to apply after an object reaches an age in
335- * seconds.
258+ * Rule ID.
336259 */
337- export interface R2LifecycleAgeCondition {
338- maxAge : number ;
339-
340- type : 'Age' ;
341- }
260+ ruleId ?: string ;
342261
343262 /**
344- * Condition for lifecycle transitions to apply on a specific date .
263+ * Notifications will be sent only for objects with this suffix .
345264 */
346- export interface R2LifecycleDateCondition {
347- date : string ;
348-
349- type : 'Date' ;
350- }
265+ suffix ?: string ;
351266 }
352267}
353268
0 commit comments