File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,29 @@ type Comment struct {
8383 DeletedAt * time.Time `json:"dateDeleted"`
8484}
8585
86+ // CommentSideload contains minimal information about a comment, used for
87+ // sideloading in other API responses.
88+ type CommentSideload struct {
89+ // ID is the unique identifier of the comment.
90+ ID int64 `json:"id"`
91+
92+ // Body is the body of the comment.
93+ Body string `json:"title"`
94+
95+ // Object is the relationship to the object (task, milestone, project) that
96+ // this comment is associated with.
97+ Object twapi.Relationship `json:"object"`
98+
99+ // Project is the relationship to the project that this comment belongs to.
100+ Project twapi.Relationship `json:"project"`
101+
102+ // PostedBy is the ID of the user who posted the comment.
103+ PostedBy * twapi.Relationship `json:"postedBy"`
104+
105+ // PostedAt is the date and time when the comment was posted.
106+ PostedAt * time.Time `json:"postedDateTime"`
107+ }
108+
86109// CommentUpdateRequestPath contains the path parameters for creating a
87110// comment.
88111type CommentCreateRequestPath struct {
Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ type SearchResponse struct {
220220 // Comments contains the comments associated with the search results.
221221 //
222222 // The key is the string representation of the comment ID.
223- Comments map [string ]Comment `json:"comments,omitempty"`
223+ Comments map [string ]CommentSideload `json:"comments,omitempty"`
224224 // Companies contains the companies associated with the search results.
225225 //
226226 // The key is the string representation of the company ID.
You can’t perform that action at this time.
0 commit comments