Skip to content

Commit 19c0409

Browse files
feat(api): api update
1 parent 4101e40 commit 19c0409

File tree

2 files changed

+24
-106
lines changed

2 files changed

+24
-106
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
Lines changed: 22 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,43 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import datetime
4-
from typing import List, Union, Optional
5-
from typing_extensions import Literal, TypeAlias
3+
from typing import List, Optional
4+
from typing_extensions import Literal
65

76
from pydantic import Field as FieldInfo
87

98
from ...._models import BaseModel
109

11-
__all__ = [
12-
"EventNotificationGetResponse",
13-
"Conditions",
14-
"AbortMultipartUploadsTransition",
15-
"AbortMultipartUploadsTransitionCondition",
16-
"DeleteObjectsTransition",
17-
"DeleteObjectsTransitionCondition",
18-
"DeleteObjectsTransitionConditionR2LifecycleAgeCondition",
19-
"DeleteObjectsTransitionConditionR2LifecycleDateCondition",
20-
"StorageClassTransition",
21-
"StorageClassTransitionCondition",
22-
"StorageClassTransitionConditionR2LifecycleAgeCondition",
23-
"StorageClassTransitionConditionR2LifecycleDateCondition",
24-
]
10+
__all__ = ["EventNotificationGetResponse", "Rule"]
2511

2612

27-
class Conditions(BaseModel):
28-
prefix: str
29-
"""
30-
Transitions will only apply to objects/uploads in the bucket that start with the
31-
given prefix, an empty prefix can be provided to scope rule to all
32-
objects/uploads.
33-
"""
34-
35-
36-
class AbortMultipartUploadsTransitionCondition(BaseModel):
37-
max_age: int = FieldInfo(alias="maxAge")
38-
39-
type: Literal["Age"]
40-
41-
42-
class AbortMultipartUploadsTransition(BaseModel):
43-
condition: Optional[AbortMultipartUploadsTransitionCondition] = None
44-
"""
45-
Condition for lifecycle transitions to apply after an object reaches an age in
46-
seconds.
47-
"""
48-
49-
50-
class DeleteObjectsTransitionConditionR2LifecycleAgeCondition(BaseModel):
51-
max_age: int = FieldInfo(alias="maxAge")
52-
53-
type: Literal["Age"]
54-
55-
56-
class DeleteObjectsTransitionConditionR2LifecycleDateCondition(BaseModel):
57-
date: datetime.date
58-
59-
type: Literal["Date"]
13+
class Rule(BaseModel):
14+
actions: List[Literal["PutObject", "CopyObject", "DeleteObject", "CompleteMultipartUpload", "LifecycleDeletion"]]
15+
"""Array of R2 object actions that will trigger notifications."""
6016

17+
created_at: Optional[str] = FieldInfo(alias="createdAt", default=None)
18+
"""Timestamp when the rule was created."""
6119

62-
DeleteObjectsTransitionCondition: TypeAlias = Union[
63-
DeleteObjectsTransitionConditionR2LifecycleAgeCondition, DeleteObjectsTransitionConditionR2LifecycleDateCondition
64-
]
65-
66-
67-
class DeleteObjectsTransition(BaseModel):
68-
condition: Optional[DeleteObjectsTransitionCondition] = None
20+
description: Optional[str] = None
6921
"""
70-
Condition for lifecycle transitions to apply after an object reaches an age in
71-
seconds.
22+
A description that can be used to identify the event notification rule after
23+
creation.
7224
"""
7325

26+
prefix: Optional[str] = None
27+
"""Notifications will be sent only for objects with this prefix."""
7428

75-
class StorageClassTransitionConditionR2LifecycleAgeCondition(BaseModel):
76-
max_age: int = FieldInfo(alias="maxAge")
77-
78-
type: Literal["Age"]
79-
29+
rule_id: Optional[str] = FieldInfo(alias="ruleId", default=None)
30+
"""Rule ID."""
8031

81-
class StorageClassTransitionConditionR2LifecycleDateCondition(BaseModel):
82-
date: datetime.date
83-
84-
type: Literal["Date"]
85-
86-
87-
StorageClassTransitionCondition: TypeAlias = Union[
88-
StorageClassTransitionConditionR2LifecycleAgeCondition, StorageClassTransitionConditionR2LifecycleDateCondition
89-
]
90-
91-
92-
class StorageClassTransition(BaseModel):
93-
condition: StorageClassTransitionCondition
94-
"""
95-
Condition for lifecycle transitions to apply after an object reaches an age in
96-
seconds.
97-
"""
98-
99-
storage_class: Literal["InfrequentAccess"] = FieldInfo(alias="storageClass")
32+
suffix: Optional[str] = None
33+
"""Notifications will be sent only for objects with this suffix."""
10034

10135

10236
class EventNotificationGetResponse(BaseModel):
103-
id: str
104-
"""Unique identifier for this rule."""
105-
106-
conditions: Conditions
107-
"""Conditions that apply to all transitions of this rule."""
108-
109-
enabled: bool
110-
"""Whether or not this rule is in effect."""
111-
112-
abort_multipart_uploads_transition: Optional[AbortMultipartUploadsTransition] = FieldInfo(
113-
alias="abortMultipartUploadsTransition", default=None
114-
)
115-
"""Transition to abort ongoing multipart uploads."""
37+
queue_id: Optional[str] = FieldInfo(alias="queueId", default=None)
38+
"""Queue ID."""
11639

117-
delete_objects_transition: Optional[DeleteObjectsTransition] = FieldInfo(
118-
alias="deleteObjectsTransition", default=None
119-
)
120-
"""Transition to delete objects."""
40+
queue_name: Optional[str] = FieldInfo(alias="queueName", default=None)
41+
"""Name of the queue."""
12142

122-
storage_class_transitions: Optional[List[StorageClassTransition]] = FieldInfo(
123-
alias="storageClassTransitions", default=None
124-
)
125-
"""Transitions to change the storage class of objects."""
43+
rules: Optional[List[Rule]] = None

0 commit comments

Comments
 (0)