@@ -24,6 +24,22 @@ def to_dict(self):
2424 raise NotImplementedError
2525
2626
27+ class BaseTimedEntity (BaseEntity ):
28+ def __init__ (
29+ self , uuid : Any = None , createdAt : str = None , updatedAt : str = None ,
30+ ):
31+ super ().__init__ (uuid )
32+ self .createdAt = createdAt
33+ self .updatedAt = updatedAt
34+
35+ def to_dict (self ):
36+ return {
37+ "id" : self .uuid ,
38+ "createdAt" : self .createdAt ,
39+ "updatedAt" : self .updatedAt ,
40+ }
41+
42+
2743class ConfigEntity (BaseEntity ):
2844 def __init__ (self , uuid : str , value : str ):
2945 super ().__init__ (uuid )
@@ -41,10 +57,12 @@ def to_dict(self):
4157 return {"key" : self .uuid , "value" : self .value }
4258
4359
44- class ProjectEntity (BaseEntity ):
60+ class ProjectEntity (BaseTimedEntity ):
4561 def __init__ (
4662 self ,
4763 uuid : int = None ,
64+ createdAt : str = None ,
65+ updatedAt : str = None ,
4866 team_id : int = None ,
4967 name : str = None ,
5068 project_type : int = None ,
@@ -65,7 +83,7 @@ def __init__(
6583 completed_images_count : int = None ,
6684 root_folder_completed_images_count : int = None ,
6785 ):
68- super ().__init__ (uuid )
86+ super ().__init__ (uuid , createdAt , updatedAt )
6987 self .team_id = team_id
7088 self .name = name
7189 self .project_type = project_type
@@ -100,7 +118,7 @@ def __copy__(self):
100118
101119 def to_dict (self ):
102120 return {
103- "id" : self . uuid ,
121+ ** super (). to_dict () ,
104122 "team_id" : self .team_id ,
105123 "name" : self .name ,
106124 "type" : self .project_type ,
@@ -175,17 +193,19 @@ def to_dict(self):
175193 }
176194
177195
178- class FolderEntity (BaseEntity ):
196+ class FolderEntity (BaseTimedEntity ):
179197 def __init__ (
180198 self ,
181199 uuid : int = None ,
200+ createdAt : str = None ,
201+ updatedAt : str = None ,
182202 project_id : int = None ,
183203 parent_id : int = None ,
184204 team_id : int = None ,
185205 name : str = None ,
186206 folder_users : List [dict ] = None ,
187207 ):
188- super ().__init__ (uuid )
208+ super ().__init__ (uuid , createdAt , updatedAt )
189209 self .team_id = team_id
190210 self .project_id = project_id
191211 self .name = name
@@ -194,6 +214,7 @@ def __init__(
194214
195215 def to_dict (self ):
196216 return {
217+ ** super ().to_dict (),
197218 "id" : self .uuid ,
198219 "team_id" : self .team_id ,
199220 "name" : self .name ,
@@ -301,22 +322,26 @@ def to_dict(self):
301322 return {"uuid" : self .uuid , "bytes" : self .data , "metadata" : self .metadata }
302323
303324
304- class AnnotationClassEntity (BaseEntity ):
325+ class AnnotationClassEntity (BaseTimedEntity ):
305326 def __init__ (
306327 self ,
307328 uuid : int = None ,
329+ createdAt : str = None ,
330+ updatedAt : str = None ,
308331 color : str = None ,
309332 count : int = None ,
310333 name : str = None ,
311334 project_id : int = None ,
312335 attribute_groups : Iterable = None ,
313336 ):
314- super ().__init__ (uuid )
337+ super ().__init__ (uuid , createdAt , updatedAt )
315338 self .color = color
316339 self .count = count
317340 self .name = name
318341 self .project_id = project_id
319342 self .attribute_groups = attribute_groups
343+ self .createdAt = createdAt
344+ self .updatedAt = updatedAt
320345
321346 def __copy__ (self ):
322347 return AnnotationClassEntity (
@@ -328,7 +353,7 @@ def __copy__(self):
328353
329354 def to_dict (self ):
330355 return {
331- "id" : self . uuid ,
356+ ** super (). to_dict () ,
332357 "color" : self .color ,
333358 "count" : self .count ,
334359 "name" : self .name ,
@@ -402,12 +427,14 @@ def to_dict(self):
402427 }
403428
404429
405- class MLModelEntity (BaseEntity ):
430+ class MLModelEntity (BaseTimedEntity ):
406431 def __init__ (
407432 self ,
408433 uuid : int = None ,
409434 team_id : int = None ,
410435 name : str = None ,
436+ createdAt : str = None ,
437+ updatedAt : str = None ,
411438 path : str = None ,
412439 config_path : str = None ,
413440 model_type : int = None ,
@@ -423,7 +450,7 @@ def __init__(
423450 is_global : bool = None ,
424451 hyper_parameters : dict = {},
425452 ):
426- super ().__init__ (uuid = uuid )
453+ super ().__init__ (uuid , createdAt , updatedAt )
427454 self .name = name
428455 self .path = path
429456 self .team_id = team_id
@@ -443,7 +470,7 @@ def __init__(
443470
444471 def to_dict (self ):
445472 return {
446- "id" : self . uuid ,
473+ ** super (). to_dict () ,
447474 "name" : self .name ,
448475 "team_id" : self .team_id ,
449476 "description" : self .description ,
0 commit comments