pub struct Client {
pub http: Client,
pub org: String,
pub semaphore: Arc<Semaphore>,
pub base_url: String,
}Expand description
GitHub API client with rate limiting and concurrency control.
Fields§
§http: Client§org: String§semaphore: Arc<Semaphore>§base_url: StringImplementations§
Source§impl Client
impl Client
pub async fn get_branch_protection( &self, repo: &str, branch: &str, ) -> Result<Option<BranchProtectionState>>
pub async fn update_branch_protection( &self, repo: &str, branch: &str, config: &BranchProtectionConfig, ) -> Result<()>
Source§impl Client
impl Client
pub async fn new(org: &str, parallelism: usize) -> Result<Self>
Sourcepub async fn patch_json<T: Serialize>(
&self,
path: &str,
body: &T,
) -> Result<Response>
pub async fn patch_json<T: Serialize>( &self, path: &str, body: &T, ) -> Result<Response>
Make a PATCH request with a JSON body.
Sourcepub async fn post_json<T: Serialize>(
&self,
path: &str,
body: &T,
) -> Result<Response>
pub async fn post_json<T: Serialize>( &self, path: &str, body: &T, ) -> Result<Response>
Make a POST request with a JSON body.
Source§impl Client
impl Client
Sourcepub async fn create_commit(
&self,
repo: &str,
branch: &str,
message: &str,
files: &[CommitFile],
) -> Result<String>
pub async fn create_commit( &self, repo: &str, branch: &str, message: &str, files: &[CommitFile], ) -> Result<String>
Create an atomic multi-file commit using the Git Trees API. This avoids cloning the repo - everything happens via the API.
Source§impl Client
impl Client
Sourcepub async fn get_file(
&self,
repo: &str,
path: &str,
branch: Option<&str>,
) -> Result<Option<FileContent>>
pub async fn get_file( &self, repo: &str, path: &str, branch: Option<&str>, ) -> Result<Option<FileContent>>
Get a file’s content from a repo. Returns None if the file doesn’t exist.
Sourcepub fn decode_content(content: &FileContent) -> Result<String>
pub fn decode_content(content: &FileContent) -> Result<String>
Decode base64-encoded file content from the Contents API.
Source§impl Client
impl Client
Sourcepub async fn create_pull_request(
&self,
repo: &str,
title: &str,
body: &str,
head: &str,
base: &str,
reviewers: &[String],
) -> Result<PullRequest>
pub async fn create_pull_request( &self, repo: &str, title: &str, body: &str, head: &str, base: &str, reviewers: &[String], ) -> Result<PullRequest>
Create a pull request. Returns the created PR.
Source§impl Client
impl Client
Sourcepub async fn list_repos(&self) -> Result<Vec<Repository>>
pub async fn list_repos(&self) -> Result<Vec<Repository>>
List all repositories for the configured org, handling pagination.
Sourcepub async fn list_repos_for_system(
&self,
system_id: &str,
exclude_patterns: &[String],
explicit_repos: &[String],
) -> Result<Vec<Repository>>
pub async fn list_repos_for_system( &self, system_id: &str, exclude_patterns: &[String], explicit_repos: &[String], ) -> Result<Vec<Repository>>
List repos filtered by system ID prefix and/or explicit repo names, with exclude patterns applied to the combined result.
Sourcepub async fn get_repo(&self, repo_name: &str) -> Result<Repository>
pub async fn get_repo(&self, repo_name: &str) -> Result<Repository>
Get a single repository.
Source§impl Client
impl Client
Sourcepub async fn get_security_state(&self, repo: &str) -> Result<SecurityState>
pub async fn get_security_state(&self, repo: &str) -> Result<SecurityState>
Read the current security state of a repository.
Sourcepub async fn enable_dependabot_alerts(&self, repo: &str) -> Result<()>
pub async fn enable_dependabot_alerts(&self, repo: &str) -> Result<()>
Enable vulnerability alerts (Dependabot alerts) for a repo.
Sourcepub async fn enable_dependabot_security_updates(&self, repo: &str) -> Result<()>
pub async fn enable_dependabot_security_updates(&self, repo: &str) -> Result<()>
Enable automated security fixes (Dependabot security updates) for a repo.
Source§impl Client
impl Client
Sourcepub async fn get_settings(&self, repo: &str) -> Result<RepoSettings>
pub async fn get_settings(&self, repo: &str) -> Result<RepoSettings>
Get repository settings.
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