Skip to content

Commit abbdc97

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2172)
1 parent 64c23aa commit abbdc97

File tree

5 files changed

+161
-175
lines changed

5 files changed

+161
-175
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1411
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-abf69a668c7dab9a3df64163923844904c7a1d9ac8de45e307c81351b67f0647.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a1a57b5b676213c0eb62ea8a198e8da32d1267439c663261038508ed71c42440.yml

src/cloudflare/types/zero_trust/dlp/profile.py

Lines changed: 71 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,42 @@
22

33
from typing import List, Union, Optional
44
from datetime import datetime
5-
from typing_extensions import Literal, Annotated, TypeAlias
5+
from typing_extensions import Literal, TypeAlias
66

7-
from ...._utils import PropertyInfo
87
from ...._models import BaseModel
98
from .profiles.pattern import Pattern
109
from .context_awareness import ContextAwareness
1110

1211
__all__ = [
1312
"Profile",
14-
"Custom",
15-
"CustomEntry",
16-
"CustomEntryCustom",
17-
"CustomEntryPredefined",
18-
"CustomEntryPredefinedConfidence",
19-
"CustomEntryIntegration",
20-
"CustomEntryExactData",
21-
"CustomEntryWordList",
22-
"Predefined",
23-
"PredefinedEntry",
24-
"PredefinedEntryCustom",
25-
"PredefinedEntryPredefined",
26-
"PredefinedEntryPredefinedConfidence",
27-
"PredefinedEntryIntegration",
28-
"PredefinedEntryExactData",
29-
"PredefinedEntryWordList",
30-
"Integration",
31-
"IntegrationEntry",
32-
"IntegrationEntryCustom",
33-
"IntegrationEntryPredefined",
34-
"IntegrationEntryPredefinedConfidence",
35-
"IntegrationEntryIntegration",
36-
"IntegrationEntryExactData",
37-
"IntegrationEntryWordList",
13+
"CustomProfile",
14+
"CustomProfileEntry",
15+
"CustomProfileEntryCustomEntry",
16+
"CustomProfileEntryPredefinedEntry",
17+
"CustomProfileEntryPredefinedEntryConfidence",
18+
"CustomProfileEntryIntegrationEntry",
19+
"CustomProfileEntryExactDataEntry",
20+
"CustomProfileEntryWordListEntry",
21+
"PredefinedProfile",
22+
"PredefinedProfileEntry",
23+
"PredefinedProfileEntryCustomEntry",
24+
"PredefinedProfileEntryPredefinedEntry",
25+
"PredefinedProfileEntryPredefinedEntryConfidence",
26+
"PredefinedProfileEntryIntegrationEntry",
27+
"PredefinedProfileEntryExactDataEntry",
28+
"PredefinedProfileEntryWordListEntry",
29+
"IntegrationProfile",
30+
"IntegrationProfileEntry",
31+
"IntegrationProfileEntryCustomEntry",
32+
"IntegrationProfileEntryPredefinedEntry",
33+
"IntegrationProfileEntryPredefinedEntryConfidence",
34+
"IntegrationProfileEntryIntegrationEntry",
35+
"IntegrationProfileEntryExactDataEntry",
36+
"IntegrationProfileEntryWordListEntry",
3837
]
3938

4039

41-
class CustomEntryCustom(BaseModel):
40+
class CustomProfileEntryCustomEntry(BaseModel):
4241
id: str
4342

4443
created_at: datetime
@@ -56,7 +55,7 @@ class CustomEntryCustom(BaseModel):
5655
profile_id: Optional[str] = None
5756

5857

59-
class CustomEntryPredefinedConfidence(BaseModel):
58+
class CustomProfileEntryPredefinedEntryConfidence(BaseModel):
6059
available: bool
6160
"""
6261
Indicates whether this entry can be made more or less sensitive by setting a
@@ -65,10 +64,10 @@ class CustomEntryPredefinedConfidence(BaseModel):
6564
"""
6665

6766

68-
class CustomEntryPredefined(BaseModel):
67+
class CustomProfileEntryPredefinedEntry(BaseModel):
6968
id: str
7069

71-
confidence: CustomEntryPredefinedConfidence
70+
confidence: CustomProfileEntryPredefinedEntryConfidence
7271

7372
enabled: bool
7473

@@ -79,7 +78,7 @@ class CustomEntryPredefined(BaseModel):
7978
profile_id: Optional[str] = None
8079

8180

82-
class CustomEntryIntegration(BaseModel):
81+
class CustomProfileEntryIntegrationEntry(BaseModel):
8382
id: str
8483

