@@ -25,18 +25,47 @@ class CurationExcludeSchema(typing.TypedDict):
2525 id : str
2626
2727
28- class CurationRuleSchema (typing .TypedDict , total = False ):
28+ class CurationRuleTagsSchema (typing .TypedDict ):
2929 """
30- Schema representing rule conditions for a curation item .
30+ Schema for a curation rule using tags .
3131 """
3232
33- query : typing .NotRequired [str ]
34- match : typing .NotRequired [typing .Literal ["exact" , "contains" ]]
35- filter_by : typing .NotRequired [str ]
36- tags : typing .NotRequired [typing .List [str ]]
33+ tags : typing .List [str ]
34+
35+
36+ class CurationRuleQuerySchema (typing .TypedDict ):
37+ """
38+ Schema for a curation rule using query and match.
39+ """
40+
41+ query : str
42+ match : typing .Literal ["exact" , "contains" ]
3743
3844
39- class CurationItemSchema (typing .TypedDict , total = False ):
45+ class CurationRuleFilterBySchema (typing .TypedDict ):
46+ """
47+ Schema for a curation rule using filter_by.
48+ """
49+
50+ filter_by : str
51+
52+
53+ CurationRuleSchema = typing .Union [
54+ CurationRuleTagsSchema ,
55+ CurationRuleQuerySchema ,
56+ CurationRuleFilterBySchema ,
57+ ]
58+ """
59+ Schema representing rule conditions for a curation item.
60+
61+ A curation rule must be exactly one of:
62+ - A tags-based rule: `{ tags: string[] }`
63+ - A query-based rule: `{ query: string; match: "exact" | "contains" }`
64+ - A filter_by-based rule: `{ filter_by: string }`
65+ """
66+
67+
68+ class CurationItemSchema (typing .TypedDict ):
4069 """
4170 Schema for a single curation item (aka CurationObject in the API).
4271 """
@@ -51,7 +80,9 @@ class CurationItemSchema(typing.TypedDict, total=False):
5180 remove_matched_tokens : typing .NotRequired [bool ]
5281 filter_curated_hits : typing .NotRequired [bool ]
5382 stop_processing : typing .NotRequired [bool ]
54- metadata : typing .Dict [str , typing .Any ]
83+ effective_from_ts : typing .NotRequired [int ]
84+ effective_to_ts : typing .NotRequired [int ]
85+ metadata : typing .NotRequired [typing .Dict [str , typing .Any ]]
5586
5687
5788class CurationSetUpsertSchema (typing .TypedDict ):
@@ -62,12 +93,12 @@ class CurationSetUpsertSchema(typing.TypedDict):
6293 items : typing .List [CurationItemSchema ]
6394
6495
65- class CurationSetSchema (CurationSetUpsertSchema ):
96+ class CurationSetSchema (CurationSetUpsertSchema , total = False ):
6697 """
6798 Response schema for a curation set.
6899 """
69100
70- name : str
101+ name : typing . NotRequired [ str ]
71102
72103
73104class CurationSetsListEntrySchema (typing .TypedDict ):
0 commit comments