Skip to content

Commit 63c569a

Browse files
feat(api): api update
1 parent efc4cba commit 63c569a

File tree

2 files changed

+23
-108
lines changed

2 files changed

+23
-108
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1739
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c63bb5f5cb374b4518ed1dcf938886b9465497a2ccc1c0571eac56a21ccedf9b.yml
3-
openapi_spec_hash: 0e618ac88625173efbfa168170d74304
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ef4ea77dc2dd38a5380dd28b5c43705c3e0cf7d16233ba1922fff5abe6853746.yml
3+
openapi_spec_hash: 9ee49e631d6851f0df1dfb00195ec68f
44
config_hash: 7e270b3449efce600e3469937a344c2d

src/resources/r2/buckets/event-notifications.ts

Lines changed: 21 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -217,137 +217,52 @@ export type EventNotificationDeleteResponse = unknown;
217217

218218
export 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

250232
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 {
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

Comments
 (0)