8584
created_at: datetime
@@ -95,7 +94,7 @@ class CustomEntryIntegration(BaseModel):
9594
profile_id: Optional[str] = None
9695

9796

98-
class CustomEntryExactData(BaseModel):
97+
class CustomProfileEntryExactDataEntry(BaseModel):
9998
id: str
10099

101100
created_at: datetime
@@ -111,7 +110,7 @@ class CustomEntryExactData(BaseModel):
111110
updated_at: datetime
112111

113112

114-
class CustomEntryWordList(BaseModel):
113+
class CustomProfileEntryWordListEntry(BaseModel):
115114
id: str
116115

117116
created_at: datetime
@@ -129,13 +128,16 @@ class CustomEntryWordList(BaseModel):
129128
profile_id: Optional[str] = None
130129

131130

132-
CustomEntry: TypeAlias = Annotated[
133-
Union[CustomEntryCustom, CustomEntryPredefined, CustomEntryIntegration, CustomEntryExactData, CustomEntryWordList],
134-
PropertyInfo(discriminator="type"),
131+
CustomProfileEntry: TypeAlias = Union[
132+
CustomProfileEntryCustomEntry,
133+
CustomProfileEntryPredefinedEntry,
134+
CustomProfileEntryIntegrationEntry,
135+
CustomProfileEntryExactDataEntry,
136+
CustomProfileEntryWordListEntry,
135137
]
136138

137139

138-
class Custom(BaseModel):
140+
class CustomProfile(BaseModel):
139141
id: str
140142
"""The id of the profile (uuid)"""
141143

@@ -151,7 +153,7 @@ class Custom(BaseModel):
151153
created_at: datetime
152154
"""When the profile was created"""
153155

154-
entries: List[CustomEntry]
156+
entries: List[CustomProfileEntry]
155157

156158
name: str
157159
"""The name of the profile"""
@@ -169,7 +171,7 @@ class Custom(BaseModel):
169171
"""The description of the profile"""
170172

171173

172-
class PredefinedEntryCustom(BaseModel):
174+
class PredefinedProfileEntryCustomEntry(BaseModel):
173175
id: str
174176

175177
created_at: datetime
@@ -187,7 +189,7 @@ class PredefinedEntryCustom(BaseModel):
187189
profile_id: Optional[str] = None
188190

189191

190-
class PredefinedEntryPredefinedConfidence(BaseModel):
192+
class PredefinedProfileEntryPredefinedEntryConfidence(BaseModel):
191193
available: bool
192194
"""
193195
Indicates whether this entry can be made more or less sensitive by setting a
@@ -196,10 +198,10 @@ class PredefinedEntryPredefinedConfidence(BaseModel):
196198
"""
197199

198200

199-
class PredefinedEntryPredefined(BaseModel):
201+
class PredefinedProfileEntryPredefinedEntry(BaseModel):
200202
id: str
201203

202-
confidence: PredefinedEntryPredefinedConfidence
204+
confidence: PredefinedProfileEntryPredefinedEntryConfidence
203205

204206
enabled: bool
205207

@@ -210,7 +212,7 @@ class PredefinedEntryPredefined(BaseModel):
210212
profile_id: Optional[str] = None
211213

212214

213-
class PredefinedEntryIntegration(BaseModel):
215+
class PredefinedProfileEntryIntegrationEntry(BaseModel):
214216
id: str
215217

216218
created_at: datetime
@@ -226,7 +228,7 @@ class PredefinedEntryIntegration(BaseModel):
226228
profile_id: Optional[str] = None
227229

228230

229-
class PredefinedEntryExactData(BaseModel):
231+
class PredefinedProfileEntryExactDataEntry(BaseModel):
230232
id: str
231233

232234
created_at: datetime
@@ -242,7 +244,7 @@ class PredefinedEntryExactData(BaseModel):
242244
updated_at: datetime
243245

244246

245-
class PredefinedEntryWordList(BaseModel):
247+
class PredefinedProfileEntryWordListEntry(BaseModel):
246248
id: str
247249

248250
created_at: datetime
@@ -260,25 +262,22 @@ class PredefinedEntryWordList(BaseModel):
260262
profile_id: Optional[str] = None
261263

262264

263-
PredefinedEntry: TypeAlias = Annotated[
264-
Union[
265-
PredefinedEntryCustom,
266-
PredefinedEntryPredefined,
267-
PredefinedEntryIntegration,
268-
PredefinedEntryExactData,
269-
PredefinedEntryWordList,
270-
],
271-
PropertyInfo(discriminator="type"),
265+
PredefinedProfileEntry: TypeAlias = Union[
266+
PredefinedProfileEntryCustomEntry,
267+
PredefinedProfileEntryPredefinedEntry,
268+
PredefinedProfileEntryIntegrationEntry,
269+
PredefinedProfileEntryExactDataEntry,
270+
PredefinedProfileEntryWordListEntry,
272271
]
273272

274273

275-
class Predefined(BaseModel):
274+
class PredefinedProfile(BaseModel):
276275
id: str
277276
"""The id of the predefined profile (uuid)"""
278277

279278
allowed_match_count: int
280279

281-
entries: List[PredefinedEntry]
280+
entries: List[PredefinedProfileEntry]
282281

283282
name: str
284283
"""The name of the predefined profile"""
@@ -299,7 +298,7 @@ class Predefined(BaseModel):
299298
"""Whether this profile can be accessed by anyone"""
300299

301300

302-
class IntegrationEntryCustom(BaseModel):
301+
class IntegrationProfileEntryCustomEntry(BaseModel):
303302
id: str
304303

305304
created_at: datetime
@@ -317,7 +316,7 @@ class IntegrationEntryCustom(BaseModel):
317316
profile_id: Optional[str] = None
318317

319318

320-
class IntegrationEntryPredefinedConfidence(BaseModel):
319+
class IntegrationProfileEntryPredefinedEntryConfidence(BaseModel):
321320
available: bool
322321
"""
323322
Indicates whether this entry can be made more or less sensitive by setting a
@@ -326,10 +325,10 @@ class IntegrationEntryPredefinedConfidence(BaseModel):
326325
"""
327326

328327

329-
class IntegrationEntryPredefined(BaseModel):
328+
class IntegrationProfileEntryPredefinedEntry(BaseModel):
330329
id: str
331330

332-
confidence: IntegrationEntryPredefinedConfidence
331+
confidence: IntegrationProfileEntryPredefinedEntryConfidence
333332

334333
enabled: bool
335334

@@ -340,7 +339,7 @@ class IntegrationEntryPredefined(BaseModel):
340339
profile_id: Optional[str] = None
341340

342341

343-
class IntegrationEntryIntegration(BaseModel):
342+
class IntegrationProfileEntryIntegrationEntry(BaseModel):
344343
id: str
345344

346345
created_at: datetime
@@ -356,7 +355,7 @@ class IntegrationEntryIntegration(BaseModel):
356355
profile_id: Optional[str] = None
357356

358357

359-
class IntegrationEntryExactData(BaseModel):
358+
class IntegrationProfileEntryExactDataEntry(BaseModel):
360359
id: str
361360

362361
created_at: datetime
@@ -372,7 +371,7 @@ class IntegrationEntryExactData(BaseModel):
372371
updated_at: datetime
373372

374373

375-
class IntegrationEntryWordList(BaseModel):
374+
class IntegrationProfileEntryWordListEntry(BaseModel):
376375
id: str
377376

378377
created_at: datetime
@@ -390,24 +389,21 @@ class IntegrationEntryWordList(BaseModel):
390389
profile_id: Optional[str] = None
391390

392391

393-
IntegrationEntry: TypeAlias = Annotated[
394-
Union[
395-
IntegrationEntryCustom,
396-
IntegrationEntryPredefined,
397-
IntegrationEntryIntegration,
398-
IntegrationEntryExactData,
399-
IntegrationEntryWordList,
400-
],
401-
PropertyInfo(discriminator="type"),
392+
IntegrationProfileEntry: TypeAlias = Union[
393+
IntegrationProfileEntryCustomEntry,
394+
IntegrationProfileEntryPredefinedEntry,
395+
IntegrationProfileEntryIntegrationEntry,
396+
IntegrationProfileEntryExactDataEntry,
397+
IntegrationProfileEntryWordListEntry,
402398
]
403399

404400

405-
class Integration(BaseModel):
401+
class IntegrationProfile(BaseModel):
406402
id: str
407403

408404
created_at: datetime
409405

410-
entries: List[IntegrationEntry]
406+
entries: List[IntegrationProfileEntry]
411407

412408
name: str
413409

@@ -419,4 +415,4 @@ class Integration(BaseModel):
419415
"""The description of the profile"""
420416

421417

422-
Profile: TypeAlias = Annotated[Union[Custom, Predefined, Integration], PropertyInfo(discriminator="type")]
418+
Profile: TypeAlias = Union[CustomProfile, PredefinedProfile, IntegrationProfile]

0 commit comments

Comments
 (0)