Skip to main content

IssuesClient

Struct IssuesClient 

Source
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

Source

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
Source

pub async fn get( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Issue, ApiError>

Get a single issue by number.

§Errors
  • ApiError::NotFound — issue does not exist
Source

pub async fn create( &self, owner: &str, repo: &str, request: CreateIssueRequest, ) -> Result<Issue, ApiError>

Create a new issue.

§Errors
  • ApiError::InvalidRequest — validation failed (empty title, etc.)
Source

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
Source

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.

Source

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)
Source

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.

Source

pub async fn create_comment( &self, owner: &str, repo: &str, issue_number: u64, request: CreateCommentRequest, ) -> Result<Comment, ApiError>

Create a comment on an issue.

Source

pub async fn update_comment( &self, owner: &str, repo: &str, comment_id: u64, request: UpdateCommentRequest, ) -> Result<Comment, ApiError>

Update an existing comment.

Source

pub async fn delete_comment( &self, owner: &str, repo: &str, comment_id: u64, ) -> Result<(), ApiError>

Delete a comment.

Source

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).

Source

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.

Source

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
Source

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.

Source

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).

Source

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).

Source

pub async fn delete_reaction( &self, owner: &str, repo: &str, issue_number: u64, reaction_id: u64, ) -> Result<(), ApiError>

Remove a reaction from an issue.

Source

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).

Source

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.

Source

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.

Source

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).

Source

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.

Source

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.

Source

pub async fn lock( &self, owner: &str, repo: &str, issue_number: u64, reason: Option<LockReason>, ) -> Result<(), ApiError>

Lock an issue, preventing non-collaborator comments.

§Arguments
  • reason — optional lock reason shown to users attempting to comment
§Errors
  • ApiError::AuthorizationFailed — requires admin or maintain permission
Source

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
Source

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).

Source

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

Source§

fn clone(&self) -> IssuesClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IssuesClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more