pub struct IssuesClient { /* private fields */ }Expand description
Domain client for GitHub issue operations.
Obtained via InstallationClient::issues(). Cheap to clone (Arc-backed).
Covers issue CRUD, comment CRUD, reactions, label application, assignees, lock/unlock, and timeline queries.
See docs/specs/interfaces/issue-operations.md
Implementations§
Source§impl IssuesClient
impl IssuesClient
Sourcepub async fn list(
&self,
owner: &str,
repo: &str,
state: Option<&str>,
page: Option<u32>,
) -> Result<PagedResponse<Issue>, ApiError>
pub async fn list( &self, owner: &str, repo: &str, state: Option<&str>, page: Option<u32>, ) -> Result<PagedResponse<Issue>, ApiError>
List issues in a repository (manual pagination).
§Arguments
state—"open"(default),"closed", or"all"page— 1-indexed page number; omit for first page
Sourcepub async fn get(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<Issue, ApiError>
pub async fn get( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Issue, ApiError>
Sourcepub async fn create(
&self,
owner: &str,
repo: &str,
request: CreateIssueRequest,
) -> Result<Issue, ApiError>
pub async fn create( &self, owner: &str, repo: &str, request: CreateIssueRequest, ) -> Result<Issue, ApiError>
Sourcepub async fn update(
&self,
owner: &str,
repo: &str,
issue_number: u64,
request: UpdateIssueRequest,
) -> Result<Issue, ApiError>
pub async fn update( &self, owner: &str, repo: &str, issue_number: u64, request: UpdateIssueRequest, ) -> Result<Issue, ApiError>
Update an existing issue (patch semantics — only set fields are changed).
§Errors
ApiError::NotFound— issue does not exist
Sourcepub async fn set_milestone(
&self,
owner: &str,
repo: &str,
issue_number: u64,
milestone_number: Option<u64>,
) -> Result<Issue, ApiError>
pub async fn set_milestone( &self, owner: &str, repo: &str, issue_number: u64, milestone_number: Option<u64>, ) -> Result<Issue, ApiError>
Set (or clear) the milestone on an issue.
Pass None to remove the milestone.
Sourcepub async fn list_comments(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<Vec<Comment>, ApiError>
pub async fn list_comments( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Vec<Comment>, ApiError>
List all comments on an issue.
Auto-paginates with per_page=100 (ADR-002). Oldest comments first.
§Errors
ApiError::NotFound— issue does not exist (no partial list returned)
Sourcepub async fn get_comment(
&self,
owner: &str,
repo: &str,
comment_id: u64,
) -> Result<Comment, ApiError>
pub async fn get_comment( &self, owner: &str, repo: &str, comment_id: u64, ) -> Result<Comment, ApiError>
Get a single comment by its repository-scoped ID.
Sourcepub async fn create_comment(
&self,
owner: &str,
repo: &str,
issue_number: u64,
request: CreateCommentRequest,
) -> Result<Comment, ApiError>
pub async fn create_comment( &self, owner: &str, repo: &str, issue_number: u64, request: CreateCommentRequest, ) -> Result<Comment, ApiError>
Create a comment on an issue.
Sourcepub async fn update_comment(
&self,
owner: &str,
repo: &str,
comment_id: u64,
request: UpdateCommentRequest,
) -> Result<Comment, ApiError>
pub async fn update_comment( &self, owner: &str, repo: &str, comment_id: u64, request: UpdateCommentRequest, ) -> Result<Comment, ApiError>
Update an existing comment.
Sourcepub async fn delete_comment(
&self,
owner: &str,
repo: &str,
comment_id: u64,
) -> Result<(), ApiError>
pub async fn delete_comment( &self, owner: &str, repo: &str, comment_id: u64, ) -> Result<(), ApiError>
Delete a comment.
Sourcepub async fn list_labels(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<Vec<Label>, ApiError>
pub async fn list_labels( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Vec<Label>, ApiError>
List all labels applied to an issue (auto-paginated).
Sourcepub async fn add_labels(
&self,
owner: &str,
repo: &str,
issue_number: u64,
labels: Vec<String>,
) -> Result<Vec<Label>, ApiError>
pub async fn add_labels( &self, owner: &str, repo: &str, issue_number: u64, labels: Vec<String>, ) -> Result<Vec<Label>, ApiError>
Add one or more labels to an issue (idempotent — duplicates ignored).
Returns the updated label list on the issue.
Sourcepub async fn remove_label(
&self,
owner: &str,
repo: &str,
issue_number: u64,
label_name: &str,
) -> Result<Vec<Label>, ApiError>
pub async fn remove_label( &self, owner: &str, repo: &str, issue_number: u64, label_name: &str, ) -> Result<Vec<Label>, ApiError>
Remove a single label from an issue.
Returns the remaining label list.
§Errors
ApiError::NotFound— label is not applied to this issue
Sourcepub async fn replace_labels(
&self,
owner: &str,
repo: &str,
issue_number: u64,
labels: Vec<String>,
) -> Result<Vec<Label>, ApiError>
pub async fn replace_labels( &self, owner: &str, repo: &str, issue_number: u64, labels: Vec<String>, ) -> Result<Vec<Label>, ApiError>
Replace all labels on an issue atomically.
Any labels not in labels are removed. Pass an empty vec to remove all labels.
Returns the new label list as applied by GitHub.
Sourcepub async fn list_reactions(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<Vec<Reaction>, ApiError>
pub async fn list_reactions( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Vec<Reaction>, ApiError>
List all reactions on an issue (auto-paginated).
Sourcepub async fn create_reaction(
&self,
owner: &str,
repo: &str,
issue_number: u64,
content: ReactionContent,
) -> Result<Reaction, ApiError>
pub async fn create_reaction( &self, owner: &str, repo: &str, issue_number: u64, content: ReactionContent, ) -> Result<Reaction, ApiError>
Add a reaction to an issue.
If the same user has already reacted with this emoji, GitHub returns the
existing reaction (HTTP 200). Both 200 and 201 map to Ok(Reaction).
Sourcepub async fn delete_reaction(
&self,
owner: &str,
repo: &str,
issue_number: u64,
reaction_id: u64,
) -> Result<(), ApiError>
pub async fn delete_reaction( &self, owner: &str, repo: &str, issue_number: u64, reaction_id: u64, ) -> Result<(), ApiError>
Remove a reaction from an issue.
Sourcepub async fn list_comment_reactions(
&self,
owner: &str,
repo: &str,
comment_id: u64,
) -> Result<Vec<Reaction>, ApiError>
pub async fn list_comment_reactions( &self, owner: &str, repo: &str, comment_id: u64, ) -> Result<Vec<Reaction>, ApiError>
List all reactions on an issue comment (auto-paginated).
Sourcepub async fn create_comment_reaction(
&self,
owner: &str,
repo: &str,
comment_id: u64,
content: ReactionContent,
) -> Result<Reaction, ApiError>
pub async fn create_comment_reaction( &self, owner: &str, repo: &str, comment_id: u64, content: ReactionContent, ) -> Result<Reaction, ApiError>
Add a reaction to an issue comment.
Sourcepub async fn delete_comment_reaction(
&self,
owner: &str,
repo: &str,
comment_id: u64,
reaction_id: u64,
) -> Result<(), ApiError>
pub async fn delete_comment_reaction( &self, owner: &str, repo: &str, comment_id: u64, reaction_id: u64, ) -> Result<(), ApiError>
Remove a reaction from an issue comment.
Sourcepub async fn list_available_assignees(
&self,
owner: &str,
repo: &str,
) -> Result<Vec<IssueUser>, ApiError>
pub async fn list_available_assignees( &self, owner: &str, repo: &str, ) -> Result<Vec<IssueUser>, ApiError>
List all users eligible to be assigned in this repository (auto-paginated).
Sourcepub async fn add_assignees(
&self,
owner: &str,
repo: &str,
issue_number: u64,
assignees: Vec<String>,
) -> Result<Issue, ApiError>
pub async fn add_assignees( &self, owner: &str, repo: &str, issue_number: u64, assignees: Vec<String>, ) -> Result<Issue, ApiError>
Add assignees to an issue.
GitHub silently ignores users who are not eligible. Returns the updated issue with the new assignee list.
Sourcepub async fn remove_assignees(
&self,
owner: &str,
repo: &str,
issue_number: u64,
assignees: Vec<String>,
) -> Result<Issue, ApiError>
pub async fn remove_assignees( &self, owner: &str, repo: &str, issue_number: u64, assignees: Vec<String>, ) -> Result<Issue, ApiError>
Remove assignees from an issue.
GitHub silently ignores users not currently assigned. Returns the updated issue with the revised assignee list.
Sourcepub async fn lock(
&self,
owner: &str,
repo: &str,
issue_number: u64,
reason: Option<LockReason>,
) -> Result<(), ApiError>
pub async fn lock( &self, owner: &str, repo: &str, issue_number: u64, reason: Option<LockReason>, ) -> Result<(), ApiError>
Sourcepub async fn unlock(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<(), ApiError>
pub async fn unlock( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<(), ApiError>
Unlock a previously locked issue.
§Errors
ApiError::AuthorizationFailed— requires admin or maintain permission
Sourcepub async fn list_activity_events(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<Vec<IssueActivityEvent>, ApiError>
pub async fn list_activity_events( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Vec<IssueActivityEvent>, ApiError>
List all discrete activity events on an issue (auto-paginated).
Returns events in ascending chronological order (oldest first).
Sourcepub async fn list_timeline(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<Vec<TimelineEvent>, ApiError>
pub async fn list_timeline( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Vec<TimelineEvent>, ApiError>
List the complete timeline of an issue (auto-paginated).
Superset of [list_activity_events]: also includes comments and
cross-references. Unknown event kinds yield TimelineEvent::Unknown.
Trait Implementations§
Source§impl Clone for IssuesClient
impl Clone for IssuesClient
Source§fn clone(&self) -> IssuesClient
fn clone(&self) -> IssuesClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more