Skip to main content

ephemeris_forge_github/api/operations/
pages.rs

1use ephemeris_forge::RepoRef;
2
3use crate::api::error::ForgeError;
4use crate::api::model::Pages;
5use crate::api::request::{PagesCreate, PagesUpdate};
6
7/// The pages operations of the GitHub API.
8pub trait PagesApi {
9    /// Create the Pages site.
10    fn create_pages(
11        &self,
12        repository: &RepoRef,
13        site: &PagesCreate,
14    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
15
16    /// Delete the Pages site.
17    fn delete_pages(
18        &self,
19        repository: &RepoRef,
20    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
21
22    /// Read the Pages site. `None` means the repository has no site.
23    fn pages(
24        &self,
25        repository: &RepoRef,
26    ) -> impl Future<Output = Result<Option<Pages>, ForgeError>> + Send;
27
28    /// Update the Pages site.
29    fn update_pages(
30        &self,
31        repository: &RepoRef,
32        site: &PagesUpdate,
33    ) -> impl Future<Output = Result<(), ForgeError>> + Send;
34}