Skip to content

Commit 3f08a70

Browse files
committed
Enhancement: Tasklist - Add showCompleted filter to list request
Add an optional ShowCompleted *bool filter to TasklistListRequestFilters. When nil (the default), the parameter is omitted and the API's default behavior of excluding completed tasklists is preserved; set it to true to include completed tasklists in the results.
1 parent 15bb1b2 commit 3f08a70

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

projects/tasklist.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@ type TasklistListRequestFilters struct {
399399
// PageSize is the number of tasklists to retrieve per page. Defaults to 50.
400400
PageSize int64
401401

402+
// ShowCompleted indicates whether to include completed tasklists in the
403+
// results. When nil or false, completed tasklists are excluded (the API
404+
// default). Set to true to include them.
405+
ShowCompleted *bool
406+
402407
// Fields restricts the attributes returned for the tasklist and each of its
403408
// sideloads. Each slot of TasklistListFields is a separate
404409
// `fields[entity]=…` selection; populated slots restrict the response, empty
@@ -418,6 +423,9 @@ func (t TasklistListRequestFilters) apply(req *http.Request) {
418423
if t.PageSize > 0 {
419424
query.Set("pageSize", strconv.FormatInt(t.PageSize, 10))
420425
}
426+
if t.ShowCompleted != nil {
427+
query.Set("showCompleted", strconv.FormatBool(*t.ShowCompleted))
428+
}
421429
t.Fields.apply(query)
422430
req.URL.RawQuery = query.Encode()
423431
}

0 commit comments

Comments
 (0)