Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions projects/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,29 @@ type Comment struct {
DeletedAt *time.Time `json:"dateDeleted"`
}

// CommentSideload contains minimal information about a comment, used for
// sideloading in other API responses.
type CommentSideload struct {
// ID is the unique identifier of the comment.
ID int64 `json:"id"`

// Body is the body of the comment.
Body string `json:"title"`

// Object is the relationship to the object (task, milestone, project) that
// this comment is associated with.
Object twapi.Relationship `json:"object"`

// Project is the relationship to the project that this comment belongs to.
Project twapi.Relationship `json:"project"`

// PostedBy is the ID of the user who posted the comment.
PostedBy *twapi.Relationship `json:"postedBy"`

// PostedAt is the date and time when the comment was posted.
PostedAt *time.Time `json:"postedDateTime"`
}

// CommentUpdateRequestPath contains the path parameters for creating a
// comment.
type CommentCreateRequestPath struct {
Expand Down
2 changes: 1 addition & 1 deletion projects/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ type SearchResponse struct {
// Comments contains the comments associated with the search results.
//
// The key is the string representation of the comment ID.
Comments map[string]Comment `json:"comments,omitempty"`
Comments map[string]CommentSideload `json:"comments,omitempty"`
// Companies contains the companies associated with the search results.
//
// The key is the string representation of the company ID.
Expand Down