pub struct Issues<'a> { /* private fields */ }Implementations§
Source§impl Issues<'_>
impl Issues<'_>
pub fn list(&self, filter: &IssueFilter<'_>) -> Result<Vec<Issue>>
pub fn get(&self, number: &str) -> Result<Issue>
Sourcepub fn create(&self, req: &CreateIssue<'_>) -> Result<Issue>
pub fn create(&self, req: &CreateIssue<'_>) -> Result<Issue>
Gitee quirk: issue creation is POST /repos/{owner}/issues with repo as a form field
(no repo segment in the path).
Sourcepub fn set_state(&self, number: &str, state: IssueState) -> Result<Issue>
pub fn set_state(&self, number: &str, state: IssueState) -> Result<Issue>
Gitee quirk: state changes are PATCH /repos/{owner}/issues/{number} with a JSON body
{repo, title, state}. The current title must be echoed back or Gitee blanks it.
Writable state values observed on the live v5 API: open,
progressing, closed. Sending rejected yields 400. Closing always
becomes issue_state 已完成 (not 拒绝 / wontfix).
Sourcepub fn set_state_idempotent(
&self,
number: &str,
target: IssueState,
) -> Result<StateChange<Issue>>
pub fn set_state_idempotent( &self, number: &str, target: IssueState, ) -> Result<StateChange<Issue>>
Idempotent state change: GETs the current issue first; if it is already
in target, returns StateChange::Already(issue) without a PATCH.
Otherwise applies the PATCH and returns StateChange::Changed(issue).
Sourcepub fn edit(&self, number: &str, req: &EditIssue<'_>) -> Result<Issue>
pub fn edit(&self, number: &str, req: &EditIssue<'_>) -> Result<Issue>
PATCH metadata. Same JSON quirk as set_state: repo and the current
title must always be echoed; only Some fields are added.
pub fn comment(&self, number: &str, body: &str) -> Result<Comment>
Sourcepub fn list_comments(&self, number: &str, limit: usize) -> Result<Vec<Comment>>
pub fn list_comments(&self, number: &str, limit: usize) -> Result<Vec<Comment>>
List comments on an issue. limit caps how many are returned (paging
via get_paged).
Sourcepub fn latest_comment(&self, number: &str, login: &str) -> Result<Comment>
pub fn latest_comment(&self, number: &str, login: &str) -> Result<Comment>
Resolve --last: the comment by login with the latest created_at.
Paginates fully (independent of list --limit). Nothing found ⇒ Usage.
Sourcepub fn update_comment(&self, id: i64, body: &str) -> Result<Comment>
pub fn update_comment(&self, id: i64, body: &str) -> Result<Comment>
PATCH an issue comment by integer id.
Sourcepub fn update_latest_comment(
&self,
number: &str,
login: &str,
body: &str,
) -> Result<Comment>
pub fn update_latest_comment( &self, number: &str, login: &str, body: &str, ) -> Result<Comment>
--last edit: resolve login’s most-recent comment on the issue, then PATCH.
Sourcepub fn delete_comment(&self, id: i64) -> Result<StateChange<()>>
pub fn delete_comment(&self, id: i64) -> Result<StateChange<()>>
DELETE an issue comment by integer id. Already gone (404) ⇒ Already
(idempotent success, silent at the cmd layer).
Sourcepub fn delete_latest_comment(
&self,
number: &str,
login: &str,
) -> Result<StateChange<()>>
pub fn delete_latest_comment( &self, number: &str, login: &str, ) -> Result<StateChange<()>>
--last delete: resolve login’s most-recent comment on the issue, then DELETE.
Sourcepub fn list_labels(&self, number: &str) -> Result<Vec<Label>>
pub fn list_labels(&self, number: &str) -> Result<Vec<Label>>
Labels currently attached to an issue. Gitee’s issue-labels GET is not paginated (unlike PR labels).
Sourcepub fn add_labels_idempotent(
&self,
number: &str,
names: &[&str],
) -> Result<StateChange<Vec<Label>>>
pub fn add_labels_idempotent( &self, number: &str, names: &[&str], ) -> Result<StateChange<Vec<Label>>>
Add labels without replacing the rest. GETs current membership first;
POSTs only names that are missing. Already-present ⇒ Already (no POST).
Sourcepub fn remove_labels_idempotent(
&self,
number: &str,
names: &[&str],
) -> Result<StateChange<()>>
pub fn remove_labels_idempotent( &self, number: &str, names: &[&str], ) -> Result<StateChange<()>>
Remove only the named labels. GETs current membership first; DELETEs only names that are present. Absent names and DELETE 404 ⇒ no-op.