pub struct ProjectsClient { /* private fields */ }Expand description
Domain client for GitHub Projects V2 operations.
Obtained via InstallationClient::projects(). Cheap to clone (Arc-backed).
See docs/specs/interfaces/project-operations.md
Implementations§
Source§impl ProjectsClient
impl ProjectsClient
Sourcepub async fn list_for_org(&self, _org: &str) -> Result<Vec<ProjectV2>, ApiError>
pub async fn list_for_org(&self, _org: &str) -> Result<Vec<ProjectV2>, ApiError>
List all Projects v2 for an organisation.
See docs/specs/interfaces/project-operations.md
Sourcepub async fn list_for_user(
&self,
_username: &str,
) -> Result<Vec<ProjectV2>, ApiError>
pub async fn list_for_user( &self, _username: &str, ) -> Result<Vec<ProjectV2>, ApiError>
List all Projects v2 for a user.
See docs/specs/interfaces/project-operations.md
Sourcepub async fn get(
&self,
_owner: &str,
_project_number: u64,
) -> Result<ProjectV2, ApiError>
pub async fn get( &self, _owner: &str, _project_number: u64, ) -> Result<ProjectV2, ApiError>
Get details about a specific project.
See docs/spec/interfaces/project-operations.md
Sourcepub async fn add_item(
&self,
owner: &str,
project_number: u64,
content_node_id: &str,
) -> Result<ProjectV2Item, ApiError>
pub async fn add_item( &self, owner: &str, project_number: u64, content_node_id: &str, ) -> Result<ProjectV2Item, ApiError>
Add an issue or pull request to a project.
Resolves the project node ID from owner + project_number (trying organisation
first, then falling back to user), then calls the addProjectV2ItemById GraphQL
mutation to attach the content.
§Arguments
owner- Organisation or user login nameproject_number- Project number (unique within owner)content_node_id- Node ID of the issue or pull request to add
§Returns
Ok(ProjectV2Item)— the newly created project itemErr(ApiError::NotFound)— project not found for this ownerErr(ApiError::AuthorizationFailed)— no write access to the projectErr(ApiError)— other transport or GraphQL errors
Sourcepub async fn list_for_issue(
&self,
owner: &str,
repo: &str,
issue_number: u64,
) -> Result<Vec<ProjectV2>, ApiError>
pub async fn list_for_issue( &self, owner: &str, repo: &str, issue_number: u64, ) -> Result<Vec<ProjectV2>, ApiError>
Get all Projects v2 linked to a specific issue.
Queries the GitHub GraphQL API for all Projects v2 that contain the given issue.
Returns an empty Vec when the issue exists but is not linked to any projects.
Results are fetched in pages of 20; all pages are retrieved automatically and
returned as a single combined Vec.
§Arguments
owner- Repository owner (organisation or user login)repo- Repository nameissue_number- Issue number
§Returns
Ok(Vec<ProjectV2>)— all projects linked to the issue (may be empty)Err(ApiError::NotFound)— repository or issue does not existErr(ApiError::AuthenticationFailed)— token is invalidErr(ApiError)— other transport or GraphQL errors
Trait Implementations§
Source§impl Clone for ProjectsClient
impl Clone for ProjectsClient
Source§fn clone(&self) -> ProjectsClient
fn clone(&self) -> ProjectsClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more