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

     1  package tdproto
     2  
     3  type (
     4  	TaskFilterKey string
     5  	TaskSortKey   string
     6  	TaskTabKey    string
     7  )
     8  
     9  func (key TaskFilterKey) String() string {
    10  	return string(key)
    11  }
    12  
    13  // Task sort type
    14  type TaskSort struct {
    15  	// Field
    16  	Key TaskSortKey `json:"key"`
    17  
    18  	// Sort title
    19  	Title string `json:"title"`
    20  }
    21  
    22  // Task filter
    23  type TaskFilter struct {
    24  	// Task filter field
    25  	Field TaskFilterKey `json:"field"`
    26  
    27  	// Filter title
    28  	Title string `json:"title"`
    29  }
    30  
    31  // Tasks counters
    32  type TaskCounters struct {
    33  	// Task jid
    34  	Jid JID `json:"jid"`
    35  
    36  	// Unreads counter
    37  	NumUnread uint `json:"num_unread,omitempty"`
    38  
    39  	// Mentions (@) counter
    40  	NumUnreadNotices uint `json:"num_unread_notices,omitempty"`
    41  }
    42  
    43  // Task tab
    44  type TaskTab struct {
    45  	// Tab name
    46  	Key TaskTabKey `json:"key"`
    47  
    48  	// Tab title
    49  	Title string `json:"title"`
    50  
    51  	// Disable this tab when it has no contents
    52  	HideEmpty bool `json:"hide_empty"`
    53  
    54  	// Show unread badge
    55  	ShowCounter bool `json:"show_counter"`
    56  
    57  	// Enable pagination
    58  	Pagination bool `json:"pagination"`
    59  
    60  	// Filters inside tab
    61  	Filters []TaskFilter `json:"filters"`
    62  
    63  	// Sort available in tab
    64  	Sort []TaskSort `json:"sort"`
    65  
    66  	// Unread tasks with jid and counters
    67  	UnreadTasks []TaskCounters `json:"unread_tasks"`
    68  }