MCPcopy Create free account
hub / github.com/cli/cli / ExportReply

Method ExportReply

pkg/cmd/discussion/client/types.go:221–236  ·  view source on GitHub ↗

ExportReply returns a reply as a map for JSON output, without nested replies.

()

Source from the content-addressed store, hash-verified

219
220// ExportReply returns a reply as a map for JSON output, without nested replies.
221func (c DiscussionComment) ExportReply() map[string]interface{} {
222 reactions := make([]interface{}, len(c.ReactionGroups))
223 for i, rg := range c.ReactionGroups {
224 reactions[i] = rg.Export()
225 }
226 return map[string]interface{}{
227 "id": c.ID,
228 "url": c.URL,
229 "author": c.Author.Export(),
230 "body": c.Body,
231 "createdAt": c.CreatedAt,
232 "isAnswer": c.IsAnswer,
233 "upvoteCount": c.UpvoteCount,
234 "reactionGroups": reactions,
235 }
236}
237
238// DiscussionCommentListDirection indicates whether a comment list was fetched
239// in forward (oldest first) or backward (newest first) order.

Callers 1

ExportMethod · 0.80

Calls 1

ExportMethod · 0.45

Tested by

no test coverage detected