File tree Expand file tree Collapse file tree 2 files changed +42
-19
lines changed 
packages/models-library/src/models_library Expand file tree Collapse file tree 2 files changed +42
-19
lines changed   Load Diff This file was deleted. 
Original file line number Diff line number Diff line change @@ -24,13 +24,54 @@ class MetadataFilterItem(BaseModel):
2424
2525
2626class  ListProjectsMarkedAsJobRpcFilter (BaseModel ):
27-     # NOTE: add here any early validation of filters e.g. incompatible filters etc 
27+     """Filter model for the list_projects_marked_as_jobs RPC. 
28+ 
29+     NOTE: Filter models are used to validate all possible filters in an API early on, 
30+     particularly to ensure compatibility and prevent conflicts between different filters. 
31+     """ 
32+ 
2833    job_parent_resource_name_prefix : str  |  None  =  None 
34+ 
2935    any_of_metadata : Annotated [
3036        list [MetadataFilterItem ] |  None ,
3137        Field (description = "Searchs for matches of any of the custom metadata fields" ),
3238    ] =  None 
3339
40+     @staticmethod  
41+     def  _update_json_schema_extra (schema : JsonDict ) ->  None :
42+         schema .update (
43+             {
44+                 "examples" : [
45+                     {
46+                         "job_parent_resource_name_prefix" : "solvers/solver123" ,
47+                         "any_of_metadata" : [
48+                             {
49+                                 "name" : "solver_type" ,
50+                                 "pattern" : "FEM" ,
51+                             },
52+                             {
53+                                 "name" : "mesh_cells" ,
54+                                 "pattern" : "1*" ,
55+                             },
56+                         ],
57+                     },
58+                     {
59+                         "any_of_metadata" : [
60+                             {
61+                                 "name" : "solver_type" ,
62+                                 "pattern" : "*CFD*" ,
63+                             }
64+                         ],
65+                     },
66+                     {"job_parent_resource_name_prefix" : "solvers/solver123" },
67+                 ]
68+             }
69+         )
70+ 
71+     model_config  =  ConfigDict (
72+         json_schema_extra = _update_json_schema_extra ,
73+     )
74+ 
3475
3576class  ProjectJobRpcGet (BaseModel ):
3677    """ 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments