use super::*; impl Forgejo { pub async fn get_repo_issues(&mut self, owner: &str, repo: &str, query: IssueQuery) -> Result, ForgejoError> { self.get(&query.to_string(owner, repo)).await } pub async fn create_issue(&mut self, owner: &str, repo: &str, opts: CreateIssueOption) -> Result { self.post(&format!("/repos/{owner}/{repo}/issues"), &opts).await } pub async fn get_issue(&mut self, owner: &str, repo: &str, id: u64) -> Result, ForgejoError> { self.get_opt(&format!("/repos/{owner}/{repo}/issues/{id}")).await } pub async fn delete_issue(&mut self, owner: &str, repo: &str, id: u64) -> Result<(), ForgejoError> { self.delete(&format!("/repos/{owner}/{repo}/issues/{id}")).await } pub async fn edit_issue(&mut self, owner: &str, repo: &str, id: u64, opts: EditIssueOption) -> Result<(), ForgejoError> { self.patch(&format!("/repos/{owner}/{repo}/issues/{id}"), &opts).await } } #[derive(serde::Deserialize, Debug, PartialEq)] pub struct Issue { pub assets: Vec, pub assignee: User, pub assignees: Vec, pub body: String, #[serde(with = "time::serde::rfc3339")] pub closed_at: time::OffsetDateTime, pub comments: u64, #[serde(with = "time::serde::rfc3339")] pub created_at: time::OffsetDateTime, #[serde(with = "time::serde::rfc3339")] pub due_date: time::OffsetDateTime, pub html_url: Url, pub id: u64, pub is_locked: bool, pub labels: Vec