nipaw_core 0.12.2

一个git平台的api封装库,core实现
Documentation
use crate::option::{CreateIssueOptions, IssueListOptions, UpdateIssueOptions};
use crate::types::issue::IssueInfo;
use async_trait::async_trait;

#[async_trait]
pub trait Issue: Send + Sync {
	/// 创建一个issue
	///
	/// ## 参数
	/// - `repo_path` - 仓库路径,格式为 `(owner, repo)`
	/// - `title` - issue标题
	/// - `body` - issue内容
	/// - `option` - 创建issue选项, 详见 [CreateIssueOptions]
	///
	async fn create(
		&self,
		repo_path: (&str, &str),
		title: &str,
		body: Option<&str>,
		option: Option<CreateIssueOptions>,
	) -> crate::Result<IssueInfo>;

	/// 获取issue信息
	///
	/// ## 参数
	/// - `repo_path` - 仓库路径,格式为 `(owner, repo)`
	/// - `issue_number` - issue编号
	///
	async fn info(
		&self,
		repo_path: (&str, &str),
		issue_number: &str,
	) -> crate::Result<IssueInfo>;

	/// 获取仓库所有issue信息
	///
	/// ## 参数
	/// - `repo_path` - 仓库路径,格式为 `(owner, repo)`
	async fn list(
		&self,
		repo_path: (&str, &str),
		options: Option<IssueListOptions>,
	) -> crate::Result<Vec<IssueInfo>>;

	/// 更新issue信息
	///
	/// ## 参数
	/// - `repo_path` - 仓库路径,格式为 `(owner, repo)`
	/// - `issue_number` - issue编号
	/// - `options` - 更新issue选项, 详见 [UpdateIssueOptions]
	///
	async fn update(
		&self,
		repo_path: (&str, &str),
		issue_number: &str,
		options: Option<UpdateIssueOptions>,
	) -> crate::Result<IssueInfo>;
}