pub struct GiteeClient { /* private fields */ }Expand description
Gitee API Client
Implementations§
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn get_authenticated_user(&self) -> Result<User, GiteeError>
pub async fn get_authenticated_user(&self) -> Result<User, GiteeError>
Get authenticated user information (current user)
Sourcepub async fn get_user_info(&self, username: &str) -> Result<User, GiteeError>
pub async fn get_user_info(&self, username: &str) -> Result<User, GiteeError>
Get user information by username
Sourcepub async fn search_users(
&self,
query: &str,
) -> Result<Vec<SearchUserResult>, GiteeError>
pub async fn search_users( &self, query: &str, ) -> Result<Vec<SearchUserResult>, GiteeError>
Search users
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn get_repo(
&self,
owner: &str,
repo: &str,
) -> Result<Repository, GiteeError>
pub async fn get_repo( &self, owner: &str, repo: &str, ) -> Result<Repository, GiteeError>
Get repository information
Sourcepub async fn create_user_repo(
&self,
name: &str,
description: Option<&str>,
private: bool,
) -> Result<Repository, GiteeError>
pub async fn create_user_repo( &self, name: &str, description: Option<&str>, private: bool, ) -> Result<Repository, GiteeError>
Create a new user repository
Sourcepub async fn create_org_repo(
&self,
org: &str,
name: &str,
description: Option<&str>,
private: bool,
) -> Result<Repository, GiteeError>
pub async fn create_org_repo( &self, org: &str, name: &str, description: Option<&str>, private: bool, ) -> Result<Repository, GiteeError>
Create a new organization repository
Sourcepub async fn create_enterprise_repo(
&self,
enterprise: &str,
name: &str,
description: Option<&str>,
private: bool,
) -> Result<Repository, GiteeError>
pub async fn create_enterprise_repo( &self, enterprise: &str, name: &str, description: Option<&str>, private: bool, ) -> Result<Repository, GiteeError>
Create a new enterprise repository
Sourcepub async fn list_user_repos(&self) -> Result<Vec<Repository>, GiteeError>
pub async fn list_user_repos(&self) -> Result<Vec<Repository>, GiteeError>
List user repositories
Sourcepub async fn fork_repository(
&self,
owner: &str,
repo: &str,
) -> Result<Repository, GiteeError>
pub async fn fork_repository( &self, owner: &str, repo: &str, ) -> Result<Repository, GiteeError>
Fork a repository
Sourcepub async fn search_repositories(
&self,
query: &str,
from: Option<i32>,
size: Option<i32>,
sort: Option<&str>,
) -> Result<Vec<Repository>, GiteeError>
pub async fn search_repositories( &self, query: &str, from: Option<i32>, size: Option<i32>, sort: Option<&str>, ) -> Result<Vec<Repository>, GiteeError>
Search repositories (Open source)
Sourcepub async fn delete_repo(
&self,
owner: &str,
repo: &str,
) -> Result<(), GiteeError>
pub async fn delete_repo( &self, owner: &str, repo: &str, ) -> Result<(), GiteeError>
Delete a repository
Sourcepub async fn star_repo(&self, owner: &str, repo: &str) -> Result<(), GiteeError>
pub async fn star_repo(&self, owner: &str, repo: &str) -> Result<(), GiteeError>
Star a repository
Sourcepub async fn unstar_repo(
&self,
owner: &str,
repo: &str,
) -> Result<(), GiteeError>
pub async fn unstar_repo( &self, owner: &str, repo: &str, ) -> Result<(), GiteeError>
Unstar a repository
Sourcepub async fn watch_repo(
&self,
owner: &str,
repo: &str,
) -> Result<(), GiteeError>
pub async fn watch_repo( &self, owner: &str, repo: &str, ) -> Result<(), GiteeError>
Watch a repository
Sourcepub async fn unwatch_repo(
&self,
owner: &str,
repo: &str,
) -> Result<(), GiteeError>
pub async fn unwatch_repo( &self, owner: &str, repo: &str, ) -> Result<(), GiteeError>
Unwatch a repository
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn list_issues(
&self,
options: Option<IssueListOptions>,
) -> Result<Vec<Issue>, GiteeError>
pub async fn list_issues( &self, options: Option<IssueListOptions>, ) -> Result<Vec<Issue>, GiteeError>
List all issues
Sourcepub async fn list_repo_issues(
&self,
owner: &str,
repo: &str,
options: Option<IssueListOptions>,
) -> Result<Vec<Issue>, GiteeError>
pub async fn list_repo_issues( &self, owner: &str, repo: &str, options: Option<IssueListOptions>, ) -> Result<Vec<Issue>, GiteeError>
List repository issues
Sourcepub async fn create_issue(
&self,
repo_owner: &str,
repo_name: &str,
title: &str,
body: Option<&str>,
) -> Result<Issue, GiteeError>
pub async fn create_issue( &self, repo_owner: &str, repo_name: &str, title: &str, body: Option<&str>, ) -> Result<Issue, GiteeError>
Create a new issue
Sourcepub async fn close_issue(
&self,
repo_owner: &str,
repo_name: &str,
issue_number: &str,
) -> Result<Issue, GiteeError>
pub async fn close_issue( &self, repo_owner: &str, repo_name: &str, issue_number: &str, ) -> Result<Issue, GiteeError>
Close an issue by setting its state to “closed”
Sourcepub async fn update_issue(
&self,
owner: &str,
repo: &str,
number: &str,
title: Option<&str>,
body: Option<&str>,
state: Option<&str>,
) -> Result<Issue, GiteeError>
pub async fn update_issue( &self, owner: &str, repo: &str, number: &str, title: Option<&str>, body: Option<&str>, state: Option<&str>, ) -> Result<Issue, GiteeError>
Update an issue
Sourcepub async fn get_issue_detail(
&self,
owner: &str,
repo: &str,
number: &str,
) -> Result<Issue, GiteeError>
pub async fn get_issue_detail( &self, owner: &str, repo: &str, number: &str, ) -> Result<Issue, GiteeError>
Get issue detail
Sourcepub async fn comment_issue(
&self,
owner: &str,
repo: &str,
number: &str,
body: &str,
) -> Result<Comment, GiteeError>
pub async fn comment_issue( &self, owner: &str, repo: &str, number: &str, body: &str, ) -> Result<Comment, GiteeError>
Comment on an issue
Sourcepub async fn list_issue_comments(
&self,
owner: &str,
repo: &str,
number: &str,
) -> Result<Vec<Comment>, GiteeError>
pub async fn list_issue_comments( &self, owner: &str, repo: &str, number: &str, ) -> Result<Vec<Comment>, GiteeError>
List issue comments
Sourcepub async fn list_repo_milestones(
&self,
owner: &str,
repo: &str,
state: Option<&str>,
) -> Result<Vec<Milestone>, GiteeError>
pub async fn list_repo_milestones( &self, owner: &str, repo: &str, state: Option<&str>, ) -> Result<Vec<Milestone>, GiteeError>
List repository milestones
Sourcepub async fn create_milestone(
&self,
owner: &str,
repo: &str,
title: &str,
description: Option<&str>,
due_on: Option<&str>,
) -> Result<Milestone, GiteeError>
pub async fn create_milestone( &self, owner: &str, repo: &str, title: &str, description: Option<&str>, due_on: Option<&str>, ) -> Result<Milestone, GiteeError>
Create a new milestone
Sourcepub async fn get_milestone(
&self,
owner: &str,
repo: &str,
number: i32,
) -> Result<Milestone, GiteeError>
pub async fn get_milestone( &self, owner: &str, repo: &str, number: i32, ) -> Result<Milestone, GiteeError>
Get a milestone by number
Sourcepub async fn update_milestone(
&self,
owner: &str,
repo: &str,
number: i32,
title: Option<&str>,
description: Option<&str>,
state: Option<&str>,
) -> Result<Milestone, GiteeError>
pub async fn update_milestone( &self, owner: &str, repo: &str, number: i32, title: Option<&str>, description: Option<&str>, state: Option<&str>, ) -> Result<Milestone, GiteeError>
Update a milestone
Sourcepub async fn delete_milestone(
&self,
owner: &str,
repo: &str,
number: i32,
) -> Result<(), GiteeError>
pub async fn delete_milestone( &self, owner: &str, repo: &str, number: i32, ) -> Result<(), GiteeError>
Delete a milestone
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn list_pulls(
&self,
owner: &str,
repo: &str,
options: Option<PullListOptions>,
) -> Result<Vec<PullRequest>, GiteeError>
pub async fn list_pulls( &self, owner: &str, repo: &str, options: Option<PullListOptions>, ) -> Result<Vec<PullRequest>, GiteeError>
List all pull requests for a repository
Sourcepub async fn create_pull(
&self,
owner: &str,
repo: &str,
title: &str,
head: &str,
base: &str,
body: Option<&str>,
) -> Result<PullRequest, GiteeError>
pub async fn create_pull( &self, owner: &str, repo: &str, title: &str, head: &str, base: &str, body: Option<&str>, ) -> Result<PullRequest, GiteeError>
Create a new pull request
Sourcepub async fn close_pull(
&self,
owner: &str,
repo: &str,
pull_number: &str,
) -> Result<PullRequest, GiteeError>
pub async fn close_pull( &self, owner: &str, repo: &str, pull_number: &str, ) -> Result<PullRequest, GiteeError>
Close a pull request by setting its state to “closed”
Sourcepub async fn merge_pull(
&self,
owner: &str,
repo: &str,
pull_number: &str,
) -> Result<PullRequest, GiteeError>
pub async fn merge_pull( &self, owner: &str, repo: &str, pull_number: &str, ) -> Result<PullRequest, GiteeError>
Merge a pull request
Sourcepub async fn get_pull_detail(
&self,
owner: &str,
repo: &str,
number: &str,
) -> Result<PullRequest, GiteeError>
pub async fn get_pull_detail( &self, owner: &str, repo: &str, number: &str, ) -> Result<PullRequest, GiteeError>
Get pull request detail
Sourcepub async fn update_pull(
&self,
owner: &str,
repo: &str,
number: &str,
title: Option<&str>,
body: Option<&str>,
state: Option<&str>,
) -> Result<PullRequest, GiteeError>
pub async fn update_pull( &self, owner: &str, repo: &str, number: &str, title: Option<&str>, body: Option<&str>, state: Option<&str>, ) -> Result<PullRequest, GiteeError>
Update a pull request
Sourcepub async fn comment_pull(
&self,
owner: &str,
repo: &str,
number: &str,
body: &str,
) -> Result<Comment, GiteeError>
pub async fn comment_pull( &self, owner: &str, repo: &str, number: &str, body: &str, ) -> Result<Comment, GiteeError>
Comment on a pull request
Sourcepub async fn list_pull_comments(
&self,
owner: &str,
repo: &str,
number: &str,
) -> Result<Vec<Comment>, GiteeError>
pub async fn list_pull_comments( &self, owner: &str, repo: &str, number: &str, ) -> Result<Vec<Comment>, GiteeError>
List pull request comments
Sourcepub async fn get_diff_files(
&self,
owner: &str,
repo: &str,
number: &str,
) -> Result<Vec<FileDiff>, GiteeError>
pub async fn get_diff_files( &self, owner: &str, repo: &str, number: &str, ) -> Result<Vec<FileDiff>, GiteeError>
Get diff files for a pull request
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn list_labels(
&self,
owner: &str,
repo: &str,
) -> Result<Vec<Label>, GiteeError>
pub async fn list_labels( &self, owner: &str, repo: &str, ) -> Result<Vec<Label>, GiteeError>
List all labels in a repository
Sourcepub async fn create_label(
&self,
owner: &str,
repo: &str,
name: &str,
color: &str,
description: Option<&str>,
) -> Result<Label, GiteeError>
pub async fn create_label( &self, owner: &str, repo: &str, name: &str, color: &str, description: Option<&str>, ) -> Result<Label, GiteeError>
Create a new label in a repository
Sourcepub async fn update_label(
&self,
owner: &str,
repo: &str,
name: &str,
new_name: Option<&str>,
color: Option<&str>,
description: Option<&str>,
) -> Result<Label, GiteeError>
pub async fn update_label( &self, owner: &str, repo: &str, name: &str, new_name: Option<&str>, color: Option<&str>, description: Option<&str>, ) -> Result<Label, GiteeError>
Update a label in a repository
Sourcepub async fn delete_label(
&self,
owner: &str,
repo: &str,
name: &str,
) -> Result<(), GiteeError>
pub async fn delete_label( &self, owner: &str, repo: &str, name: &str, ) -> Result<(), GiteeError>
Delete a label from a repository
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn get_file_content(
&self,
owner: &str,
repo: &str,
file_path: &str,
ref: Option<&str>,
) -> Result<FileContent, GiteeError>
pub async fn get_file_content( &self, owner: &str, repo: &str, file_path: &str, ref: Option<&str>, ) -> Result<FileContent, GiteeError>
Get file content
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn list_user_notifications(
&self,
) -> Result<Vec<Notification>, GiteeError>
pub async fn list_user_notifications( &self, ) -> Result<Vec<Notification>, GiteeError>
List user notifications
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn create_release(
&self,
owner: &str,
repo: &str,
tag_name: &str,
name: &str,
body: Option<&str>,
) -> Result<Release, GiteeError>
pub async fn create_release( &self, owner: &str, repo: &str, tag_name: &str, name: &str, body: Option<&str>, ) -> Result<Release, GiteeError>
Create a release
Sourcepub async fn list_releases(
&self,
owner: &str,
repo: &str,
) -> Result<Vec<Release>, GiteeError>
pub async fn list_releases( &self, owner: &str, repo: &str, ) -> Result<Vec<Release>, GiteeError>
List releases
Source§impl GiteeClient
impl GiteeClient
Sourcepub async fn list_repo_wikis(
&self,
owner: &str,
repo: &str,
) -> Result<Vec<WikiPage>, GiteeError>
pub async fn list_repo_wikis( &self, owner: &str, repo: &str, ) -> Result<Vec<WikiPage>, GiteeError>
List all wiki pages for a repository by cloning it locally
Sourcepub async fn get_repo_wiki(
&self,
owner: &str,
repo: &str,
slug: &str,
) -> Result<WikiPage, GiteeError>
pub async fn get_repo_wiki( &self, owner: &str, repo: &str, slug: &str, ) -> Result<WikiPage, GiteeError>
Get a single wiki page content
Sourcepub async fn create_repo_wiki(
&self,
owner: &str,
repo: &str,
title: &str,
body: &str,
) -> Result<WikiPage, GiteeError>
pub async fn create_repo_wiki( &self, owner: &str, repo: &str, title: &str, body: &str, ) -> Result<WikiPage, GiteeError>
Create or Update a wiki page
Sourcepub async fn update_repo_wiki(
&self,
owner: &str,
repo: &str,
_slug: &str,
title: &str,
body: &str,
) -> Result<WikiPage, GiteeError>
pub async fn update_repo_wiki( &self, owner: &str, repo: &str, _slug: &str, title: &str, body: &str, ) -> Result<WikiPage, GiteeError>
Update a wiki page (alias to create_repo_wiki)
Sourcepub async fn delete_repo_wiki(
&self,
owner: &str,
repo: &str,
slug: &str,
) -> Result<(), GiteeError>
pub async fn delete_repo_wiki( &self, owner: &str, repo: &str, slug: &str, ) -> Result<(), GiteeError>
Delete a wiki page