pub struct Client { /* private fields */ }Expand description
Thin blocking HTTP client for the AtomGit REST API, authenticated with
the OAuth token stored by crate::auth. Blocking is fine here — the
fixissue flow runs before the agent loop starts.
Implementations§
Source§impl Client
impl Client
Sourcepub fn from_stored_auth() -> Result<Self>
pub fn from_stored_auth() -> Result<Self>
Build a client using the currently-stored OAuth token. Refreshes the token if expired. Errors with a user-friendly message if the user hasn’t logged in.
Sourcepub fn get_issue(&self, r: &IssueRef) -> Result<Issue>
pub fn get_issue(&self, r: &IssueRef) -> Result<Issue>
GET /api/v5/repos/{owner}/{repo}/issues/{number}
Sourcepub fn create_issue(
&self,
owner: &str,
repo: &str,
title: &str,
body: &str,
) -> Result<CreatedIssue>
pub fn create_issue( &self, owner: &str, repo: &str, title: &str, body: &str, ) -> Result<CreatedIssue>
POST /api/v5/repos/{owner}/{repo}/issues — create a new issue in
the target repo. Used by the /issue wizard in the TUI; returns
the server’s response so callers can surface the new issue’s
number + html_url to the user.
Sourcepub fn post_issue_comment(&self, r: &IssueRef, body: &str) -> Result<()>
pub fn post_issue_comment(&self, r: &IssueRef, body: &str) -> Result<()>
POST /api/v5/repos/{owner}/{repo}/issues/{number}/comments — append a comment to the issue. Used after a successful fixissue run to leave the agent’s repair summary on the issue.
Sourcepub fn list_labels(&self, owner: &str, repo: &str) -> Result<Vec<RepoLabel>>
pub fn list_labels(&self, owner: &str, repo: &str) -> Result<Vec<RepoLabel>>
GET /api/v5/repos/{owner}/{repo}/labels — list the repo’s
defined labels. Used by add_issue_label to look up the numeric
ID that the issue-labels POST endpoint requires (AtomGit rejects
label-by-name; names alone return 400 “Request body parsing error”).
Sourcepub fn add_issue_label(&self, r: &IssueRef, label_name: &str) -> Result<()>
pub fn add_issue_label(&self, r: &IssueRef, label_name: &str) -> Result<()>
POST /api/v5/repos/{owner}/{repo}/issues/{number}/labels —
attach a label to the issue. AtomGit’s endpoint expects the
label’s numeric ID, not its name, so this first calls
list_labels to resolve the name. If the label doesn’t exist
in the repo we return a clear error instead of auto-creating —
label taxonomy is a repo-setting decision.
Sourcepub fn get_issue_comments(&self, r: &IssueRef) -> Vec<Comment>
pub fn get_issue_comments(&self, r: &IssueRef) -> Vec<Comment>
GET /api/v5/repos/{owner}/{repo}/issues/{number}/comments. Swallowed on error: comments are best-effort context, not required for the fix-issue flow to proceed.
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more