Skip to main content

ephemeris_forge_github/api/operations/
autolinks.rs

1use ephemeris_forge::RepoRef;
2
3use crate::api::error::ForgeError;
4use crate::api::model::Autolink;
5use crate::api::request::AutolinkBody;
6
7/// The autolinks operations of the GitHub API.
8pub trait AutolinksApi {
9    /// Read the repository's autolinks.
10    fn autolinks(
11        &self,
12        repository: &RepoRef,
13    ) -> impl Future<Output = Result<Vec<Autolink>, ForgeError>> + Send;
14
15    /// Create an autolink.
16    fn create_autolink(
17        &self,
18        repository: &RepoRef,
19        autolink: &AutolinkBody,
20    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
21
22    /// Delete the autolink `id`.
23    fn delete_autolink(
24        &self,
25        repository: &RepoRef,
26        id: u64,
27    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
28}