@@ -10,7 +10,7 @@ import (
10
10
// TicketCommentAPI is an interface containing all ticket comment related API methods
11
11
type TicketCommentAPI interface {
12
12
CreateTicketComment (ctx context.Context , ticketID int64 , ticketComment TicketComment ) (TicketComment , error )
13
- ListTicketComments (ctx context.Context , ticketID int64 , opts * CursorPagination ) (* ListTicketCommentsResult , error )
13
+ ListTicketComments (ctx context.Context , ticketID int64 , opts * ListTicketCommentsOptions ) (* ListTicketCommentsResult , error )
14
14
MakeCommentPrivate (ctx context.Context , ticketID int64 , ticketCommentID int64 ) error
15
15
}
16
16
@@ -82,6 +82,22 @@ func (z *Client) CreateTicketComment(ctx context.Context, ticketID int64, ticket
82
82
return result , err
83
83
}
84
84
85
+ type ListTicketCommentsSort string
86
+
87
+ const (
88
+ TICKET_COMMENT_CREATED_AT_ASC ListTicketCommentsSort = "created_at"
89
+ TICKET_COMMENT_CREATED_AT_DESC ListTicketCommentsSort = "-created_at"
90
+ )
91
+
92
+ // ListTicketCommentOptions contains all the options supported by ListTicketComments endpoint.
93
+ type ListTicketCommentsOptions struct {
94
+ CursorPagination
95
+
96
+ Include string `url:"include,omitempty"`
97
+ IncludeInlineImages string `url:"include_inline_images,omitempty"`
98
+ Sort ListTicketCommentsSort `url:"sort,omitempty"`
99
+ }
100
+
85
101
// ListTicketCommentsResult contains the resulting ticket comments
86
102
// and cursor pagination metadata.
87
103
type ListTicketCommentsResult struct {
@@ -92,7 +108,11 @@ type ListTicketCommentsResult struct {
92
108
// ListTicketComments gets a list of comment for a specified ticket
93
109
//
94
110
// ref: https://developer.zendesk.com/rest_api/docs/support/ticket_comments#list-comments
95
- func (z * Client ) ListTicketComments (ctx context.Context , ticketID int64 , opts * CursorPagination ) (* ListTicketCommentsResult , error ) {
111
+ func (z * Client ) ListTicketComments (
112
+ ctx context.Context ,
113
+ ticketID int64 ,
114
+ opts * ListTicketCommentsOptions ,
115
+ ) (* ListTicketCommentsResult , error ) {
96
116
url := fmt .Sprintf ("/tickets/%d/comments.json" , ticketID )
97
117
98
118
var err error
0 commit comments