// DeleteComment deletes a gist comment.
//
// GitHub API docs: https://developer.github.com/v3/gists/comments/#delete-a-comment
499735
func (s *GistsService) DeleteComment(ctx context.Context, gistID string, commentID int64) (*Response, error) {
	u := fmt.Sprintf("gists/%v/comments/%v", gistID, commentID)
	req, err := s.client.NewRequest("DELETE", u, nil)
	if err != nil {
		return nil, err
	}

	return s.client.Do(ctx, req, nil)
}
921590
func (s *DistributionSummary) SetComment(v string) *DistributionSummary {
	s.Comment = &v
	return s
}
382019
func makeComment(cmap map[string]interface{}) *Comment {
	ret := new(Comment)
	ret.Author, _ = cmap["author"].(string)
	ret.Body, _ = cmap["body"].(string)
	ret.BodyHTML, _ = cmap["body_html"].(string)
	ret.Subreddit, _ = cmap["subreddit"].(string)
	ret.LinkID, _ = cmap["link_id"].(string)
	ret.ParentID, _ = cmap["parent_id"].(string)
	ret.SubredditID, _ = cmap["subreddit_id"].(string)
	ret.FullID, _ = cmap["name"].(string)
	ret.Permalink, _ = cmap["permalink"].(string)
	ret.Score, _ = cmap["score"].(float64)
	ret.UpVotes, _ = cmap["ups"].(float64)
	ret.DownVotes, _ = cmap["downs"].(float64)
	ret.Created, _ = cmap["created_utc"].(float64)
	ret.Edited, _ = cmap["edited"].(bool)
	ret.BannedBy, _ = cmap["banned_by"].(*string)
	ret.ApprovedBy, _ = cmap["approved_by"].(*string)
	ret.AuthorFlairTxt, _ = cmap["author_flair_text"].(*string)
	ret.AuthorFlairCSSClass, _ = cmap["author_flair_css_class"].(*string)
	ret.NumReports, _ = cmap["num_reports"].(*int)
	ret.Likes, _ = cmap["likes"].(*int)

	helper := new(helper)
	helper.buildComments(cmap["replies"])
	ret.Replies = helper.comments

	return ret
}
1164414
func (s *AssociateTargetsWithJobInput) SetComment(v string) *AssociateTargetsWithJobInput {
	s.Comment = &v
	return s
}
350140
func DeletePostComment() echo.HandlerFunc {

	// swagger:route DELETE /me/posts/{pid}/comments/{cid} me post DeleteMePostComment
	//
	// Delete the specified comment on the speficied user post
	//
	// Consumes:
	// - application/json
	//
	//	Produces:
	//	- application/json
	//
	//	Security:
	//		oauth: profile_comments:write
	//
	//	Responses:
	//		default: apiResponse

	return func(c echo.Context) error {
		return user.DeletePostComment()(c)
	}
}
846291
func (g *Generator) Comments(path string) string {
	loc, ok := g.file.comments[path]
	if !ok {
		return ""
	}
	text := strings.TrimSuffix(loc.GetLeadingComments(), "\n")
	return text
}
456947
func (s *ChangesService) GetComment(changeID, revisionID, commentID string) (*CommentInfo, *Response, error) {
	u := fmt.Sprintf("changes/%s/revisions/%s//comments/%s", changeID, revisionID, commentID)
	return s.getCommentInfoResponse(u)
}
644477
func (s *Deployment) SetComment(v string) *Deployment {
	s.Comment = &v
	return s
}
1277453
func (s *PullRequestsService) GetComment(ctx context.Context, owner string, repo string, commentID int64) (*PullRequestComment, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/pulls/comments/%d", owner, repo, commentID)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}

	// TODO: remove custom Accept header when this API fully launches.
	req.Header.Set("Accept", mediaTypeReactionsPreview)

	comment := new(PullRequestComment)
	resp, err := s.client.Do(ctx, req, comment)
	if err != nil {
		return nil, resp, err
	}

	return comment, resp, nil
}
1143241
func (s *PublicKeySummary) SetComment(v string) *PublicKeySummary {
	s.Comment = &v
	return s
}
255210
func lexComment(l *lexer) stateFn {
	l.pos += Pos(len(leftComment))
	i := strings.Index(l.input[l.pos:], rightComment)
	if i < 0 {
		return l.errorf("unclosed comment")
	}
	l.pos += Pos(i + len(rightComment))
	if !strings.HasPrefix(l.input[l.pos:], l.rightDelim) {
		return l.errorf("comment ends before closing delimiter")

	}
	l.pos += Pos(len(l.rightDelim))
	l.ignore()
	return lexText
}
1361033
func (c *Client) DeleteIssueComment(owner, repo string, index, commentID int64) error {
	_, err := c.getResponse("DELETE", fmt.Sprintf("/repos/%s/%s/issues/%d/comments/%d", owner, repo, index, commentID), nil, nil)
	return err
}
608863
func (c *CommentService) Delete(teamName string, commentID int) error {
	commentIDStr := strconv.Itoa(commentID)
	commentURL := CommnetURL + "/" + teamName + "/comments" + "/" + commentIDStr

	res, err := c.client.delete(commentURL)
	if err != nil {
		return err
	}

	defer res.Body.Close()

	return nil
}
112459
func UpdateComment(doer *User, c *Comment, oldContent string) (err error) {
	if _, err = x.Id(c.ID).AllCols().Update(c); err != nil {
		return err
	}

	if err = c.Issue.LoadAttributes(); err != nil {
		log.Error(2, "Issue.LoadAttributes [issue_id: %d]: %v", c.IssueID, err)
	} else if err = PrepareWebhooks(c.Issue.Repo, HOOK_EVENT_ISSUE_COMMENT, &api.IssueCommentPayload{
		Action:  api.HOOK_ISSUE_COMMENT_EDITED,
		Issue:   c.Issue.APIFormat(),
		Comment: c.APIFormat(),
		Changes: &api.ChangesPayload{
			Body: &api.ChangesFromPayload{
				From: oldContent,
			},
		},
		Repository: c.Issue.Repo.APIFormat(nil),
		Sender:     doer.APIFormat(),
	}); err != nil {
		log.Error(2, "PrepareWebhooks [comment_id: %d]: %v", c.ID, err)
	}

	return nil
}
746929
func (s *PostCommentForComparedCommitOutput) SetComment(v *Comment) *PostCommentForComparedCommitOutput {
	s.Comment = v
	return s
}
34502
func (s *GetCommandInvocationOutput) SetComment(v string) *GetCommandInvocationOutput {
	s.Comment = &v
	return s
}
1151357
func (c *Comments) AddComment(comment *Comment) {
	if c.primary {
		if !c.wasLineBreak {
			c.Comments = append(c.Comments, comment)
		} else {
			c.future = append(c.future, comment)
		}
	} else {
		if !c.wasLineBreak || (c.Current == nil && !c.afterBlock) {
			c.Comments = append(c.Comments, comment)
		} else {
			c.future = append(c.future, comment)
		}
	}
}