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

Public Member Functions

Optional[Self] createTask (cls, str name, int projectId, Optional[str] description=None)
 
- Public Member Functions inherited from coretex.entities.project.base.BaseObject
bool rename (self, str name)
 
bool updateDescription (self, str description)
 

Detailed Description

    Represents the task entity from Coretex.ai\n
    Contains properties that describe the task

Definition at line 26 of file task.py.

Member Function Documentation

◆ createTask()

Optional[Self] coretex.entities.project.task.Task.createTask (   cls,
str  name,
int  projectId,
Optional[str]  description = None 
)
    Creates a new task with the provided name and description
    Task is added to the project with provided project id

    Parameters
    ----------
    name : str
        task name
    projectId : int
        project id the task belongs to
    description : Optional[str]
        task description

    Returns
    -------
    Optional[Self] -> The created task object

    Example
    -------
    >>> from coretex import Task
    \b
    >>> dummyTask = Task.createTask(
            name = "dummyTask",
            projectId = 23,
            description = "This is dummy task"
        )
    >>> if dummyTask is None:
            print("Failed to create task")

Definition at line 44 of file task.py.

44  def createTask(cls, name: str, projectId: int, description: Optional[str]=None) -> Optional[Self]:
45  """
46  Creates a new task with the provided name and description
47  Task is added to the project with provided project id
48 
49  Parameters
50  ----------
51  name : str
52  task name
53  projectId : int
54  project id the task belongs to
55  description : Optional[str]
56  task description
57 
58  Returns
59  -------
60  Optional[Self] -> The created task object
61 
62  Example
63  -------
64  >>> from coretex import Task
65  \b
66  >>> dummyTask = Task.createTask(
67  name = "dummyTask",
68  projectId = 23,
69  description = "This is dummy task"
70  )
71  >>> if dummyTask is None:
72  print("Failed to create task")
73  """
74 
75  if not isEntityNameValid(name):
76  raise ValueError(">> [Coretex] Task name is invalid. Requirements: alphanumeric characters (\"a-z\", and \"0-9\") and dash (\"-\") with length between 3 to 50")
77 
78  return cls.create(
79  name = name,
80  parent_id = projectId,
81  description = description
82  )

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