18 from typing
import Optional, Dict
19 from datetime
import datetime
21 from .project_type
import ProjectType
22 from ..utils
import isEntityNameValid
23 from ...codable
import KeyDescriptor
24 from ...networking
import NetworkObject
30 Represents the base class for Project/Task objects from Coretex.ai
36 description : Optional[str]
39 date of creation of object
41 id of user that created object
42 projectType : ProjectType
43 project type of created object
47 description: Optional[str]
50 projectType: ProjectType
53 def _endpoint(cls) -> str:
57 def _keyDescriptors(cls) -> Dict[str, KeyDescriptor]:
58 descriptors = super()._keyDescriptors()
59 descriptors[
"projectType"] =
KeyDescriptor(
"project_task", ProjectType)
65 Renames the Project/Task
74 bool -> True if Project/Task was renamed, False if Project/Task was not renamed
77 if not isEntityNameValid(name):
78 raise ValueError(
">> [Coretex] Object name is invalid. Requirements: alphanumeric characters (\"a-z\", and \"0-9\") and dash (\"-\") with length between 3 to 50")
80 if self.
namename == name:
83 success = self.update(name = name)
92 Updates the Project/Task's description
100 bool -> True if Project/Task's description was updated,
101 False if Project/Task's description was not updated
107 success = self.update(description = description)
bool updateDescription(self, str description)
bool rename(self, str name)