Commit da7700f2 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'set_notes'

646b9706 gitlab: new set_merge_request_note and set_issue_note function
864aa152

 Apply rustfmt
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !183
parents be11156f 646b9706
......@@ -441,10 +441,7 @@ impl Gitlab {
N: AsRef<str>,
{
let param: &[(&str, &str)] = &[];
self.get_with_param(
format!("groups/{}", Self::url_name(name.as_ref())),
param,
)
self.get_with_param(format!("groups/{}", Self::url_name(name.as_ref())), param)
}
/// Get a project's hooks.
......@@ -1153,6 +1150,22 @@ impl Gitlab {
self.post_with_param(path, &[("body", content.as_ref())])
}
/// Edit a note on an issue.
pub fn set_issue_note<C>(
&self,
project: ProjectId,
issue: IssueInternalId,
note: NoteId,
content: C,
) -> GitlabResult<Note>
where
C: AsRef<str>,
{
let path = format!("projects/{}/issues/{}/notes/{}", project, issue, note);
self.put_with_param(path, &[("body", content.as_ref())])
}
/// Get the merge requests for a project.
pub fn merge_requests<I, K, V>(
&self,
......@@ -1545,6 +1558,24 @@ impl Gitlab {
self.post_with_param(path, &[("body", content)])
}
/// Edit a note on a merge request.
pub fn set_merge_request_note<C>(
&self,
project: ProjectId,
merge_request: MergeRequestInternalId,
note: NoteId,
content: C,
) -> GitlabResult<Note>
where
C: AsRef<str>,
{
let path = format!(
"projects/{}/merge_requests/{}/notes/{}",
project, merge_request, note,
);
self.put_with_param(path, &[("body", content.as_ref())])
}
/// Get issues closed by a merge request.
pub fn get_issues_closed_by_merge_request<I, K, V>(
&self,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment