pub struct InstallationClient { /* private fields */ }Expand description
Installation-scoped GitHub API client.
Holds a reference to the parent GitHubClient for shared HTTP client,
auth provider, and rate limiter. All operations use installation tokens.
Implementations§
Source§impl InstallationClient
impl InstallationClient
Sourcepub fn new(client: Arc<GitHubClient>, installation_id: InstallationId) -> Self
pub fn new(client: Arc<GitHubClient>, installation_id: InstallationId) -> Self
Create a new installation client.
§Arguments
client- Parent GitHubClientinstallation_id- Installation ID to bind to
Sourcepub fn installation_id(&self) -> InstallationId
pub fn installation_id(&self) -> InstallationId
Get the installation ID this client is bound to.
Sourcepub async fn get(&self, path: &str) -> Result<Response, ApiError>
pub async fn get(&self, path: &str) -> Result<Response, ApiError>
Make an authenticated GET request to the GitHub API.
Uses installation token for authentication and includes automatic retry logic for transient errors (5xx, 429, network failures).
§Arguments
path- API path (e.g., “/repos/owner/repo” or “repos/owner/repo”)
§Returns
Returns the raw reqwest::Response for flexible handling.
§Errors
Returns ApiError for HTTP errors, authentication failures, or network issues.
Sourcepub async fn put<T: Serialize>(
&self,
path: &str,
body: &T,
) -> Result<Response, ApiError>
pub async fn put<T: Serialize>( &self, path: &str, body: &T, ) -> Result<Response, ApiError>
Make an authenticated PUT request to the GitHub API.
Includes automatic retry logic for transient errors.
Sourcepub async fn delete(&self, path: &str) -> Result<Response, ApiError>
pub async fn delete(&self, path: &str) -> Result<Response, ApiError>
Make an authenticated DELETE request to the GitHub API.
Includes automatic retry logic for transient errors.
Sourcepub async fn post_graphql<V: Serialize>(
&self,
query: &str,
variables: V,
) -> Result<Value, ApiError>
pub async fn post_graphql<V: Serialize>( &self, query: &str, variables: V, ) -> Result<Value, ApiError>
Make an authenticated POST request to the GitHub GraphQL API.
GitHub’s GraphQL endpoint always returns HTTP 200 even for errors.
Application-level errors are detected by checking the .errors
array in the response body; the first error message is surfaced as
ApiError::GraphQlError. On success, the .data value is returned.
Retry logic (backoff, 5xx, rate-limit handling) is identical to the REST helpers because the transport layer is the same.
§Arguments
query- GraphQL query or mutation stringvariables- Variables object (serialised to JSON)
§Returns
Returns the data field from the GraphQL response as a serde_json::Value.
§Errors
ApiError::GraphQlError— GitHub returned.errorsin the bodyApiError::GraphQlError— response body contains neither.errorsnor a non-null.datafield (malformed or unexpected response shape)ApiError::AuthenticationFailed— HTTP 401ApiError::JsonError— response body could not be parsed- Any other
ApiErrorvariant for HTTP-level failures
Source§impl InstallationClient
impl InstallationClient
Sourcepub fn issues(&self) -> IssuesClient
pub fn issues(&self) -> IssuesClient
Access issue-domain operations.
See docs/specs/interfaces/issue-operations.md; ADR-003.
Sourcepub fn pull_requests(&self) -> PullRequestsClient
pub fn pull_requests(&self) -> PullRequestsClient
Access pull request operations, reviews, and inline comments.
See docs/specs/interfaces/pull-request-operations.md; ADR-003.
Sourcepub fn labels(&self) -> LabelsClient
pub fn labels(&self) -> LabelsClient
Access repository-level label catalogue operations.
See docs/specs/interfaces/labels-client.md; ADR-003.
Sourcepub fn milestones(&self) -> MilestonesClient
pub fn milestones(&self) -> MilestonesClient
Access milestone CRUD operations.
See docs/specs/interfaces/milestones-client.md; ADR-003.
Sourcepub fn repositories(&self) -> RepositoriesClient
pub fn repositories(&self) -> RepositoriesClient
Access repository, branch, tag, git-ref, and commit operations.
See docs/specs/interfaces/repository-operations.md; ADR-003.
Sourcepub fn workflows(&self) -> WorkflowsClient
pub fn workflows(&self) -> WorkflowsClient
Access GitHub Actions workflow and run operations.
See docs/specs/interfaces/additional-operations.md; ADR-003.
Sourcepub fn releases(&self) -> ReleasesClient
pub fn releases(&self) -> ReleasesClient
Access release CRUD operations.
See docs/specs/interfaces/additional-operations.md; ADR-003.
Sourcepub fn projects(&self) -> ProjectsClient
pub fn projects(&self) -> ProjectsClient
Access GitHub Projects V2 operations.
See docs/specs/interfaces/project-operations.md; ADR-003.
Trait Implementations§
Source§impl Clone for InstallationClient
impl Clone for InstallationClient
Source§fn clone(&self) -> InstallationClient
fn clone(&self) -> InstallationClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more