module Github::Issues::Comments

def comment(user_name, repo_name, comment_id, params={})


@github.issues.comment 'user-name', 'repo-name', 'comment-id'
@github = Github.new
= Examples

Get a single comment
def comment(user_name, repo_name, comment_id, params={})
  _update_user_repo_params(user_name, repo_name)
  _validate_user_repo_params(user, repo) unless user? && repo?
  _validate_presence_of comment_id
  _normalize_params_keys(params)
  # _merge_mime_type(:issue_comment, params)
  get("/repos/#{user}/#{repo}/issues/comments/#{comment_id}", params)
end

def comments(user_name, repo_name, issue_id, params={})


@github.issues.comments 'user-name', 'repo-name', 'issue-id' { |com| ... }
@github.issues.comments 'user-name', 'repo-name', 'issue-id'
@github = Github.new
= Examples

List comments on an issue
def comments(user_name, repo_name, issue_id, params={})
  _update_user_repo_params(user_name, repo_name)
  _validate_user_repo_params(user, repo) unless user? && repo?
  _validate_presence_of issue_id
  _normalize_params_keys(params)
  # _merge_mime_type(:issue_comment, params)
  response = get("/repos/#{user}/#{repo}/issues/#{issue_id}/comments", params)
  return response unless block_given?
  response.each { |el| yield el }
end

def create_comment(user_name, repo_name, issue_id, params={})


"body" => 'a new comment'
@github.issues.create_comment 'user-name', 'repo-name', 'issue-id',
@github = Github.new
= Examples

:body Required string
= Inputs

Create a comment
def create_comment(user_name, repo_name, issue_id, params={})
  _update_user_repo_params(user_name, repo_name)
  _validate_user_repo_params(user, repo) unless user? && repo?
  _validate_presence_of issue_id
  _normalize_params_keys(params)
  # _merge_mime_type(:issue_comment, params)
  _filter_params_keys(VALID_ISSUE_COMMENT_PARAM_NAME, params)
  _validate_inputs(%w[ body ], params)
  post("/repos/#{user}/#{repo}/issues/#{issue_id}/comments", params)
end

def delete_comment(user_name, repo_name, comment_id, params={})


@github.issues.delete_comment 'user-name', 'repo-name', 'comment-id'
@github = Github.new
= Examples

Delete a comment
def delete_comment(user_name, repo_name, comment_id, params={})
  _update_user_repo_params(user_name, repo_name)
  _validate_user_repo_params(user, repo) unless user? && repo?
  _validate_presence_of comment_id
  _normalize_params_keys(params)
  # _merge_mime_type(:issue_comment, params)
  delete("/repos/#{user}/#{repo}/issues/comments/#{comment_id}", params)
end

def edit_comment(user_name, repo_name, comment_id, params={})


"body" => 'a new comment'
@github.issues.edit_comment 'user-name', 'repo-name', 'comment-id',
@github = Github.new
= Examples

:body Required string
= Inputs

Edit a comment
def edit_comment(user_name, repo_name, comment_id, params={})
  _update_user_repo_params(user_name, repo_name)
  _validate_user_repo_params(user, repo) unless user? && repo?
  _validate_presence_of comment_id
  _normalize_params_keys(params)
  # _merge_mime_type(:issue_comment, params)
  _filter_params_keys(VALID_ISSUE_COMMENT_PARAM_NAME, params)
  _validate_inputs(%w[ body ], params)
  patch("/repos/#{user}/#{repo}/issues/comments/#{comment_id}")
end