2
2
3
3
from typing import List , Union , Optional
4
4
from datetime import datetime
5
- from typing_extensions import Literal , Annotated , TypeAlias
5
+ from typing_extensions import Literal , TypeAlias
6
6
7
- from ...._utils import PropertyInfo
8
7
from ...._models import BaseModel
9
8
from .profiles .pattern import Pattern
10
9
from .context_awareness import ContextAwareness
11
10
12
11
__all__ = [
13
12
"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 " ,
38
37
]
39
38
40
39
41
- class CustomEntryCustom (BaseModel ):
40
+ class CustomProfileEntryCustomEntry (BaseModel ):
42
41
id : str
43
42
44
43
created_at : datetime
@@ -56,7 +55,7 @@ class CustomEntryCustom(BaseModel):
56
55
profile_id : Optional [str ] = None
57
56
58
57
59
- class CustomEntryPredefinedConfidence (BaseModel ):
58
+ class CustomProfileEntryPredefinedEntryConfidence (BaseModel ):
60
59
available : bool
61
60
"""
62
61
Indicates whether this entry can be made more or less sensitive by setting a
@@ -65,10 +64,10 @@ class CustomEntryPredefinedConfidence(BaseModel):
65
64
"""
66
65
67
66
68
- class CustomEntryPredefined (BaseModel ):
67
+ class CustomProfileEntryPredefinedEntry (BaseModel ):
69
68
id : str
70
69
71
- confidence : CustomEntryPredefinedConfidence
70
+ confidence : CustomProfileEntryPredefinedEntryConfidence
72
71
73
72
enabled : bool
74
73
@@ -79,7 +78,7 @@ class CustomEntryPredefined(BaseModel):
79
78
profile_id : Optional [str ] = None
80
79
81
80
82
- class CustomEntryIntegration (BaseModel ):
81
+ class CustomProfileEntryIntegrationEntry (BaseModel ):
83
82
id : str
84
83
85
84
created_at : datetime
@@ -95,7 +94,7 @@ class CustomEntryIntegration(BaseModel):
95
94
profile_id : Optional [str ] = None
96
95
97
96
98
- class CustomEntryExactData (BaseModel ):
97
+ class CustomProfileEntryExactDataEntry (BaseModel ):
99
98
id : str
100
99
101
100
created_at : datetime
@@ -111,7 +110,7 @@ class CustomEntryExactData(BaseModel):
111
110
updated_at : datetime
112
111
113
112
114
- class CustomEntryWordList (BaseModel ):
113
+ class CustomProfileEntryWordListEntry (BaseModel ):
115
114
id : str
116
115
117
116
created_at : datetime
@@ -129,13 +128,16 @@ class CustomEntryWordList(BaseModel):
129
128
profile_id : Optional [str ] = None
130
129
131
130
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 ,
135
137
]
136
138
137
139
138
- class Custom (BaseModel ):
140
+ class CustomProfile (BaseModel ):
139
141
id : str
140
142
"""The id of the profile (uuid)"""
141
143
@@ -151,7 +153,7 @@ class Custom(BaseModel):
151
153
created_at : datetime
152
154
"""When the profile was created"""
153
155
154
- entries : List [CustomEntry ]
156
+ entries : List [CustomProfileEntry ]
155
157
156
158
name : str
157
159
"""The name of the profile"""
@@ -169,7 +171,7 @@ class Custom(BaseModel):
169
171
"""The description of the profile"""
170
172
171
173
172
- class PredefinedEntryCustom (BaseModel ):
174
+ class PredefinedProfileEntryCustomEntry (BaseModel ):
173
175
id : str
174
176
175
177
created_at : datetime
@@ -187,7 +189,7 @@ class PredefinedEntryCustom(BaseModel):
187
189
profile_id : Optional [str ] = None
188
190
189
191
190
- class PredefinedEntryPredefinedConfidence (BaseModel ):
192
+ class PredefinedProfileEntryPredefinedEntryConfidence (BaseModel ):
191
193
available : bool
192
194
"""
193
195
Indicates whether this entry can be made more or less sensitive by setting a
@@ -196,10 +198,10 @@ class PredefinedEntryPredefinedConfidence(BaseModel):
196
198
"""
197
199
198
200
199
- class PredefinedEntryPredefined (BaseModel ):
201
+ class PredefinedProfileEntryPredefinedEntry (BaseModel ):
200
202
id : str
201
203
202
- confidence : PredefinedEntryPredefinedConfidence
204
+ confidence : PredefinedProfileEntryPredefinedEntryConfidence
203
205
204
206
enabled : bool
205
207
@@ -210,7 +212,7 @@ class PredefinedEntryPredefined(BaseModel):
210
212
profile_id : Optional [str ] = None
211
213
212
214
213
- class PredefinedEntryIntegration (BaseModel ):
215
+ class PredefinedProfileEntryIntegrationEntry (BaseModel ):
214
216
id : str
215
217
216
218
created_at : datetime
@@ -226,7 +228,7 @@ class PredefinedEntryIntegration(BaseModel):
226
228
profile_id : Optional [str ] = None
227
229
228
230
229
- class PredefinedEntryExactData (BaseModel ):
231
+ class PredefinedProfileEntryExactDataEntry (BaseModel ):
230
232
id : str
231
233
232
234
created_at : datetime
@@ -242,7 +244,7 @@ class PredefinedEntryExactData(BaseModel):
242
244
updated_at : datetime
243
245
244
246
245
- class PredefinedEntryWordList (BaseModel ):
247
+ class PredefinedProfileEntryWordListEntry (BaseModel ):
246
248
id : str
247
249
248
250
created_at : datetime
@@ -260,25 +262,22 @@ class PredefinedEntryWordList(BaseModel):
260
262
profile_id : Optional [str ] = None
261
263
262
264
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 ,
272
271
]
273
272
274
273
275
- class Predefined (BaseModel ):
274
+ class PredefinedProfile (BaseModel ):
276
275
id : str
277
276
"""The id of the predefined profile (uuid)"""
278
277
279
278
allowed_match_count : int
280
279
281
- entries : List [PredefinedEntry ]
280
+ entries : List [PredefinedProfileEntry ]
282
281
283
282
name : str
284
283
"""The name of the predefined profile"""
@@ -299,7 +298,7 @@ class Predefined(BaseModel):
299
298
"""Whether this profile can be accessed by anyone"""
300
299
301
300
302
- class IntegrationEntryCustom (BaseModel ):
301
+ class IntegrationProfileEntryCustomEntry (BaseModel ):
303
302
id : str
304
303
305
304
created_at : datetime
@@ -317,7 +316,7 @@ class IntegrationEntryCustom(BaseModel):
317
316
profile_id : Optional [str ] = None
318
317
319
318
320
- class IntegrationEntryPredefinedConfidence (BaseModel ):
319
+ class IntegrationProfileEntryPredefinedEntryConfidence (BaseModel ):
321
320
available : bool
322
321
"""
323
322
Indicates whether this entry can be made more or less sensitive by setting a
@@ -326,10 +325,10 @@ class IntegrationEntryPredefinedConfidence(BaseModel):
326
325
"""
327
326
328
327
329
- class IntegrationEntryPredefined (BaseModel ):
328
+ class IntegrationProfileEntryPredefinedEntry (BaseModel ):
330
329
id : str
331
330
332
- confidence : IntegrationEntryPredefinedConfidence
331
+ confidence : IntegrationProfileEntryPredefinedEntryConfidence
333
332
334
333
enabled : bool
335
334
@@ -340,7 +339,7 @@ class IntegrationEntryPredefined(BaseModel):
340
339
profile_id : Optional [str ] = None
341
340
342
341
343
- class IntegrationEntryIntegration (BaseModel ):
342
+ class IntegrationProfileEntryIntegrationEntry (BaseModel ):
344
343
id : str
345
344
346
345
created_at : datetime
@@ -356,7 +355,7 @@ class IntegrationEntryIntegration(BaseModel):
356
355
profile_id : Optional [str ] = None
357
356
358
357
359
- class IntegrationEntryExactData (BaseModel ):
358
+ class IntegrationProfileEntryExactDataEntry (BaseModel ):
360
359
id : str
361
360
362
361
created_at : datetime
@@ -372,7 +371,7 @@ class IntegrationEntryExactData(BaseModel):
372
371
updated_at : datetime
373
372
374
373
375
- class IntegrationEntryWordList (BaseModel ):
374
+ class IntegrationProfileEntryWordListEntry (BaseModel ):
376
375
id : str
377
376
378
377
created_at : datetime
@@ -390,24 +389,21 @@ class IntegrationEntryWordList(BaseModel):
390
389
profile_id : Optional [str ] = None
391
390
392
391
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 ,
402
398
]
403
399
404
400
405
- class Integration (BaseModel ):
401
+ class IntegrationProfile (BaseModel ):
406
402
id : str
407
403
408
404
created_at : datetime
409
405
410
- entries : List [IntegrationEntry ]
406
+ entries : List [IntegrationProfileEntry ]
411
407
412
408
name : str
413
409
@@ -419,4 +415,4 @@ class Integration(BaseModel):
419
415
"""The description of the profile"""
420
416
421
417
422
- Profile : TypeAlias = Annotated [ Union [Custom , Predefined , Integration ], PropertyInfo ( discriminator = "type" ) ]
418
+ Profile : TypeAlias = Union [CustomProfile , PredefinedProfile , IntegrationProfile ]
0 commit comments