// CreateIssueComment creates a plain issue comment.
764231
func CreateIssueComment(doer *User, repo *Repository, issue *Issue, content string, attachments []string) (*Comment, error) {
	comment, err := CreateComment(&CreateCommentOptions{
		Type:        COMMENT_TYPE_COMMENT,
		Doer:        doer,
		Repo:        repo,
		Issue:       issue,
		Content:     content,
		Attachments: attachments,
	})
	if err != nil {
		return nil, fmt.Errorf("CreateComment: %v", err)
	}

	comment.Issue = issue
	if err = PrepareWebhooks(repo, HOOK_EVENT_ISSUE_COMMENT, &api.IssueCommentPayload{
		Action:     api.HOOK_ISSUE_COMMENT_CREATED,
		Issue:      issue.APIFormat(),
		Comment:    comment.APIFormat(),
		Repository: repo.APIFormat(nil),
		Sender:     doer.APIFormat(),
	}); err != nil {
		log.Error(2, "PrepareWebhooks [comment_id: %d]: %v", comment.ID, err)
	}

	return comment, nil
}
295742
func (w *Webhook) HasIssueCommentEvent() bool {
	return w.SendEverything ||
		(w.ChooseEvents && w.HookEvents.IssueComment)
}
1306552
func (cm CommentMap) AddComment(node Node, comment *Comment) {
	list := cm[node]
	list = append(list, comment)

	cm[node] = list
}
946846
func (s *CommandInvocation) SetComment(v string) *CommandInvocation {
	s.Comment = &v
	return s
}
1184649
func (s *FieldLevelEncryptionProfileConfig) SetComment(v string) *FieldLevelEncryptionProfileConfig {
	s.Comment = &v
	return s
}
921590
func (s *DistributionSummary) SetComment(v string) *DistributionSummary {
	s.Comment = &v
	return s
}
362049
func (s *TrafficPolicy) SetComment(v string) *TrafficPolicy {
	s.Comment = &v
	return s
}
1315673
func (operation *Operation) ParseEmptyResponseComment(commentLine string) error {
	var matches []string

	if matches = emptyResponsePattern.FindStringSubmatch(commentLine); len(matches) != 3 {
		return fmt.Errorf("can not parse response comment \"%s\"", commentLine)
	}

	response := spec.Response{}

	code, _ := strconv.Atoi(matches[1])

	response.Description = strings.Trim(matches[2], "")

	if operation.Responses == nil {
		operation.Responses = &spec.Responses{
			ResponsesProps: spec.ResponsesProps{
				StatusCodeResponses: make(map[int]spec.Response),
			},
		}
	}

	operation.Responses.StatusCodeResponses[code] = response

	return nil
}
733974
func newComment(ln *line, parent element) *comment {
	return &comment{
		elementBase: newElementBase(ln, parent),
	}
}
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
}
317359
func (s *IssueService) AddComment(issueID string, comment *Comment) (*Comment, *Response, error) {
	apiEndpoint := fmt.Sprintf("rest/api/2/issue/%s/comment", issueID)
	req, err := s.client.NewRequest("POST", apiEndpoint, comment)
	if err != nil {
		return nil, nil, err
	}

	responseComment := new(Comment)
	resp, err := s.client.Do(req, responseComment)
	if err != nil {
		jerr := NewJiraError(resp, err)
		return nil, resp, jerr
	}

	return responseComment, resp, nil
}
1155786
func NewCommentCreated(commentID string) Message {
	return Message{MessageID: uuid.NewV4(), MessageType: "comment.create", TargetID: commentID}
}
251233
func (c *Client) ListRepoIssueComments(owner, repo string) ([]*Comment, error) {
	comments := make([]*Comment, 0, 10)
	return comments, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/issues/comments", owner, repo), nil, nil, &comments)
}
191380
func (c *IssueCommentsService) Create(uri *Hyperlink, uriParams M, requestParams interface{}) (comment *IssueComment, result *Result) {
	url, err := ExpandWithDefault(uri, &IssueCommentsURL, uriParams)
	if err != nil {
		return nil, &Result{Err: err}
	}

	result = c.client.post(url, requestParams, &comment)
	return
}
344177
func (section *Section) AddComment(comment string) {
	section.comments = append(section.comments, comment)
}
1220769
func NewProjectPostComment(hcid uint64) (comment *ProjectPostComment, e error) {
	return NewProjectPostCommentWhere(&ProjectPostComment{Hcid: hcid})
}
1280133
func (s *OriginAccessIdentitySummary) SetComment(v string) *OriginAccessIdentitySummary {
	s.Comment = &v
	return s
}