Coretex
coretex.entities.project.base.BaseObject Class Reference
Inheritance diagram for coretex.entities.project.base.BaseObject:
coretex.entities.project.project.Project coretex.entities.project.task.Task

Public Member Functions

bool rename (self, str name)
 
bool updateDescription (self, str description)
 

Detailed Description

    Represents the base class for Project/Task objects from Coretex.ai

    Properties
    ----------
    name : str
        name of object
    description : Optional[str]
        description of object
    createdOn : datetime
        date of creation of object
    createdById : str
        id of user that created object
    projectType : ProjectType
        project type of created object

Definition at line 27 of file base.py.

Member Function Documentation

◆ rename()

bool coretex.entities.project.base.BaseObject.rename (   self,
str  name 
)
    Renames the Project/Task

    Parameters
    ----------
    name : str
        new name

    Returns
    -------
    bool -> True if Project/Task was renamed, False if Project/Task was not renamed

Definition at line 63 of file base.py.

63  def rename(self, name: str) -> bool:
64  """
65  Renames the Project/Task
66 
67  Parameters
68  ----------
69  name : str
70  new name
71 
72  Returns
73  -------
74  bool -> True if Project/Task was renamed, False if Project/Task was not renamed
75  """
76 
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")
79 
80  if self.name == name:
81  return False
82 
83  success = self.update(name = name)
84 
85  if success:
86  self.name = name
87 
88  return success
89 

◆ updateDescription()

bool coretex.entities.project.base.BaseObject.updateDescription (   self,
str  description 
)
    Updates the Project/Task's description

    Parameters
    ----------
    description : str
        new description

    Returns
        bool -> True if Project/Task's description was updated,
        False if Project/Task's description was not updated

Definition at line 90 of file base.py.

90  def updateDescription(self, description: str) -> bool:
91  """
92  Updates the Project/Task's description
93 
94  Parameters
95  ----------
96  description : str
97  new description
98 
99  Returns
100  bool -> True if Project/Task's description was updated,
101  False if Project/Task's description was not updated
102  """
103 
104  if self.description == description:
105  return False
106 
107  success = self.update(description = description)
108  if success:
109  self.description = description
110 
111  return success

The documentation for this class was generated from the following file: