Skip to content

Commit f7751e3

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat: OpenAPI spec update via Stainless API (#67)
1 parent 8477214 commit f7751e3

14 files changed

+325
-6
lines changed

src/cloudflare/resources/dlp/profiles/customs.py

+10
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def update(
8888
*,
8989
account_id: str,
9090
allowed_match_count: float | NotGiven = NOT_GIVEN,
91+
context_awareness: custom_update_params.ContextAwareness | NotGiven = NOT_GIVEN,
9192
description: str | NotGiven = NOT_GIVEN,
9293
entries: Iterable[custom_update_params.Entry] | NotGiven = NOT_GIVEN,
9394
name: str | NotGiven = NOT_GIVEN,
@@ -109,6 +110,9 @@ def update(
109110
110111
allowed_match_count: Related DLP policies will trigger when the match count exceeds the number set.
111112
113+
context_awareness: Scan the context of predefined entries to only return matches surrounded by
114+
keywords.
115+
112116
description: The description of the profile.
113117
114118
entries: The custom entries for this profile. Array elements with IDs are modifying the
@@ -137,6 +141,7 @@ def update(
137141
body=maybe_transform(
138142
{
139143
"allowed_match_count": allowed_match_count,
144+
"context_awareness": context_awareness,
140145
"description": description,
141146
"entries": entries,
142147
"name": name,
@@ -300,6 +305,7 @@ async def update(
300305
*,
301306
account_id: str,
302307
allowed_match_count: float | NotGiven = NOT_GIVEN,
308+
context_awareness: custom_update_params.ContextAwareness | NotGiven = NOT_GIVEN,
303309
description: str | NotGiven = NOT_GIVEN,
304310
entries: Iterable[custom_update_params.Entry] | NotGiven = NOT_GIVEN,
305311
name: str | NotGiven = NOT_GIVEN,
@@ -321,6 +327,9 @@ async def update(
321327
322328
allowed_match_count: Related DLP policies will trigger when the match count exceeds the number set.
323329
330+
context_awareness: Scan the context of predefined entries to only return matches surrounded by
331+
keywords.
332+
324333
description: The description of the profile.
325334
326335
entries: The custom entries for this profile. Array elements with IDs are modifying the
@@ -349,6 +358,7 @@ async def update(
349358
body=maybe_transform(
350359
{
351360
"allowed_match_count": allowed_match_count,
361+
"context_awareness": context_awareness,
352362
"description": description,
353363
"entries": entries,
354364
"name": name,

src/cloudflare/resources/dlp/profiles/predefineds.py

+10
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def update(
4040
*,
4141
account_id: str,
4242
allowed_match_count: float | NotGiven = NOT_GIVEN,
43+
context_awareness: predefined_update_params.ContextAwareness | NotGiven = NOT_GIVEN,
4344
entries: Iterable[predefined_update_params.Entry] | NotGiven = NOT_GIVEN,
4445
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
4546
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -59,6 +60,9 @@ def update(
5960
6061
allowed_match_count: Related DLP policies will trigger when the match count exceeds the number set.
6162
63+
context_awareness: Scan the context of predefined entries to only return matches surrounded by
64+
keywords.
65+
6266
entries: The entries for this profile.
6367
6468
extra_headers: Send extra headers
@@ -78,6 +82,7 @@ def update(
7882
body=maybe_transform(
7983
{
8084
"allowed_match_count": allowed_match_count,
85+
"context_awareness": context_awareness,
8186
"entries": entries,
8287
},
8388
predefined_update_params.PredefinedUpdateParams,
@@ -148,6 +153,7 @@ async def update(
148153
*,
149154
account_id: str,
150155
allowed_match_count: float | NotGiven = NOT_GIVEN,
156+
context_awareness: predefined_update_params.ContextAwareness | NotGiven = NOT_GIVEN,
151157
entries: Iterable[predefined_update_params.Entry] | NotGiven = NOT_GIVEN,
152158
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
153159
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -167,6 +173,9 @@ async def update(
167173
168174
allowed_match_count: Related DLP policies will trigger when the match count exceeds the number set.
169175
176+
context_awareness: Scan the context of predefined entries to only return matches surrounded by
177+
keywords.
178+
170179
entries: The entries for this profile.
171180
172181
extra_headers: Send extra headers
@@ -186,6 +195,7 @@ async def update(
186195
body=maybe_transform(
187196
{
188197
"allowed_match_count": allowed_match_count,
198+
"context_awareness": context_awareness,
189199
"entries": entries,
190200
},
191201
predefined_update_params.PredefinedUpdateParams,

src/cloudflare/types/dlp/profile_get_response.py

+48
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,35 @@
99
__all__ = [
1010
"ProfileGetResponse",
1111
"DLPPredefinedProfile",
12+
"DLPPredefinedProfileContextAwareness",
13+
"DLPPredefinedProfileContextAwarenessSkip",
1214
"DLPPredefinedProfileEntry",
1315
"DLPCustomProfile",
16+
"DLPCustomProfileContextAwareness",
17+
"DLPCustomProfileContextAwarenessSkip",
1418
"DLPCustomProfileEntry",
1519
"DLPCustomProfileEntryPattern",
1620
"DLPIntegrationProfile",
1721
"DLPIntegrationProfileEntry",
1822
]
1923

2024

25+
class DLPPredefinedProfileContextAwarenessSkip(BaseModel):
26+
files: bool
27+
"""If the content type is a file, skip context analysis and return all matches."""
28+
29+
30+
class DLPPredefinedProfileContextAwareness(BaseModel):
31+
enabled: bool
32+
"""
33+
If true, scan the context of predefined entries to only return matches
34+
surrounded by keywords.
35+
"""
36+
37+
skip: DLPPredefinedProfileContextAwarenessSkip
38+
"""Content types to exclude from context analysis and return all matches."""
39+
40+
2141
class DLPPredefinedProfileEntry(BaseModel):
2242
id: Optional[str] = None
2343
"""The ID for this entry"""
@@ -39,6 +59,12 @@ class DLPPredefinedProfile(BaseModel):
3959
allowed_match_count: Optional[float] = None
4060
"""Related DLP policies will trigger when the match count exceeds the number set."""
4161

62+
context_awareness: Optional[DLPPredefinedProfileContextAwareness] = None
63+
"""
64+
Scan the context of predefined entries to only return matches surrounded by
65+
keywords.
66+
"""
67+
4268
entries: Optional[List[DLPPredefinedProfileEntry]] = None
4369
"""The entries for this profile."""
4470

@@ -49,6 +75,22 @@ class DLPPredefinedProfile(BaseModel):
4975
"""The type of the profile."""
5076

5177

78+
class DLPCustomProfileContextAwarenessSkip(BaseModel):
79+
files: bool
80+
"""If the content type is a file, skip context analysis and return all matches."""
81+
82+
83+
class DLPCustomProfileContextAwareness(BaseModel):
84+
enabled: bool
85+
"""
86+
If true, scan the context of predefined entries to only return matches
87+
surrounded by keywords.
88+
"""
89+
90+
skip: DLPCustomProfileContextAwarenessSkip
91+
"""Content types to exclude from context analysis and return all matches."""
92+
93+
5294
class DLPCustomProfileEntryPattern(BaseModel):
5395
regex: str
5496
"""The regex pattern."""
@@ -89,6 +131,12 @@ class DLPCustomProfile(BaseModel):
89131
allowed_match_count: Optional[float] = None
90132
"""Related DLP policies will trigger when the match count exceeds the number set."""
91133

134+
context_awareness: Optional[DLPCustomProfileContextAwareness] = None
135+
"""
136+
Scan the context of predefined entries to only return matches surrounded by
137+
keywords.
138+
"""
139+
92140
created_at: Optional[datetime] = None
93141

94142
description: Optional[str] = None

src/cloudflare/types/dlp/profile_list_response.py

+48
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,35 @@
1010
"ProfileListResponse",
1111
"ProfileListResponseItem",
1212
"ProfileListResponseItemDLPPredefinedProfile",
13+
"ProfileListResponseItemDLPPredefinedProfileContextAwareness",
14+
"ProfileListResponseItemDLPPredefinedProfileContextAwarenessSkip",
1315
"ProfileListResponseItemDLPPredefinedProfileEntry",
1416
"ProfileListResponseItemDLPCustomProfile",
17+
"ProfileListResponseItemDLPCustomProfileContextAwareness",
18+
"ProfileListResponseItemDLPCustomProfileContextAwarenessSkip",
1519
"ProfileListResponseItemDLPCustomProfileEntry",
1620
"ProfileListResponseItemDLPCustomProfileEntryPattern",
1721
"ProfileListResponseItemDLPIntegrationProfile",
1822
"ProfileListResponseItemDLPIntegrationProfileEntry",
1923
]
2024

2125

26+
class ProfileListResponseItemDLPPredefinedProfileContextAwarenessSkip(BaseModel):
27+
files: bool
28+
"""If the content type is a file, skip context analysis and return all matches."""
29+
30+
31+
class ProfileListResponseItemDLPPredefinedProfileContextAwareness(BaseModel):
32+
enabled: bool
33+
"""
34+
If true, scan the context of predefined entries to only return matches
35+
surrounded by keywords.
36+
"""
37+
38+
skip: ProfileListResponseItemDLPPredefinedProfileContextAwarenessSkip
39+
"""Content types to exclude from context analysis and return all matches."""
40+
41+
2242
class ProfileListResponseItemDLPPredefinedProfileEntry(BaseModel):
2343
id: Optional[str] = None
2444
"""The ID for this entry"""
@@ -40,6 +60,12 @@ class ProfileListResponseItemDLPPredefinedProfile(BaseModel):
4060
allowed_match_count: Optional[float] = None
4161
"""Related DLP policies will trigger when the match count exceeds the number set."""
4262

63+
context_awareness: Optional[ProfileListResponseItemDLPPredefinedProfileContextAwareness] = None
64+
"""
65+
Scan the context of predefined entries to only return matches surrounded by
66+
keywords.
67+
"""
68+
4369
entries: Optional[List[ProfileListResponseItemDLPPredefinedProfileEntry]] = None
4470
"""The entries for this profile."""
4571

@@ -50,6 +76,22 @@ class ProfileListResponseItemDLPPredefinedProfile(BaseModel):
5076
"""The type of the profile."""
5177

5278

79+
class ProfileListResponseItemDLPCustomProfileContextAwarenessSkip(BaseModel):
80+
files: bool
81+
"""If the content type is a file, skip context analysis and return all matches."""
82+
83+
84+
class ProfileListResponseItemDLPCustomProfileContextAwareness(BaseModel):
85+
enabled: bool
86+
"""
87+
If true, scan the context of predefined entries to only return matches
88+
surrounded by keywords.
89+
"""
90+
91+
skip: ProfileListResponseItemDLPCustomProfileContextAwarenessSkip
92+
"""Content types to exclude from context analysis and return all matches."""
93+
94+
5395
class ProfileListResponseItemDLPCustomProfileEntryPattern(BaseModel):
5496
regex: str
5597
"""The regex pattern."""
@@ -90,6 +132,12 @@ class ProfileListResponseItemDLPCustomProfile(BaseModel):
90132
allowed_match_count: Optional[float] = None
91133
"""Related DLP policies will trigger when the match count exceeds the number set."""
92134

135+
context_awareness: Optional[ProfileListResponseItemDLPCustomProfileContextAwareness] = None
136+
"""
137+
Scan the context of predefined entries to only return matches surrounded by
138+
keywords.
139+
"""
140+
93141
created_at: Optional[datetime] = None
94142

95143
description: Optional[str] = None

src/cloudflare/types/dlp/profiles/custom_create_params.py

+30-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
from typing import Iterable
66
from typing_extensions import Literal, Required, TypedDict
77

8-
__all__ = ["CustomCreateParams", "Profile", "ProfileEntry", "ProfileEntryPattern"]
8+
__all__ = [
9+
"CustomCreateParams",
10+
"Profile",
11+
"ProfileContextAwareness",
12+
"ProfileContextAwarenessSkip",
13+
"ProfileEntry",
14+
"ProfileEntryPattern",
15+
]
916

1017

1118
class CustomCreateParams(TypedDict, total=False):
@@ -15,6 +22,22 @@ class CustomCreateParams(TypedDict, total=False):
1522
profiles: Required[Iterable[Profile]]
1623

1724

25+
class ProfileContextAwarenessSkip(TypedDict, total=False):
26+
files: Required[bool]
27+
"""If the content type is a file, skip context analysis and return all matches."""
28+
29+
30+
class ProfileContextAwareness(TypedDict, total=False):
31+
enabled: Required[bool]
32+
"""
33+
If true, scan the context of predefined entries to only return matches
34+
surrounded by keywords.
35+
"""
36+
37+
skip: Required[ProfileContextAwarenessSkip]
38+
"""Content types to exclude from context analysis and return all matches."""
39+
40+
1841
class ProfileEntryPattern(TypedDict, total=False):
1942
regex: Required[str]
2043
"""The regex pattern."""
@@ -42,6 +65,12 @@ class Profile(TypedDict, total=False):
4265
allowed_match_count: float
4366
"""Related DLP policies will trigger when the match count exceeds the number set."""
4467

68+
context_awareness: ProfileContextAwareness
69+
"""
70+
Scan the context of predefined entries to only return matches surrounded by
71+
keywords.
72+
"""
73+
4574
description: str
4675
"""The description of the profile."""
4776

src/cloudflare/types/dlp/profiles/custom_create_response.py

+24
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,29 @@
99
__all__ = [
1010
"CustomCreateResponse",
1111
"CustomCreateResponseItem",
12+
"CustomCreateResponseItemContextAwareness",
13+
"CustomCreateResponseItemContextAwarenessSkip",
1214
"CustomCreateResponseItemEntry",
1315
"CustomCreateResponseItemEntryPattern",
1416
]
1517

1618

19+
class CustomCreateResponseItemContextAwarenessSkip(BaseModel):
20+
files: bool
21+
"""If the content type is a file, skip context analysis and return all matches."""
22+
23+
24+
class CustomCreateResponseItemContextAwareness(BaseModel):
25+
enabled: bool
26+
"""
27+
If true, scan the context of predefined entries to only return matches
28+
surrounded by keywords.
29+
"""
30+
31+
skip: CustomCreateResponseItemContextAwarenessSkip
32+
"""Content types to exclude from context analysis and return all matches."""
33+
34+
1735
class CustomCreateResponseItemEntryPattern(BaseModel):
1836
regex: str
1937
"""The regex pattern."""
@@ -54,6 +72,12 @@ class CustomCreateResponseItem(BaseModel):
5472
allowed_match_count: Optional[float] = None
5573
"""Related DLP policies will trigger when the match count exceeds the number set."""
5674

75+
context_awareness: Optional[CustomCreateResponseItemContextAwareness] = None
76+
"""
77+
Scan the context of predefined entries to only return matches surrounded by
78+
keywords.
79+
"""
80+
5781
created_at: Optional[datetime] = None
5882

5983
description: Optional[str] = None

0 commit comments

Comments
 (0)