Skip to content

Commit 43e4f93

Browse files
feat: feat: DLP-3878 Switch DLP Predefined Profile endpoints
* feat: DLP-3878 Switch DLP Predefined Profile endpoints The new endpoints contain a new field `enabled_entries` which will be the preferred way to manage entries within a predefined profile. The existing `entries` field will be supported but now be computed optional
1 parent ac247ff commit 43e4f93

File tree

8 files changed

+279
-442
lines changed

8 files changed

+279
-442
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1908
1+
configured_endpoints: 1907
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cc732ca8d1d7f1c11a1ee579060ddfd8f953a3ad94fd5053056b53370129d040.yml
33
openapi_spec_hash: a3e1e833dfe13845abd1e2227993a979
4-
config_hash: 0c4384f215154a287ab7fbe937bf1621
4+
config_hash: 6b8d4cb6cfb2bdcc28988fb6e9769676

api.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6702,10 +6702,9 @@ from cloudflare.types.zero_trust.dlp.profiles import PredefinedProfile
67026702

67036703
Methods:
67046704

6705-
- <code title="post /accounts/{account_id}/dlp/profiles/predefined">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/predefined_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile.py">Optional[Profile]</a></code>
6706-
- <code title="put /accounts/{account_id}/dlp/profiles/predefined/{profile_id}">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">update</a>(profile_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile.py">Optional[Profile]</a></code>
6705+
- <code title="put /accounts/{account_id}/dlp/profiles/predefined/{profile_id}/config">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">update</a>(profile_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py">Optional[PredefinedProfile]</a></code>
67076706
- <code title="delete /accounts/{account_id}/dlp/profiles/predefined/{profile_id}">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">delete</a>(profile_id, \*, account_id) -> object</code>
6708-
- <code title="get /accounts/{account_id}/dlp/profiles/predefined/{profile_id}">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">get</a>(profile_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/profile.py">Optional[Profile]</a></code>
6707+
- <code title="get /accounts/{account_id}/dlp/profiles/predefined/{profile_id}/config">client.zero_trust.dlp.profiles.predefined.<a href="./src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py">get</a>(profile_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py">Optional[PredefinedProfile]</a></code>
67096708

67106709
### Limits
67116710

src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py

Lines changed: 78 additions & 241 deletions
Large diffs are not rendered by default.

src/cloudflare/types/zero_trust/dlp/profiles/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from .pattern import Pattern as Pattern
66
from .pattern_param import PatternParam as PatternParam
7+
from .predefined_profile import PredefinedProfile as PredefinedProfile
78
from .custom_create_params import CustomCreateParams as CustomCreateParams
89
from .custom_update_params import CustomUpdateParams as CustomUpdateParams
9-
from .predefined_create_params import PredefinedCreateParams as PredefinedCreateParams
1010
from .predefined_update_params import PredefinedUpdateParams as PredefinedUpdateParams

src/cloudflare/types/zero_trust/dlp/profiles/predefined_create_params.py

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Union, Optional
4+
from datetime import datetime
5+
from typing_extensions import Literal, TypeAlias
6+
7+
from .pattern import Pattern
8+
from ....._models import BaseModel
9+
10+
__all__ = [
11+
"PredefinedProfile",
12+
"Entry",
13+
"EntryCustomEntry",
14+
"EntryPredefinedEntry",
15+
"EntryPredefinedEntryConfidence",
16+
"EntryPredefinedEntryVariant",
17+
"EntryIntegrationEntry",
18+
"EntryExactDataEntry",
19+
"EntryDocumentFingerprintEntry",
20+
"EntryWordListEntry",
21+
]
22+
23+
24+
class EntryCustomEntry(BaseModel):
25+
id: str
26+
27+
created_at: datetime
28+
29+
enabled: bool
30+
31+
name: str
32+
33+
pattern: Pattern
34+
35+
type: Literal["custom"]
36+
37+
updated_at: datetime
38+
39+
profile_id: Optional[str] = None
40+
41+
42+
class EntryPredefinedEntryConfidence(BaseModel):
43+
ai_context_available: bool
44+
"""Indicates whether this entry has AI remote service validation."""
45+
46+
available: bool
47+
"""
48+
Indicates whether this entry has any form of validation that is not an AI remote
49+
service.
50+
"""
51+
52+
53+
class EntryPredefinedEntryVariant(BaseModel):
54+
topic_type: Literal["Intent", "Content"]
55+
56+
type: Literal["PromptTopic"]
57+
58+
description: Optional[str] = None
59+
60+
61+
class EntryPredefinedEntry(BaseModel):
62+
id: str
63+
64+
confidence: EntryPredefinedEntryConfidence
65+
66+
enabled: bool
67+
68+
name: str
69+
70+
type: Literal["predefined"]
71+
72+
profile_id: Optional[str] = None
73+
74+
variant: Optional[EntryPredefinedEntryVariant] = None
75+
76+
77+
class EntryIntegrationEntry(BaseModel):
78+
id: str
79+
80+
created_at: datetime
81+
82+
enabled: bool
83+
84+
name: str
85+
86+
type: Literal["integration"]
87+
88+
updated_at: datetime
89+
90+
profile_id: Optional[str] = None
91+
92+
93+
class EntryExactDataEntry(BaseModel):
94+
id: str
95+
96+
case_sensitive: bool
97+
"""
98+
Only applies to custom word lists. Determines if the words should be matched in
99+
a case-sensitive manner Cannot be set to false if secret is true
100+
"""
101+
102+
created_at: datetime
103+
104+
enabled: bool
105+
106+
name: str
107+
108+
secret: bool
109+
110+
type: Literal["exact_data"]
111+
112+
updated_at: datetime
113+
114+
115+
class EntryDocumentFingerprintEntry(BaseModel):
116+
id: str
117+
118+
created_at: datetime
119+
120+
enabled: bool
121+
122+
name: str
123+
124+
type: Literal["document_fingerprint"]
125+
126+
updated_at: datetime
127+
128+
129+
class EntryWordListEntry(BaseModel):
130+
id: str
131+
132+
created_at: datetime
133+
134+
enabled: bool
135+
136+
name: str
137+
138+
type: Literal["word_list"]
139+
140+
updated_at: datetime
141+
142+
word_list: object
143+
144+
profile_id: Optional[str] = None
145+
146+
147+
Entry: TypeAlias = Union[
148+
EntryCustomEntry,
149+
EntryPredefinedEntry,
150+
EntryIntegrationEntry,
151+
EntryExactDataEntry,
152+
EntryDocumentFingerprintEntry,
153+
EntryWordListEntry,
154+
]
155+
156+
157+
class PredefinedProfile(BaseModel):
158+
id: str
159+
"""The id of the predefined profile (uuid)."""
160+
161+
allowed_match_count: int
162+
163+
confidence_threshold: Optional[str] = None
164+
165+
enabled_entries: List[str]
166+
167+
entries: List[Entry]
168+
169+
name: str
170+
"""The name of the predefined profile."""
171+
172+
ai_context_enabled: Optional[bool] = None
173+
174+
ocr_enabled: Optional[bool] = None
175+
176+
open_access: Optional[bool] = None
177+
"""Whether this profile can be accessed by anyone."""

src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_params.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Iterable, Optional
66
from typing_extensions import Required, TypedDict
77

8-
from ..context_awareness_param import ContextAwarenessParam
8+
from ....._types import SequenceNotStr
99

1010
__all__ = ["PredefinedUpdateParams", "Entry"]
1111

@@ -19,11 +19,7 @@ class PredefinedUpdateParams(TypedDict, total=False):
1919

2020
confidence_threshold: Optional[str]
2121

22-
context_awareness: ContextAwarenessParam
23-
"""
24-
Scan the context of predefined entries to only return matches surrounded by
25-
keywords.
26-
"""
22+
enabled_entries: Optional[SequenceNotStr[str]]
2723

2824
entries: Iterable[Entry]
2925

0 commit comments

Comments
 (0)