pub struct Projects {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Projects
impl Projects
Sourcepub async fn list_for_org(
&self,
org: &str,
state: IssuesListState,
per_page: i64,
page: i64,
) -> Result<Response<Vec<Project>>, ClientError>
pub async fn list_for_org( &self, org: &str, state: IssuesListState, per_page: i64, page: i64, ) -> Result<Response<Vec<Project>>, ClientError>
List organization projects.
This function performs a GET
to the /orgs/{org}/projects
endpoint.
Lists the projects in an organization. Returns a 404 Not Found
status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
FROM: https://docs.github.com/rest/reference/projects#list-organization-projects
Parameters:
org: &str
state: crate::types::IssuesListState
– Indicates the state of the issues to return. Can be eitheropen
,closed
, orall
.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Sourcepub async fn list_all_for_org(
&self,
org: &str,
state: IssuesListState,
) -> Result<Response<Vec<Project>>, ClientError>
pub async fn list_all_for_org( &self, org: &str, state: IssuesListState, ) -> Result<Response<Vec<Project>>, ClientError>
List organization projects.
This function performs a GET
to the /orgs/{org}/projects
endpoint.
As opposed to list_for_org
, this function returns all the pages of the request at once.
Lists the projects in an organization. Returns a 404 Not Found
status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
FROM: https://docs.github.com/rest/reference/projects#list-organization-projects
Sourcepub async fn create_for_org(
&self,
org: &str,
body: &ProjectsCreateRequest,
) -> Result<Response<Project>, ClientError>
pub async fn create_for_org( &self, org: &str, body: &ProjectsCreateRequest, ) -> Result<Response<Project>, ClientError>
Create an organization project.
This function performs a POST
to the /orgs/{org}/projects
endpoint.
Creates an organization project board. Returns a 404 Not Found
status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
FROM: https://docs.github.com/rest/reference/projects#create-an-organization-project
Parameters:
org: &str
Sourcepub async fn get_card(
&self,
card_id: i64,
) -> Result<Response<ProjectCard>, ClientError>
pub async fn get_card( &self, card_id: i64, ) -> Result<Response<ProjectCard>, ClientError>
Get a project card.
This function performs a GET
to the /projects/columns/cards/{card_id}
endpoint.
FROM: https://docs.github.com/rest/reference/projects#get-a-project-card
Parameters:
card_id: i64
– card_id parameter.
Sourcepub async fn delete_card(
&self,
card_id: i64,
) -> Result<Response<()>, ClientError>
pub async fn delete_card( &self, card_id: i64, ) -> Result<Response<()>, ClientError>
Delete a project card.
This function performs a DELETE
to the /projects/columns/cards/{card_id}
endpoint.
FROM: https://docs.github.com/rest/reference/projects#delete-a-project-card
Parameters:
card_id: i64
– card_id parameter.
Sourcepub async fn update_card(
&self,
card_id: i64,
body: &ProjectsUpdateCardRequest,
) -> Result<Response<ProjectCard>, ClientError>
pub async fn update_card( &self, card_id: i64, body: &ProjectsUpdateCardRequest, ) -> Result<Response<ProjectCard>, ClientError>
Update an existing project card.
This function performs a PATCH
to the /projects/columns/cards/{card_id}
endpoint.
FROM: https://docs.github.com/rest/reference/projects#update-a-project-card
Parameters:
card_id: i64
– card_id parameter.
Sourcepub async fn move_card(
&self,
card_id: i64,
body: &ProjectsMoveCardRequest,
) -> Result<Response<()>, ClientError>
pub async fn move_card( &self, card_id: i64, body: &ProjectsMoveCardRequest, ) -> Result<Response<()>, ClientError>
Move a project card.
This function performs a POST
to the /projects/columns/cards/{card_id}/moves
endpoint.
FROM: https://docs.github.com/rest/reference/projects#move-a-project-card
Parameters:
card_id: i64
– card_id parameter.
Sourcepub async fn get_column(
&self,
column_id: i64,
) -> Result<Response<ProjectColumn>, ClientError>
pub async fn get_column( &self, column_id: i64, ) -> Result<Response<ProjectColumn>, ClientError>
Get a project column.
This function performs a GET
to the /projects/columns/{column_id}
endpoint.
FROM: https://docs.github.com/rest/reference/projects#get-a-project-column
Parameters:
column_id: i64
– column_id parameter.
Sourcepub async fn delete_column(
&self,
column_id: i64,
) -> Result<Response<()>, ClientError>
pub async fn delete_column( &self, column_id: i64, ) -> Result<Response<()>, ClientError>
Delete a project column.
This function performs a DELETE
to the /projects/columns/{column_id}
endpoint.
FROM: https://docs.github.com/rest/reference/projects#delete-a-project-column
Parameters:
column_id: i64
– column_id parameter.
Sourcepub async fn update_column(
&self,
column_id: i64,
body: &ProjectsUpdateColumnRequest,
) -> Result<Response<ProjectColumn>, ClientError>
pub async fn update_column( &self, column_id: i64, body: &ProjectsUpdateColumnRequest, ) -> Result<Response<ProjectColumn>, ClientError>
Update an existing project column.
This function performs a PATCH
to the /projects/columns/{column_id}
endpoint.
FROM: https://docs.github.com/rest/reference/projects#update-a-project-column
Parameters:
column_id: i64
– column_id parameter.
Sourcepub async fn list_cards(
&self,
column_id: i64,
archived_state: ArchivedState,
per_page: i64,
page: i64,
) -> Result<Response<Vec<ProjectCard>>, ClientError>
pub async fn list_cards( &self, column_id: i64, archived_state: ArchivedState, per_page: i64, page: i64, ) -> Result<Response<Vec<ProjectCard>>, ClientError>
List project cards.
This function performs a GET
to the /projects/columns/{column_id}/cards
endpoint.
FROM: https://docs.github.com/rest/reference/projects#list-project-cards
Parameters:
column_id: i64
– column_id parameter.archived_state: crate::types::ArchivedState
– Filters the project cards that are returned by the card’s state. Can be one ofall
,archived
, ornot_archived
.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Sourcepub async fn list_all_cards(
&self,
column_id: i64,
archived_state: ArchivedState,
) -> Result<Response<Vec<ProjectCard>>, ClientError>
pub async fn list_all_cards( &self, column_id: i64, archived_state: ArchivedState, ) -> Result<Response<Vec<ProjectCard>>, ClientError>
List project cards.
This function performs a GET
to the /projects/columns/{column_id}/cards
endpoint.
As opposed to list_cards
, this function returns all the pages of the request at once.
FROM: https://docs.github.com/rest/reference/projects#list-project-cards
Sourcepub async fn create_card(
&self,
column_id: i64,
body: &ProjectsCreateCardRequestOneOf,
) -> Result<Response<ProjectCard>, ClientError>
pub async fn create_card( &self, column_id: i64, body: &ProjectsCreateCardRequestOneOf, ) -> Result<Response<ProjectCard>, ClientError>
Create a project card.
This function performs a POST
to the /projects/columns/{column_id}/cards
endpoint.
FROM: https://docs.github.com/rest/reference/projects#create-a-project-card
Parameters:
column_id: i64
– column_id parameter.
Sourcepub async fn move_column(
&self,
column_id: i64,
body: &ProjectsMoveColumnRequest,
) -> Result<Response<()>, ClientError>
pub async fn move_column( &self, column_id: i64, body: &ProjectsMoveColumnRequest, ) -> Result<Response<()>, ClientError>
Move a project column.
This function performs a POST
to the /projects/columns/{column_id}/moves
endpoint.
FROM: https://docs.github.com/rest/reference/projects#move-a-project-column
Parameters:
column_id: i64
– column_id parameter.
Sourcepub async fn get(
&self,
project_id: i64,
) -> Result<Response<Project>, ClientError>
pub async fn get( &self, project_id: i64, ) -> Result<Response<Project>, ClientError>
Get a project.
This function performs a GET
to the /projects/{project_id}
endpoint.
Gets a project by its id
. Returns a 404 Not Found
status if projects are disabled. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
FROM: https://docs.github.com/rest/reference/projects#get-a-project
Parameters:
project_id: i64
Sourcepub async fn delete(&self, project_id: i64) -> Result<Response<()>, ClientError>
pub async fn delete(&self, project_id: i64) -> Result<Response<()>, ClientError>
Delete a project.
This function performs a DELETE
to the /projects/{project_id}
endpoint.
Deletes a project board. Returns a 404 Not Found
status if projects are disabled.
FROM: https://docs.github.com/rest/reference/projects#delete-a-project
Parameters:
project_id: i64
Sourcepub async fn update(
&self,
project_id: i64,
body: &ProjectsUpdateRequest,
) -> Result<Response<Project>, ClientError>
pub async fn update( &self, project_id: i64, body: &ProjectsUpdateRequest, ) -> Result<Response<Project>, ClientError>
Update a project.
This function performs a PATCH
to the /projects/{project_id}
endpoint.
Updates a project board’s information. Returns a 404 Not Found
status if projects are disabled. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
FROM: https://docs.github.com/rest/reference/projects#update-a-project
Parameters:
project_id: i64
Sourcepub async fn list_collaborators(
&self,
project_id: i64,
affiliation: Affiliation,
per_page: i64,
page: i64,
) -> Result<Response<Vec<SimpleUser>>, ClientError>
pub async fn list_collaborators( &self, project_id: i64, affiliation: Affiliation, per_page: i64, page: i64, ) -> Result<Response<Vec<SimpleUser>>, ClientError>
List project collaborators.
This function performs a GET
to the /projects/{project_id}/collaborators
endpoint.
Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project admin
to list collaborators.
FROM: https://docs.github.com/rest/reference/projects#list-project-collaborators
Parameters:
project_id: i64
affiliation: crate::types::Affiliation
– Filters the collaborators by their affiliation. Can be one of:
\*outside
: Outside collaborators of a project that are not a member of the project’s organization.
\*direct
: Collaborators with permissions to a project, regardless of organization membership status.
\*all
: All collaborators the authenticated user can see.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Sourcepub async fn list_all_collaborators(
&self,
project_id: i64,
affiliation: Affiliation,
) -> Result<Response<Vec<SimpleUser>>, ClientError>
pub async fn list_all_collaborators( &self, project_id: i64, affiliation: Affiliation, ) -> Result<Response<Vec<SimpleUser>>, ClientError>
List project collaborators.
This function performs a GET
to the /projects/{project_id}/collaborators
endpoint.
As opposed to list_collaborators
, this function returns all the pages of the request at once.
Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project admin
to list collaborators.
FROM: https://docs.github.com/rest/reference/projects#list-project-collaborators
Sourcepub async fn add_collaborator(
&self,
project_id: i64,
username: &str,
body: &ProjectsAddCollaboratorRequest,
) -> Result<Response<()>, ClientError>
pub async fn add_collaborator( &self, project_id: i64, username: &str, body: &ProjectsAddCollaboratorRequest, ) -> Result<Response<()>, ClientError>
Add project collaborator.
This function performs a PUT
to the /projects/{project_id}/collaborators/{username}
endpoint.
Adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project admin
to add a collaborator.
FROM: https://docs.github.com/rest/reference/projects#add-project-collaborator
Parameters:
project_id: i64
username: &str
Sourcepub async fn remove_collaborator(
&self,
project_id: i64,
username: &str,
) -> Result<Response<()>, ClientError>
pub async fn remove_collaborator( &self, project_id: i64, username: &str, ) -> Result<Response<()>, ClientError>
Remove user as a collaborator.
This function performs a DELETE
to the /projects/{project_id}/collaborators/{username}
endpoint.
Removes a collaborator from an organization project. You must be an organization owner or a project admin
to remove a collaborator.
FROM: https://docs.github.com/rest/reference/projects#remove-project-collaborator
Parameters:
project_id: i64
username: &str
Sourcepub async fn get_permission_for_user(
&self,
project_id: i64,
username: &str,
) -> Result<Response<RepositoryCollaboratorPermission>, ClientError>
pub async fn get_permission_for_user( &self, project_id: i64, username: &str, ) -> Result<Response<RepositoryCollaboratorPermission>, ClientError>
Get project permission for a user.
This function performs a GET
to the /projects/{project_id}/collaborators/{username}/permission
endpoint.
Returns the collaborator’s permission level for an organization project. Possible values for the permission
key: admin
, write
, read
, none
. You must be an organization owner or a project admin
to review a user’s permission level.
FROM: https://docs.github.com/rest/reference/projects#get-project-permission-for-a-user
Parameters:
project_id: i64
username: &str
Sourcepub async fn list_columns(
&self,
project_id: i64,
per_page: i64,
page: i64,
) -> Result<Response<Vec<ProjectColumn>>, ClientError>
pub async fn list_columns( &self, project_id: i64, per_page: i64, page: i64, ) -> Result<Response<Vec<ProjectColumn>>, ClientError>
List project columns.
This function performs a GET
to the /projects/{project_id}/columns
endpoint.
FROM: https://docs.github.com/rest/reference/projects#list-project-columns
Parameters:
project_id: i64
per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Sourcepub async fn list_all_columns(
&self,
project_id: i64,
) -> Result<Response<Vec<ProjectColumn>>, ClientError>
pub async fn list_all_columns( &self, project_id: i64, ) -> Result<Response<Vec<ProjectColumn>>, ClientError>
List project columns.
This function performs a GET
to the /projects/{project_id}/columns
endpoint.
As opposed to list_columns
, this function returns all the pages of the request at once.
FROM: https://docs.github.com/rest/reference/projects#list-project-columns
Sourcepub async fn create_column(
&self,
project_id: i64,
body: &ProjectsUpdateColumnRequest,
) -> Result<Response<ProjectColumn>, ClientError>
pub async fn create_column( &self, project_id: i64, body: &ProjectsUpdateColumnRequest, ) -> Result<Response<ProjectColumn>, ClientError>
Create a project column.
This function performs a POST
to the /projects/{project_id}/columns
endpoint.
FROM: https://docs.github.com/rest/reference/projects#create-a-project-column
Parameters:
project_id: i64
Sourcepub async fn list_for_repo(
&self,
owner: &str,
repo: &str,
state: IssuesListState,
per_page: i64,
page: i64,
) -> Result<Response<Vec<Project>>, ClientError>
pub async fn list_for_repo( &self, owner: &str, repo: &str, state: IssuesListState, per_page: i64, page: i64, ) -> Result<Response<Vec<Project>>, ClientError>
List repository projects.
This function performs a GET
to the /repos/{owner}/{repo}/projects
endpoint.
Lists the projects in a repository. Returns a 404 Not Found
status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
FROM: https://docs.github.com/rest/reference/projects#list-repository-projects
Parameters:
owner: &str
repo: &str
state: crate::types::IssuesListState
– Indicates the state of the issues to return. Can be eitheropen
,closed
, orall
.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Sourcepub async fn list_all_for_repo(
&self,
owner: &str,
repo: &str,
state: IssuesListState,
) -> Result<Response<Vec<Project>>, ClientError>
pub async fn list_all_for_repo( &self, owner: &str, repo: &str, state: IssuesListState, ) -> Result<Response<Vec<Project>>, ClientError>
List repository projects.
This function performs a GET
to the /repos/{owner}/{repo}/projects
endpoint.
As opposed to list_for_repo
, this function returns all the pages of the request at once.
Lists the projects in a repository. Returns a 404 Not Found
status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
FROM: https://docs.github.com/rest/reference/projects#list-repository-projects
Sourcepub async fn create_for_repo(
&self,
owner: &str,
repo: &str,
body: &ProjectsCreateRequest,
) -> Result<Response<Project>, ClientError>
pub async fn create_for_repo( &self, owner: &str, repo: &str, body: &ProjectsCreateRequest, ) -> Result<Response<Project>, ClientError>
Create a repository project.
This function performs a POST
to the /repos/{owner}/{repo}/projects
endpoint.
Creates a repository project board. Returns a 404 Not Found
status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a 401 Unauthorized
or 410 Gone
status is returned.
FROM: https://docs.github.com/rest/reference/projects#create-a-repository-project
Parameters:
owner: &str
repo: &str
Sourcepub async fn create_for_authenticated_user(
&self,
body: &ProjectsCreateRequest,
) -> Result<Response<Project>, ClientError>
pub async fn create_for_authenticated_user( &self, body: &ProjectsCreateRequest, ) -> Result<Response<Project>, ClientError>
Create a user project.
This function performs a POST
to the /user/projects
endpoint.
FROM: https://docs.github.com/rest/reference/projects#create-a-user-project
Sourcepub async fn list_for_user(
&self,
username: &str,
state: IssuesListState,
per_page: i64,
page: i64,
) -> Result<Response<Vec<Project>>, ClientError>
pub async fn list_for_user( &self, username: &str, state: IssuesListState, per_page: i64, page: i64, ) -> Result<Response<Vec<Project>>, ClientError>
List user projects.
This function performs a GET
to the /users/{username}/projects
endpoint.
FROM: https://docs.github.com/rest/reference/projects#list-user-projects
Parameters:
username: &str
state: crate::types::IssuesListState
– Indicates the state of the issues to return. Can be eitheropen
,closed
, orall
.per_page: i64
– Results per page (max 100).page: i64
– Page number of the results to fetch.
Sourcepub async fn list_all_for_user(
&self,
username: &str,
state: IssuesListState,
) -> Result<Response<Vec<Project>>, ClientError>
pub async fn list_all_for_user( &self, username: &str, state: IssuesListState, ) -> Result<Response<Vec<Project>>, ClientError>
List user projects.
This function performs a GET
to the /users/{username}/projects
endpoint.
As opposed to list_for_user
, this function returns all the pages of the request at once.
FROM: https://docs.github.com/rest/reference/projects#list-user-projects