github.com/tada-team/tdproto@v1.51.57/tdapi/task.go (about)

     1  package tdapi
     2  
     3  import "github.com/tada-team/tdproto"
     4  
     5  // Task
     6  type Task struct {
     7  	// Custom task color
     8  	CustomColorIndex *uint16 `json:"custom_color_index,omitempty"`
     9  
    10  	// Task description
    11  	Description string `json:"description,omitempty"`
    12  
    13  	// Task tags
    14  	Tags []string `json:"tags,omitempty"`
    15  
    16  	// Task section UID
    17  	SectionUid string `json:"section,omitempty"`
    18  
    19  	// User who follow the task
    20  	Observers []tdproto.JID `json:"observers,omitempty"` // TODO: rename to "followers"
    21  
    22  	// Items of the task
    23  	Items []string `json:"items,omitempty"`
    24  
    25  	// User who was assigned the task
    26  	Assignee tdproto.JID `json:"assignee,omitempty"`
    27  
    28  	// Deadline time, if any
    29  	Deadline tdproto.ISODateTimeString `json:"deadline,omitempty"`
    30  
    31  	// Is task or group public for non-guests
    32  	Public bool `json:"public,omitempty"`
    33  
    34  	// Fire a reminder at this time
    35  	RemindAt tdproto.ISODateTimeString `json:"remind_at,omitempty"`
    36  
    37  	// Task status
    38  	TaskStatus string `json:"task_status,omitempty"`
    39  
    40  	// Task importance
    41  	Importance *int `json:"importance,omitempty"`
    42  
    43  	// Task urgency
    44  	Urgency *int `json:"urgency,omitempty"`
    45  
    46  	// Task complexity
    47  	Complexity *int `json:"complexity,omitempty"`
    48  
    49  	// Time spent
    50  	SpentTime *int `json:"spent_time,omitempty"`
    51  
    52  	// Linked messages
    53  	LinkedMessages []string `json:"linked_messages,omitempty"` // TODO: Message object
    54  
    55  	// Task uploads
    56  	Uploads []string `json:"uploads,omitempty"`
    57  }
    58  
    59  // Query parameters for listing messages
    60  type TaskFilter struct {
    61  	UserParams
    62  	Paginator
    63  
    64  	//* ?sort = [ "created" | "-created" | "last_message" | "-last_message" | "deadline" | "-deadline" ]
    65  	Sort string `schema:"sort"`
    66  
    67  	//* ?task_status = new,done | new | any
    68  	TaskStatus string `schema:"task_status"`
    69  
    70  	//* ?exclude_task_status = new,done | new | any
    71  	ExcludeTaskStatus string `schema:"exclude_task_status"`
    72  
    73  	//* ?num=num1,num2,num3...
    74  	Num string `schema:"num"`
    75  
    76  	//* ?observer=jid,jid   // TODO: rename to ?follower=
    77  	Observer string `schema:"observer"`
    78  
    79  	//* ?member=jid,jid
    80  	Member string `schema:"member"`
    81  
    82  	//* ?assignee=jid,jid
    83  	Assignee string `schema:"assignee"`
    84  
    85  	//* ?owner=jid,jid
    86  	Owner string `schema:"owner"`
    87  
    88  	//* ?section=[ uid,uid... | "-" ]
    89  	Section string `schema:"section"` // TODO: rename to ?project=
    90  
    91  	//* ?contact_section=[ uid,uid... | "-" ]
    92  	ContactSection string `schema:"contact_section"` // TODO: rename to ?section=
    93  
    94  	//* ?tag=[ tag,tag,tag... | "-" ]
    95  	Tag string `schema:"tag"`
    96  
    97  	//* ?q=
    98  	Q string `schema:"q"`
    99  
   100  	//* ?public=true|false
   101  	Public string `schema:"public"`
   102  
   103  	//* ?deadline_gte=<isodate>
   104  	DeadlineGTE string `schema:"deadline_gte"`
   105  
   106  	//* ?deadline_lte=<isodate>
   107  	DeadlineLTE string `schema:"deadline_lte"`
   108  
   109  	//* ?done_gte=<isodate>
   110  	DoneGTE string `schema:"done_gte"`
   111  
   112  	//* ?done_lte=<isodate>
   113  	DoneLTE string `schema:"done_lte"`
   114  
   115  	//* ?created_gte=<isodate>
   116  	CreatedGTE string `schema:"created_gte"`
   117  
   118  	//* ?created_lte=<isodate>
   119  	CreatedLTE string `schema:"created_lte"`
   120  
   121  	//* ?short=true|false
   122  	Short string `schema:"short"`
   123  
   124  	// gentime great than group/chat
   125  	GentimeGT int64 `schema:"gentime_gt"`
   126  }
   127  
   128  // Task cards colors
   129  type TaskColors struct {
   130  	// Color list
   131  	Colors []tdproto.TaskColor `json:"colors"`
   132  }