Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.15] feat: award emojis on issues #793

Open
wants to merge 1 commit into
base: 11.15
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/Api/Issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,18 @@ public function awardEmoji($project_id, int $issue_iid)
return $this->get($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/award_emoji'));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param string $name
*
* @return mixed
*/
public function addAwardEmoji($project_id, int $issue_iid, string $name)
{
return $this->post($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/award_emoji'), ['name' => $name]);
}

/**
* @param int|string $project_id
* @param int $issue_iid
Expand All @@ -398,6 +410,30 @@ public function removeAwardEmoji($project_id, int $issue_iid, int $award_id)
return $this->delete($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/award_emoji/'.self::encodePath($award_id)));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param int $note_id
*
* @return mixed
*/
public function showNoteAwardEmoji($project_id, int $issue_iid, int $note_id)
{
return $this->get($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/notes/'.self::encodePath($note_id).'/award_emoji'));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param string $name
*
* @return mixed
*/
public function addNoteAwardEmoji($project_id, int $issue_iid, int $note_id, string $name)
{
return $this->post($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/notes/'.self::encodePath($note_id).'/award_emoji'), ['name' => $name]);
}

/**
* @param int|string $project_id
* @param int $issue_iid
Expand Down