use std::sync::Arc; use async_trait::async_trait; use gitea_raw_client::{apis::Error, models}; pub use gitea_raw_client::apis::repository_api::*; #[async_trait] pub trait Repository { async fn accept_transfer( &self, owner: &str, repo: &str, ) -> Result>; async fn create_current_user_repo( &self, body: Option, ) -> Result>; async fn create_fork( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn generate_repo( &self, template_owner: &str, template_repo: &str, body: Option, ) -> Result>; async fn get_annotated_tag( &self, owner: &str, repo: &str, sha: &str, ) -> Result>; async fn get_blob( &self, owner: &str, repo: &str, sha: &str, ) -> Result>; async fn get_tree( &self, owner: &str, repo: &str, sha: &str, recursive: Option, page: Option, per_page: Option, ) -> Result>; async fn list_forks( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result, Error>; async fn reject_transfer( &self, owner: &str, repo: &str, ) -> Result>; async fn add_collaborator( &self, owner: &str, repo: &str, collaborator: &str, body: Option, ) -> Result<(), Error>; async fn add_team( &self, owner: &str, repo: &str, team: &str, ) -> Result<(), Error>; async fn add_topic( &self, owner: &str, repo: &str, topic: &str, ) -> Result<(), Error>; async fn apply_diff_patch( &self, owner: &str, repo: &str, body: models::UpdateFileOptions, ) -> Result>; async fn cancel_scheduled_auto_merge( &self, owner: &str, repo: &str, index: i64, ) -> Result<(), Error>; async fn check_collaborator( &self, owner: &str, repo: &str, collaborator: &str, ) -> Result<(), Error>; async fn check_team( &self, owner: &str, repo: &str, team: &str, ) -> Result>; async fn create_branch( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn create_branch_protection( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn create_file( &self, owner: &str, repo: &str, filepath: &str, body: models::CreateFileOptions, ) -> Result>; async fn create_hook( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn create_key( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn create_pull_request( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn create_pull_review( &self, owner: &str, repo: &str, index: i64, body: models::CreatePullReviewOptions, ) -> Result>; async fn create_pull_review_requests( &self, owner: &str, repo: &str, index: i64, body: models::PullReviewRequestOptions, ) -> Result, Error>; async fn create_release( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn create_release_attachment( &self, owner: &str, repo: &str, id: i64, attachment: std::path::PathBuf, name: Option<&str>, ) -> Result>; async fn create_status( &self, owner: &str, repo: &str, sha: &str, body: Option, ) -> Result>; async fn create_tag( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn create_wiki_page( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn delete(&self, owner: &str, repo: &str) -> Result<(), Error>; async fn delete_branch( &self, owner: &str, repo: &str, branch: &str, ) -> Result<(), Error>; async fn delete_branch_protection( &self, owner: &str, repo: &str, name: &str, ) -> Result<(), Error>; async fn delete_collaborator( &self, owner: &str, repo: &str, collaborator: &str, ) -> Result<(), Error>; async fn delete_file( &self, owner: &str, repo: &str, filepath: &str, body: models::DeleteFileOptions, ) -> Result>; async fn delete_git_hook( &self, owner: &str, repo: &str, id: &str, ) -> Result<(), Error>; async fn delete_hook( &self, owner: &str, repo: &str, id: i64, ) -> Result<(), Error>; async fn delete_key( &self, owner: &str, repo: &str, id: i64, ) -> Result<(), Error>; async fn delete_pull_review( &self, owner: &str, repo: &str, index: i64, id: i64, ) -> Result<(), Error>; async fn delete_pull_review_requests( &self, owner: &str, repo: &str, index: i64, body: models::PullReviewRequestOptions, ) -> Result<(), Error>; async fn delete_release( &self, owner: &str, repo: &str, id: i64, ) -> Result<(), Error>; async fn delete_release_attachment( &self, owner: &str, repo: &str, id: i64, attachment_id: i64, ) -> Result<(), Error>; async fn delete_release_by_tag( &self, owner: &str, repo: &str, tag: &str, ) -> Result<(), Error>; async fn delete_tag( &self, owner: &str, repo: &str, tag: &str, ) -> Result<(), Error>; async fn delete_team( &self, owner: &str, repo: &str, team: &str, ) -> Result<(), Error>; async fn delete_topic( &self, owner: &str, repo: &str, topic: &str, ) -> Result<(), Error>; async fn delete_wiki_page( &self, owner: &str, repo: &str, page_name: &str, ) -> Result<(), Error>; async fn dismiss_pull_review( &self, owner: &str, repo: &str, index: i64, id: i64, body: models::DismissPullReviewOptions, ) -> Result>; async fn download_commit_diff_or_patch( &self, owner: &str, repo: &str, sha: &str, diff_type: &str, ) -> Result>; async fn download_pull_diff_or_patch( &self, owner: &str, repo: &str, index: i64, diff_type: &str, binary: Option, ) -> Result>; async fn edit( &self, owner: &str, repo: &str, body: Option, ) -> Result>; async fn edit_branch_protection( &self, owner: &str, repo: &str, name: &str, body: Option, ) -> Result>; async fn edit_git_hook( &self, owner: &str, repo: &str, id: &str, body: Option, ) -> Result>; async fn edit_hook( &self, owner: &str, repo: &str, id: i64, body: Option, ) -> Result>; async fn edit_pull_request( &self, owner: &str, repo: &str, index: i64, body: Option, ) -> Result>; async fn edit_release( &self, owner: &str, repo: &str, id: i64, body: Option, ) -> Result>; async fn edit_release_attachment( &self, owner: &str, repo: &str, id: i64, attachment_id: i64, body: Option, ) -> Result>; async fn edit_wiki_page( &self, owner: &str, repo: &str, page_name: &str, body: Option, ) -> Result>; async fn get(&self, owner: &str, repo: &str) -> Result>; async fn get_all_commits( &self, owner: &str, repo: &str, sha: Option<&str>, path: Option<&str>, page: Option, limit: Option, ) -> Result, Error>; async fn get_archive( &self, owner: &str, repo: &str, archive: &str, ) -> Result<(), Error>; async fn get_assignees( &self, owner: &str, repo: &str, ) -> Result, Error>; async fn get_branch( &self, owner: &str, repo: &str, branch: &str, ) -> Result>; async fn get_branch_protection( &self, owner: &str, repo: &str, name: &str, ) -> Result>; async fn get_by_id(&self, id: i64) -> Result>; async fn get_combined_status_by_ref( &self, owner: &str, repo: &str, r#ref: &str, page: Option, limit: Option, ) -> Result>; async fn get_contents( &self, owner: &str, repo: &str, filepath: &str, r#ref: Option<&str>, ) -> Result>; async fn get_contents_list( &self, owner: &str, repo: &str, r#ref: Option<&str>, ) -> Result, Error>; async fn get_editor_config( &self, owner: &str, repo: &str, filepath: &str, r#ref: Option<&str>, ) -> Result<(), Error>; async fn get_git_hook( &self, owner: &str, repo: &str, id: &str, ) -> Result>; async fn get_hook( &self, owner: &str, repo: &str, id: i64, ) -> Result>; async fn get_issue_templates( &self, owner: &str, repo: &str, ) -> Result, Error>; async fn get_key( &self, owner: &str, repo: &str, id: i64, ) -> Result>; async fn get_languages( &self, owner: &str, repo: &str, ) -> Result<::std::collections::HashMap, Error>; async fn get_note( &self, owner: &str, repo: &str, sha: &str, ) -> Result>; async fn get_pull_request( &self, owner: &str, repo: &str, index: i64, ) -> Result>; async fn get_pull_request_commits( &self, owner: &str, repo: &str, index: i64, page: Option, limit: Option, ) -> Result, Error>; async fn get_pull_review( &self, owner: &str, repo: &str, index: i64, id: i64, ) -> Result>; async fn get_pull_review_comments( &self, owner: &str, repo: &str, index: i64, id: i64, ) -> Result, Error>; async fn get_raw_file( &self, owner: &str, repo: &str, filepath: &str, r#ref: Option<&str>, ) -> Result<(), Error>; async fn get_raw_file_or_lfs( &self, owner: &str, repo: &str, filepath: &str, r#ref: Option<&str>, ) -> Result<(), Error>; async fn get_release( &self, owner: &str, repo: &str, id: i64, ) -> Result>; async fn get_release_attachment( &self, owner: &str, repo: &str, id: i64, attachment_id: i64, ) -> Result>; async fn get_release_by_tag( &self, owner: &str, repo: &str, tag: &str, ) -> Result>; async fn get_repo_permissions( &self, owner: &str, repo: &str, collaborator: &str, ) -> Result>; async fn get_reviewers( &self, owner: &str, repo: &str, ) -> Result, Error>; async fn get_single_commit( &self, owner: &str, repo: &str, sha: &str, ) -> Result>; async fn get_tag( &self, owner: &str, repo: &str, tag: &str, ) -> Result>; async fn get_wiki_page( &self, owner: &str, repo: &str, page_name: &str, ) -> Result>; async fn get_wiki_page_revisions( &self, owner: &str, repo: &str, page_name: &str, page: Option, ) -> Result>; async fn get_wiki_pages( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result, Error>; async fn list_all_git_refs( &self, owner: &str, repo: &str, ) -> Result, Error>; async fn list_branch_protection( &self, owner: &str, repo: &str, ) -> Result, Error>; async fn list_branches( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result, Error>; async fn list_collaborators( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result, Error>; async fn list_git_hooks( &self, owner: &str, repo: &str, ) -> Result, Error>; async fn list_git_refs( &self, owner: &str, repo: &str, r#ref: &str, ) -> Result, Error>; async fn list_hooks( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result, Error>; async fn list_keys( &self, owner: &str, repo: &str, key_id: Option, fingerprint: Option<&str>, page: Option, limit: Option, ) -> Result, Error>; async fn list_pull_requests( &self, owner: &str, repo: &str, state: Option<&str>, sort: Option<&str>, milestone: Option, labels: Option>, page: Option, limit: Option, ) -> Result, Error>; async fn list_pull_reviews( &self, owner: &str, repo: &str, index: i64, page: Option, limit: Option, ) -> Result, Error>; async fn list_release_attachments( &self, owner: &str, repo: &str, id: i64, ) -> Result, Error>; async fn list_releases( &self, owner: &str, repo: &str, draft: Option, pre_release: Option, per_page: Option, page: Option, limit: Option, ) -> Result, Error>; async fn list_stargazers( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result, Error>; async fn list_statuses( &self, owner: &str, repo: &str, sha: &str, sort: Option<&str>, state: Option<&str>, page: Option, limit: Option, ) -> Result, Error>; async fn list_statuses_by_ref( &self, owner: &str, repo: &str, r#ref: &str, sort: Option<&str>, state: Option<&str>, page: Option, limit: Option, ) -> Result, Error>; async fn list_subscribers( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result, Error>; async fn list_tags( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result, Error>; async fn list_teams( &self, owner: &str, repo: &str, ) -> Result, Error>; async fn list_topics( &self, owner: &str, repo: &str, page: Option, limit: Option, ) -> Result>; async fn merge_pull_request( &self, owner: &str, repo: &str, index: i64, body: Option, ) -> Result<(), Error>; async fn migrate( &self, body: Option, ) -> Result>; async fn mirror_sync(&self, owner: &str, repo: &str) -> Result<(), Error>; async fn pull_request_is_merged( &self, owner: &str, repo: &str, index: i64, ) -> Result<(), Error>; async fn search( &self, q: Option<&str>, topic: Option, include_desc: Option, uid: Option, priority_owner_id: Option, team_id: Option, starred_by: Option, private: Option, is_private: Option, template: Option, archived: Option, mode: Option<&str>, exclusive: Option, sort: Option<&str>, order: Option<&str>, page: Option, limit: Option, ) -> Result>; async fn signing_key( &self, owner: &str, repo: &str, ) -> Result>; async fn submit_pull_review( &self, owner: &str, repo: &str, index: i64, id: i64, body: models::SubmitPullReviewOptions, ) -> Result>; async fn test_hook( &self, owner: &str, repo: &str, id: i64, r#ref: Option<&str>, ) -> Result<(), Error>; async fn tracked_times( &self, owner: &str, repo: &str, user: Option<&str>, since: Option, before: Option, page: Option, limit: Option, ) -> Result, Error>; async fn transfer( &self, owner: &str, repo: &str, body: models::TransferRepoOption, ) -> Result>; async fn un_dismiss_pull_review( &self, owner: &str, repo: &str, index: i64, id: i64, ) -> Result>; async fn update_file( &self, owner: &str, repo: &str, filepath: &str, body: models::UpdateFileOptions, ) -> Result>; async fn update_pull_request( &self, owner: &str, repo: &str, index: i64, style: Option<&str>, ) -> Result<(), Error>; async fn update_topics( &self, owner: &str, repo: &str, body: Option, ) -> Result<(), Error>; async fn topic_search( &self, q: &str, page: Option, limit: Option, ) -> Result, Error>; async fn user_current_check_subscription( &self, owner: &str, repo: &str, ) -> Result>; async fn user_current_delete_subscription( &self, owner: &str, repo: &str, ) -> Result<(), Error>; async fn user_current_put_subscription( &self, owner: &str, repo: &str, ) -> Result>; async fn user_tracked_times( &self, owner: &str, repo: &str, user: &str, ) -> Result, Error>; } pub type DynRepository = Arc;