Skip to content

Commit 176f41b

Browse files
committed
Feature: Links
Allow managing project's links.
1 parent fd79dfb commit 176f41b

5 files changed

Lines changed: 1021 additions & 0 deletions

File tree

projects/comment.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,10 @@ type CommentListRequestPath struct {
568568
// TaskID is the unique identifier of the task whose comments are to be
569569
// retrieved.
570570
TaskID int64
571+
572+
// LinkID is the unique identifier of the link whose comments are to be
573+
// retrieved.
574+
LinkID int64
571575
}
572576

573577
// CommentListRequestFilters contains the filters for loading multiple comments.
@@ -597,6 +601,7 @@ type CommentListRequestFilters struct {
597601
// https://apidocs.teamwork.com/docs/teamwork/v3/milestone-comments/get-projects-api-v3-milestones-milestone-id-comments-json
598602
// https://apidocs.teamwork.com/docs/teamwork/v3/notebook-comments/get-projects-api-v3-notebooks-notebook-id-comments-json
599603
// https://apidocs.teamwork.com/docs/teamwork/v3/task-comments/get-projects-api-v3-tasks-task-id-comments-json
604+
// https://apidocs.teamwork.com/docs/teamwork/v3/link-comments/get-projects-api-v3-links-link-id-comments-json
600605
//
601606
//nolint:lll
602607
type CommentListRequest struct {
@@ -629,6 +634,8 @@ func (t CommentListRequest) HTTPRequest(ctx context.Context, server string) (*ht
629634
uri = fmt.Sprintf("%s/projects/api/v3/notebooks/%d/comments.json", server, t.Path.NotebookID)
630635
case t.Path.TaskID > 0:
631636
uri = fmt.Sprintf("%s/projects/api/v3/tasks/%d/comments.json", server, t.Path.TaskID)
637+
case t.Path.LinkID > 0:
638+
uri = fmt.Sprintf("%s/projects/api/v3/links/%d/comments.json", server, t.Path.LinkID)
632639
default:
633640
uri = server + "/projects/api/v3/comments.json"
634641
}
@@ -670,6 +677,7 @@ func (t CommentListRequest) HTTPRequest(ctx context.Context, server string) (*ht
670677
// https://apidocs.teamwork.com/docs/teamwork/v3/milestone-comments/get-projects-api-v3-milestones-milestone-id-comments-json
671678
// https://apidocs.teamwork.com/docs/teamwork/v3/notebook-comments/get-projects-api-v3-notebooks-notebook-id-comments-json
672679
// https://apidocs.teamwork.com/docs/teamwork/v3/task-comments/get-projects-api-v3-tasks-task-id-comments-json
680+
// https://apidocs.teamwork.com/docs/teamwork/v3/link-comments/get-projects-api-v3-links-link-id-comments-json
673681
//
674682
//nolint:lll
675683
type CommentListResponse struct {

0 commit comments

Comments
 (0)